xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ _exit(int);
int open(char const *, int /*<<< orphan*/);
int open_dev(const char *devname) {
  int fd = -1;
  fd = open(devname, O_RDWR);
  if (fd < 0) {
    _exit(-1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115c <open_dev+0x3c>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_dev>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     1135 <open_dev+0x15>
pop    %rcx
ret
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @open_dev(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @_exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @open_dev(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @_exit(i32 -1)
unreachable
7: ; preds = %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ doExecution();
int main() {
  doExecution();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <doExecution@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <doExecution@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @doExecution()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @doExecution()
ret i32 0
}
int PDC_set_80x25() {}


x86 assembly (clang, -O0):
<PDC_set_80x25>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_set_80x25>:
ret

LLVM IR (-O0):
define i32 @PDC_set_80x25() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @PDC_set_80x25() {
ret i32 undef
}
/* Type definitions */
struct obuf {
  int dummy;
};

/* Variables and functions */
size_t obuf_capacity(struct obuf const *);
size_t obuf_nr_written(struct obuf const *);
size_t obuf_remaining(const struct obuf *ob) {
  return obuf_capacity(ob) - obuf_nr_written(ob);
}


x86 assembly (clang, -O0):
<obuf_remaining>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <obuf_capacity@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <obuf_nr_written@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obuf_remaining>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <obuf_capacity@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <obuf_nr_written@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.obuf = type { i32 }
define i64 @obuf_remaining(%struct.obuf* %0) {
%2 = alloca %struct.obuf*
store %struct.obuf* %0, %struct.obuf** %2
%3 = load %struct.obuf*, %struct.obuf** %2
%4 = call i64 @obuf_capacity(%struct.obuf* %3)
%5 = load %struct.obuf*, %struct.obuf** %2
%6 = call i64 @obuf_nr_written(%struct.obuf* %5)
%7 = sub i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.obuf = type { i32 }
define i64 @obuf_remaining(%struct.obuf* %0) {
%2 = tail call i64 @obuf_capacity(%struct.obuf* %0)
%3 = tail call i64 @obuf_nr_written(%struct.obuf* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n1, n2;
  scanf("%i %i", &n1, &n2);
  printf("SOMA = %i\n", n1 + n2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [11 x i8] c"SOMA = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [11 x i8] c"SOMA = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int length(char psw[]) {
  int i;
  for (i = 0; psw[i] != '\0'; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <length+0x37>
jmp    1129 <length+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret

LLVM IR (-O0):
define i32 @length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ someFunc(int, char, int);
void otherFunc() { someFunc(42, 'a', 7); }


x86 assembly (clang, -O0):
<otherFunc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
mov    $0x61,%esi
mov    $0x7,%edx
call   1030 <someFunc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<otherFunc>:
mov    $0x2a,%edi
mov    $0x61,%esi
mov    $0x7,%edx
jmp    1030 <someFunc@plt>

LLVM IR (-O0):
define void @otherFunc() {
%1 = call i32 @someFunc(i32 42, i8 signext 97, i32 7)
ret void
}

LLVM IR (-O2):
define void @otherFunc() {
%1 = tail call i32 @someFunc(i32 42, i8 signext 97, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationSettingsBank3Handle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void StabilizationSettingsBank3Logging() {
  UAVObjLogging(StabilizationSettingsBank3Handle());
}


x86 assembly (clang, -O0):
<StabilizationSettingsBank3Logging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <StabilizationSettingsBank3Handle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationSettingsBank3Logging>:
push   %rax
xor    %eax,%eax
call   1040 <StabilizationSettingsBank3Handle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @StabilizationSettingsBank3Logging() {
%1 = call i32 (...) @StabilizationSettingsBank3Handle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationSettingsBank3Logging() {
%1 = tail call i32 (...) @StabilizationSettingsBank3Handle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void *PulseRelay(void *ptr) { return 0; }


x86 assembly (clang, -O0):
<PulseRelay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PulseRelay>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @PulseRelay(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @PulseRelay(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ foo6();
void foo7(void) { foo6(); }


x86 assembly (clang, -O0):
<foo7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo6@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo7>:
xor    %eax,%eax
jmp    1030 <foo6@plt>

LLVM IR (-O0):
define void @foo7() {
%1 = call i32 (...) @foo6()
ret void
}

LLVM IR (-O2):
define void @foo7() {
%1 = tail call i32 (...) @foo6()
ret void
}
void testFuncStatementDecl1(void) {
  int declaration1 = 1001U;
  int declaration2 = 666U;
}


x86 assembly (clang, -O0):
<testFuncStatementDecl1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3e9,-0x4(%rbp)
movl   $0x29a,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFuncStatementDecl1>:
ret

LLVM IR (-O0):
define void @testFuncStatementDecl1() {
%1 = alloca i32
%2 = alloca i32
store i32 1001, i32* %1
store i32 666, i32* %2
ret void
}

LLVM IR (-O2):
define void @testFuncStatementDecl1() {
ret void
}
/* Variables and functions */
int esp_sdio_init();
int rockchip_wifi_init_module(void) { return esp_sdio_init(); }


x86 assembly (clang, -O0):
<rockchip_wifi_init_module>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <esp_sdio_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rockchip_wifi_init_module>:
xor    %eax,%eax
jmp    1030 <esp_sdio_init@plt>

LLVM IR (-O0):
define i32 @rockchip_wifi_init_module() {
%1 = call i32 (...) @esp_sdio_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @rockchip_wifi_init_module() {
%1 = tail call i32 (...) @esp_sdio_init()
ret i32 %1
}
/* Variables and functions */
double cos(double const);
char f_cos(double *a, const double *b) {
  *a = cos(*b);
  return (0);
}


x86 assembly (clang, -O0):
<f_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <cos@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_cos>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rsi),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @f_cos(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = call double @cos(double %6)
%8 = load double*, double** %3
store double %7, double* %8
ret i8 0
}

LLVM IR (-O2):
define signext i8 @f_cos(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = tail call double @cos(double %3)
store double %4, double* %0
ret i8 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void set_gpio(FILE *fd, uint8_t val) {
  fseek(fd, 0, SEEK_SET);
  fprintf(fd, "%d", val & 1);
  fflush(fd);
}


x86 assembly (clang, -O0):
<set_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
and    $0x1,%edx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_gpio>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
and    $0x1,%ebx
lea    0xead(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"%d\00"
define void @set_gpio(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @SEEK_SET
%7 = call i32 @fseek(i32* %5, i32 0, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = and i32 %9, 1
%11 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %3
%13 = call i32 @fflush(i32* %12)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"%d\00"
define void @set_gpio(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = and i32 %1, 1
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @fflush(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_integer(void *a) {
  int *a_int = (int *)a;
  printf("%d ", *a_int);
}


x86 assembly (clang, -O0):
<print_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_integer>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print_integer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_integer(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fd_power_initialize_with_update_interval(int);
void fd_power_initialize(void) { fd_power_initialize_with_update_interval(60); }


x86 assembly (clang, -O0):
<fd_power_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1030 <fd_power_initialize_with_update_interval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_power_initialize>:
mov    $0x3c,%edi
jmp    1030 <fd_power_initialize_with_update_interval@plt>

LLVM IR (-O0):
define void @fd_power_initialize() {
%1 = call i32 @fd_power_initialize_with_update_interval(i32 60)
ret void
}

LLVM IR (-O2):
define void @fd_power_initialize() {
%1 = tail call i32 @fd_power_initialize_with_update_interval(i32 60)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t combine(uint32_t life, uint16_t sess) {
  if (life > 4194303) {
    life = 4194303;
  }
  if (sess > 1023) {
    sess = 1023;
  }
  uint32_t combined;
  combined = (life << 10) | sess;
  return combined;
}


x86 assembly (clang, -O0):
<combine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x3fffff,-0x4(%rbp)
jle    111e <combine+0x1e>
movl   $0x3fffff,-0x4(%rbp)
cmpl   $0x3ff,-0x8(%rbp)
jle    1132 <combine+0x32>
movl   $0x3ff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<combine>:
cmp    $0x3fffff,%edi
mov    $0x3fffff,%eax
cmovl  %edi,%eax
cmp    $0x3ff,%esi
mov    $0x3ff,%ecx
cmovl  %esi,%ecx
shl    $0xa,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @combine(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 4194303
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 4194303, i32* %3
br label %9
9: ; preds = %8, %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1023
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1023, i32* %4
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %3
%15 = shl i32 %14, 10
%16 = load i32, i32* %4
%17 = or i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @combine(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 4194303
%4 = select i1 %3, i32 %0, i32 4194303
%5 = icmp slt i32 %1, 1023
%6 = select i1 %5, i32 %1, i32 1023
%7 = shl i32 %4, 10
%8 = or i32 %7, %6
ret i32 %8
}
void SetArrayToZero(long long int arr[], long long int count) {
  long long int i = 0;
  for (i = 0; i < count; i++) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<SetArrayToZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    114b <SetArrayToZero+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <SetArrayToZero+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetArrayToZero>:
test   %rsi,%rsi
jle    1128 <SetArrayToZero+0x18>
push   %rax
mov    %rsi,%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @SetArrayToZero(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i64*, i64** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i64, i64* %11, i64 %12
store i64 0, i64* %13
br label %14
14: ; preds = %10
%15 = load i64, i64* %5
%16 = add nsw i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @SetArrayToZero(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = bitcast i64* %0 to i8*
%6 = shl nuw i64 %1, 3
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int uart_recv();
int uart_getc(void) {
  int c = uart_recv();
  c = (c == '\r') ? '\n' : c;
  return c;
}


x86 assembly (clang, -O0):
<uart_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <uart_recv@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xd,-0x4(%rbp)
jne    1139 <uart_getc+0x29>
mov    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <uart_getc+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getc>:
push   %rax
xor    %eax,%eax
call   1030 <uart_recv@plt>
cmp    $0xd,%eax
mov    $0xa,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_getc() {
%1 = alloca i32
%2 = call i32 (...) @uart_recv()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 13
br i1 %4, label %5, label %6
5: ; preds = %0
br label %8
6: ; preds = %0
%7 = load i32, i32* %1
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 10, %5 ], [ %7, %6 ]
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @uart_getc() {
%1 = tail call i32 (...) @uart_recv()
%2 = icmp eq i32 %1, 13
%3 = select i1 %2, i32 10, i32 %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_screen_hold();
int /*<<< orphan*/ roadmap_start_periodic();
void roadmap_start_hold_map(void) {
  roadmap_start_periodic();
  roadmap_screen_hold();
}


x86 assembly (clang, -O0):
<roadmap_start_hold_map>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <roadmap_start_periodic@plt>
mov    $0x0,%al
call   1040 <roadmap_screen_hold@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_start_hold_map>:
push   %rax
xor    %eax,%eax
call   1030 <roadmap_start_periodic@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <roadmap_screen_hold@plt>

LLVM IR (-O0):
define void @roadmap_start_hold_map() {
%1 = call i32 (...) @roadmap_start_periodic()
%2 = call i32 (...) @roadmap_screen_hold()
ret void
}

LLVM IR (-O2):
define void @roadmap_start_hold_map() {
%1 = tail call i32 (...) @roadmap_start_periodic()
%2 = tail call i32 (...) @roadmap_screen_hold()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ wnoutrefresh(int /*<<< orphan*/ *);
int /*<<< orphan*/ wprint(int /*<<< orphan*/ *, char const *);
void wprinta(WINDOW *win, const char str[], int line_attrs) {
  wattron(win, line_attrs);
  wprint(win, str);
  wattroff(win, line_attrs);
  wnoutrefresh(win);
}


x86 assembly (clang, -O0):
<wprinta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <wattron@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wprint@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <wattroff@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wnoutrefresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wprinta>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
call   1060 <wattron@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <wprint@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <wattroff@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <wnoutrefresh@plt>

LLVM IR (-O0):
define void @wprinta(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = call i32 @wattron(i32* %7, i32 %8)
%10 = load i32*, i32** %4
%11 = load i8*, i8** %5
%12 = call i32 @wprint(i32* %10, i8* %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = call i32 @wattroff(i32* %13, i32 %14)
%16 = load i32*, i32** %4
%17 = call i32 @wnoutrefresh(i32* %16)
ret void
}

LLVM IR (-O2):
define void @wprinta(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @wattron(i32* %0, i32 %2)
%5 = tail call i32 @wprint(i32* %0, i8* %1)
%6 = tail call i32 @wattroff(i32* %0, i32 %2)
%7 = tail call i32 @wnoutrefresh(i32* %0)
ret void
}
int LowestBitIndexLL(unsigned long long x) { return __builtin_ffsll(x) - 1; }


x86 assembly (clang, -O0):
<LowestBitIndexLL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowestBitIndexLL>:
bsf    %rdi,%rcx
cmp    $0x1,%rdi
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @LowestBitIndexLL(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = add i64 %4, 1
%6 = icmp eq i64 %3, 0
%7 = select i1 %6, i64 0, i64 %5
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @LowestBitIndexLL(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = icmp eq i64 %0, 0
%4 = trunc i64 %2 to i32
%5 = select i1 %3, i32 -1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void bail(const char *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bail>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @bail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @bail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void OneFunction() {}


x86 assembly (clang, -O0):
<OneFunction>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneFunction>:
ret

LLVM IR (-O0):
define void @OneFunction() {
ret void
}

LLVM IR (-O2):
define void @OneFunction() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ init_memoryToIO();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setGpioinInput(int);
void initGpio() {
  if (init_memoryToIO()) {
    printf("Error in init_memoryToIO() \n");
    exit(1);
  }
  setGpioinInput(2);
  setGpioinInput(1);
  setGpioinInput(0);
}


x86 assembly (clang, -O0):
<initGpio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_memoryToIO@plt>
cmp    $0x0,%rax
je     116b <initGpio+0x2b>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x2,%edi
call   1040 <setGpioinInput@plt>
mov    $0x1,%edi
call   1040 <setGpioinInput@plt>
xor    %edi,%edi
call   1040 <setGpioinInput@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initGpio>:
push   %rax
xor    %eax,%eax
call   1050 <init_memoryToIO@plt>
test   %rax,%rax
jne    1169 <initGpio+0x29>
mov    $0x2,%edi
call   1040 <setGpioinInput@plt>
mov    $0x1,%edi
call   1040 <setGpioinInput@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <setGpioinInput@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error in init_memoryToIO() \0A\00"
define void @initGpio() {
%1 = call i64 (...) @init_memoryToIO()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = call i32 @setGpioinInput(i32 2)
%8 = call i32 @setGpioinInput(i32 1)
%9 = call i32 @setGpioinInput(i32 0)
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Error in init_memoryToIO() \00"
define void @initGpio() {
%1 = tail call i64 (...) @init_memoryToIO()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @setGpioinInput(i32 2)
%8 = tail call i32 @setGpioinInput(i32 1)
%9 = tail call i32 @setGpioinInput(i32 0)
ret void
}
void foo012() {}


x86 assembly (clang, -O0):
<foo012>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo012>:
ret

LLVM IR (-O0):
define void @foo012() {
ret void
}

LLVM IR (-O2):
define void @foo012() {
ret void
}
unsigned int f3(unsigned int yyy) { return yyy ?: -1; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1121 <f3+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112e <f3+0x2e>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <f3+0x2e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
cmp    $0x1,%edi
sbb    %eax,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = phi i32 [ %3, %5 ], [ -1, %6 ]
ret i32 %8
}

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 -1, i32 %0
ret i32 %3
}
/* Variables and functions */
int GetInt();
int /*<<< orphan*/ printf(char *);
int main(void) {
  int n;
  do {
    printf("Please give me a positive int: ");
    n = GetInt();
  } while (n < 1);
  printf("Thanks for the positive int!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <GetInt@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     112f <main+0xf>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <GetInt@plt>
test   %eax,%eax
jle    1140 <main+0x10>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Please give me a positive int: \00"
@.str.1 = [30 x i8] c"Thanks for the positive int!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @GetInt()
store i32 %5, i32* %2
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 1
br i1 %8, label %3, label %9
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [32 x i8] c"Please give me a positive int: \00"
@str = [29 x i8] c"Thanks for the positive int!\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @GetInt()
%4 = icmp slt i32 %3, 1
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *counted_calloc(size_t nmemb, size_t size, unsigned long long *counter) {
  if (counter != NULL) {
    (*counter) += size;
  }
  return calloc(nmemb, size);
}


x86 assembly (clang, -O0):
<counted_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     113d <counted_calloc+0x2d>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counted_calloc>:
test   %rdx,%rdx
je     1118 <counted_calloc+0x8>
add    %rsi,(%rdx)
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @counted_calloc(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
%8 = icmp ne i64* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i64, i64* %5
%11 = load i64*, i64** %6
%12 = load i64, i64* %11
%13 = add i64 %12, %10
store i64 %13, i64* %11
br label %14
14: ; preds = %9, %3
%15 = load i64, i64* %4
%16 = load i64, i64* %5
%17 = call i8* @calloc(i64 %15, i64 %16)
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @counted_calloc(i64 %0, i64 %1, i64* %2) {
%4 = icmp eq i64* %2, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i64, i64* %2
%7 = add i64 %6, %1
store i64 %7, i64* %2
br label %8
8: ; preds = %5, %3
%9 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int /*<<< orphan*/);
void t_isupper_0x00() {
  Assert_real((isupper(0) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              5, ("isupper should be 0 for 0x00"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
lea    0xf5e(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf69(%rip),%rcx
mov    $0x5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x00\00"
define void @t_isupper_0x00() {
%1 = call i64 @isupper(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x00\00"
define void @t_isupper_0x00() {
%1 = tail call i64 @isupper(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
long double sinh(double);
__attribute__((weak)) long double sinhl(long double x) {
  return sinh((double)x);
}


x86 assembly (clang, -O0):
<sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sinh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinhl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <sinh@plt>

LLVM IR (-O0):
define weak x86_fp80 @sinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @sinh(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @sinhl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @sinh(double %2)
ret x86_fp80 %3
}
void dummymacfix() {}


x86 assembly (clang, -O0):
<dummymacfix>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummymacfix>:
ret

LLVM IR (-O0):
define void @dummymacfix() {
ret void
}

LLVM IR (-O2):
define void @dummymacfix() {
ret void
}
/* Variables and functions */
int sscanf(char const *, char *, double *);
int str_to_float(const char *str, double *val) {
  return (1 == sscanf(str, "%lf", val));
}


x86 assembly (clang, -O0):
<str_to_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_float>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @str_to_float(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = load i8*, i8** %3
%6 = load double*, double** %4
%7 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%8 = icmp eq i32 1, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @str_to_float(i8* nocapture %0, double* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
int Operand_uimm8x2_decode(unsigned int *valp) {
  unsigned uimm8x2_0, imm8_0;
  imm8_0 = *valp & 0xff;
  uimm8x2_0 = imm8_0 << 1;
  *valp = uimm8x2_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm8x2_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm8x2_decode>:
mov    (%rdi),%eax
movzbl %al,%eax
add    %eax,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm8x2_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 255
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm8x2_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 1
%4 = and i32 %3, 510
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int strlen(char *s) {
  int len = 0;
  while (*s) {
    len++;
    s++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  printf("!!! Rebooting Now !!!\n");
  system("/sbin/reboot");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"!!! Rebooting Now !!!\0A\00"
@.str.1 = [13 x i8] c"/sbin/reboot\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"/sbin/reboot\00"
@str = [22 x i8] c"!!! Rebooting Now !!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *integer_ptr;
  float *float_ptr;
  int my_int = 17;
  float my_float = 23.5;
  integer_ptr = &my_int;
  float_ptr = &my_float;
  *integer_ptr = *float_ptr;
  printf("%d\n\n", *integer_ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x1c(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cvttss2si (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x17,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca float*
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
store i32 17, i32* %4
store float 2.350000e+01, float* %5
store i32* %4, i32** %2
store float* %5, float** %3
%6 = load float*, float** %3
%7 = load float, float* %6
%8 = fptosi float %7 to i32
%9 = load i32*, i32** %2
store i32 %8, i32* %9
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 23)
ret i32 0
}
float roughness_to_spec_power(float m) { return 2.0 / (m * m) - 2.0; }


x86 assembly (clang, -O0):
<roughness_to_spec_power>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<roughness_to_spec_power>:
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef0(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @roughness_to_spec_power(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fdiv double 2.000000e+00, %6
%8 = fsub double %7, 2.000000e+00
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @roughness_to_spec_power(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
%4 = fdiv double 2.000000e+00, %3
%5 = fadd double %4, -2.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
void ssl_shutdown(void **ssl) {}


x86 assembly (clang, -O0):
<ssl_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_shutdown>:
ret

LLVM IR (-O0):
define void @ssl_shutdown(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
ret void
}

LLVM IR (-O2):
define void @ssl_shutdown(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_cmp();
int /*<<< orphan*/ e_izpx();
void e_cmp_izpx() {
  e_izpx();
  e_cmp();
}


x86 assembly (clang, -O0):
<e_cmp_izpx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <e_izpx@plt>
mov    $0x0,%al
call   1040 <e_cmp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_cmp_izpx>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_cmp@plt>

LLVM IR (-O0):
define void @e_cmp_izpx() {
%1 = call i32 (...) @e_izpx()
%2 = call i32 (...) @e_cmp()
ret void
}

LLVM IR (-O2):
define void @e_cmp_izpx() {
%1 = tail call i32 (...) @e_izpx()
%2 = tail call i32 (...) @e_cmp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ F_WRLCK;
int fd_get_lock(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fd_get_writew_lock(int fd) { return (fd_get_lock(fd, F_SETLKW, F_WRLCK)); }


x86 assembly (clang, -O0):
<fd_get_writew_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
call   1030 <fd_get_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_get_writew_lock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fd_get_lock@plt>

LLVM IR (-O0):
@F_SETLKW = global i32 0
@F_WRLCK = global i32 0
define i32 @fd_get_writew_lock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETLKW
%5 = load i32, i32* @F_WRLCK
%6 = call i32 @fd_get_lock(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@F_SETLKW = global i32 0
@F_WRLCK = global i32 0
define i32 @fd_get_writew_lock(i32 %0) {
%2 = load i32, i32* @F_SETLKW
%3 = load i32, i32* @F_WRLCK
%4 = tail call i32 @fd_get_lock(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
void bar(x) int x;
{ printf("%x\n", x); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define void @bar(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int add(int, int);
int main(int ac, char **av) { return add(42, 21); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2a,%edi
mov    $0x15,%esi
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%edi
mov    $0x15,%esi
jmp    1030 <add@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @add(i32 42, i32 21)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 42, i32 21)
ret i32 %3
}