2023-10-04 15:40:22 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
2023-12-31 23:32:17 +01:00
|
|
|
#include <stdlib.h>
|
2023-10-04 15:40:22 +02:00
|
|
|
#include <string.h>
|
|
|
|
|
2023-12-31 23:32:17 +01:00
|
|
|
int equal_string(const char *s1, const char *s2) {
|
|
|
|
return (strcmp(s1, s2) == 0 ? 1 : 0);
|
2023-10-04 15:40:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int equal_char(char c1, char c2) {
|
|
|
|
return (c1 == c2 ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
2023-12-31 23:32:17 +01:00
|
|
|
void print_string(const char *s) {
|
2023-10-04 15:40:22 +02:00
|
|
|
printf("%s", s);
|
|
|
|
}
|
|
|
|
|
|
|
|
void print_int(int64_t n) {
|
2023-12-31 23:32:17 +01:00
|
|
|
printf("%ld", n);
|
2023-10-04 15:40:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void observe_int(int64_t n) {
|
|
|
|
print_int(n);
|
|
|
|
}
|
|
|
|
|
2023-12-31 23:32:17 +01:00
|
|
|
intptr_t *allocate_block(int64_t n) {
|
|
|
|
return (intptr_t *)malloc(n * sizeof(int64_t));
|
2023-10-04 15:40:22 +02:00
|
|
|
}
|
|
|
|
|
2023-12-31 23:32:17 +01:00
|
|
|
intptr_t read_block(intptr_t *block, int64_t n) {
|
2023-10-04 15:40:22 +02:00
|
|
|
return block[n];
|
|
|
|
}
|
|
|
|
|
2023-12-31 23:32:17 +01:00
|
|
|
int64_t write_block(intptr_t *block, int64_t n, intptr_t v) {
|
2023-10-04 15:40:22 +02:00
|
|
|
block[n] = v;
|
|
|
|
return 0;
|
|
|
|
}
|
2024-01-01 10:44:25 +01:00
|
|
|
|
2024-01-01 10:48:14 +01:00
|
|
|
void add_eight_int(int64_t x1, int64_t x2, int64_t x3, int64_t x4, int64_t x5,
|
|
|
|
int64_t x6, int64_t x7, int64_t x8) {
|
|
|
|
return observe_int(x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8);
|
2024-01-01 10:44:25 +01:00
|
|
|
}
|