xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void bigendian_to_float(float *f, uint8_t *src) {
  uint8_t *b = (uint8_t *)&f;
  b[0] = src[3];
  b[1] = src[2];
  b[2] = src[1];
  b[3] = src[0];
}


x86 assembly (clang, -O0):
<bigendian_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bigendian_to_float(float* %0, i32* %1) {
%3 = alloca float*
%4 = alloca i32*
%5 = alloca i32*
store float* %0, float** %3
store i32* %1, i32** %4
%6 = bitcast float** %3 to i32*
store i32* %6, i32** %5
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = load i32, i32* %23
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @bigendian_to_float(float* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Blit_Init();
int /*<<< orphan*/ _Buf_Init();
int /*<<< orphan*/ _ISR_Init();
int /*<<< orphan*/ _Ports_Init();
int /*<<< orphan*/ _Stack_Init();
void Cleese_Initialize() {
  _Ports_Init();
  _ISR_Init();
  _Blit_Init();
  _Buf_Init();
  _Stack_Init();
}


x86 assembly (clang, -O0):
<Cleese_Initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_Ports_Init@plt>
mov    $0x0,%al
call   1070 <_ISR_Init@plt>
mov    $0x0,%al
call   1060 <_Blit_Init@plt>
mov    $0x0,%al
call   1050 <_Buf_Init@plt>
mov    $0x0,%al
call   1040 <_Stack_Init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cleese_Initialize>:
push   %rax
xor    %eax,%eax
call   1030 <_Ports_Init@plt>
xor    %eax,%eax
call   1070 <_ISR_Init@plt>
xor    %eax,%eax
call   1060 <_Blit_Init@plt>
xor    %eax,%eax
call   1050 <_Buf_Init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_Stack_Init@plt>

LLVM IR (-O0):
define void @Cleese_Initialize() {
%1 = call i32 (...) @_Ports_Init()
%2 = call i32 (...) @_ISR_Init()
%3 = call i32 (...) @_Blit_Init()
%4 = call i32 (...) @_Buf_Init()
%5 = call i32 (...) @_Stack_Init()
ret void
}

LLVM IR (-O2):
define void @Cleese_Initialize() {
%1 = tail call i32 (...) @_Ports_Init()
%2 = tail call i32 (...) @_ISR_Init()
%3 = tail call i32 (...) @_Blit_Init()
%4 = tail call i32 (...) @_Buf_Init()
%5 = tail call i32 (...) @_Stack_Init()
ret void
}
void free_matrix(short **matrix, unsigned char matrix_size) {
  unsigned char i;
  for (i = 0; i < matrix_size; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jge    1154 <free_matrix+0x44>
mov    -0x8(%rbp),%rax
movzbl -0xa(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xa(%rbp),%al
add    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    1126 <free_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <free_matrix+0x32>
movzbl %sil,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(i16** %0, i8 zeroext %1) {
%3 = alloca i16**
%4 = alloca i8
%5 = alloca i8
store i16** %0, i16*** %3
store i8 %1, i8* %4
store i8 0, i8* %5
br label %6
6: ; preds = %19, %2
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %22
12: ; preds = %6
%13 = load i16**, i16*** %3
%14 = load i8, i8* %5
%15 = zext i8 %14 to i64
%16 = getelementptr inbounds i16*, i16** %13, i64 %15
%17 = load i16*, i16** %16
%18 = bitcast i16* %17 to i8*
br label %19
19: ; preds = %12
%20 = load i8, i8* %5
%21 = add i8 %20, 1
store i8 %21, i8* %5
br label %6
22: ; preds = %6
%23 = load i16**, i16*** %3
%24 = bitcast i16** %23 to i8*
ret void
}

LLVM IR (-O2):
define void @free_matrix(i16** nocapture %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i8 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i16*, i16** %0, i64 %7
%9 = bitcast i16** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i16** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void GP_add_ps(void *arg, int num) { printf("PX # %d\n", num); }


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

x86 assembly (clang, -O2):
<GP_add_ps>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"PX # %d\0A\00"
define void @GP_add_ps(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xd0() {
  Assert_real((isdigit(208) == 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_isdigit.c",
              1045, ("isdigit should be 0 for 0xd0"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xd0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd0,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x415,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xd0>:
push   %rax
mov    $0xd0,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x415,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd0\00"
define void @t_isdigit_0xd0() {
%1 = call i64 @isdigit(i32 208)
%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 1045, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd0\00"
define void @t_isdigit_0xd0() {
%1 = tail call i64 @isdigit(i32 208)
%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 1045, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void av_adts_header_parse() {}


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

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

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

LLVM IR (-O2):
define void @av_adts_header_parse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int x = 1;
#pragma omp parallel
#pragma omp single
  {
#pragma omp task shared(x) depend(out : x)
    x = 2;
#pragma omp task shared(x) depend(in : x)
    if (x != 2)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     113e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int path_031_expected_1(int y) {
  int x = 0;
  switch (y)
    ;
  return x;
}


x86 assembly (clang, -O0):
<path_031_expected_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @path_031_expected_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %5 [
]
5: ; preds = %1
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @path_031_expected_1(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
void build_str_from_int32(char dest[5], uint32_t n) {
  sprintf(dest, "%c%c%c%c", n & 0xFF, (n >> 8) & 0xFF, (n >> 16) & 0xFF,
          (n >> 24) & 0xFF);
}


x86 assembly (clang, -O0):
<build_str_from_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
and    $0xff,%edx
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0xc(%rbp),%r8d
sar    $0x10,%r8d
and    $0xff,%r8d
mov    -0xc(%rbp),%r9d
sar    $0x18,%r9d
and    $0xff,%r9d
lea    0xea3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_str_from_int32>:
mov    %esi,%eax
movzbl %al,%edx
movzbl %ah,%ecx
shr    $0x10,%esi
movzbl %sil,%r8d
shr    $0x18,%eax
lea    0xed7(%rip),%rsi
mov    %eax,%r9d
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%c%c%c%c\00"
define void @build_str_from_int32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = load i32, i32* %4
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = load i32, i32* %4
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10, i32 %13, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%c%c%c%c\00"
define void @build_str_from_int32(i8* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = lshr i32 %1, 16
%7 = and i32 %6, 255
%8 = lshr i32 %1, 24
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %8)
ret void
}
int sys$display(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(6), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$display>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x6,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$display>:
mov    $0x6,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$display"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 6, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$display"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 6, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
void test4() {
  static int var;
  var = +5;
  var = -5;
  var = +5;
  var = -5;
  var = +5;
  var = -5;
  var = -5;
  var = -5;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,0x2f16(%rip)
movl   $0xfffffffb,0x2f0c(%rip)
ff ff ff
movl   $0x5,0x2f02(%rip)
movl   $0xfffffffb,0x2ef8(%rip)
ff ff ff
movl   $0x5,0x2eee(%rip)
movl   $0xfffffffb,0x2ee4(%rip)
ff ff ff
movl   $0xfffffffb,0x2eda(%rip)
ff ff ff
movl   $0xfffffffb,0x2ed0(%rip)
ff ff ff
pop    %rbp
ret

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

LLVM IR (-O0):
@test4.var = internal global i32 0
define void @test4() {
store i32 5, i32* @test4.var
store i32 -5, i32* @test4.var
store i32 5, i32* @test4.var
store i32 -5, i32* @test4.var
store i32 5, i32* @test4.var
store i32 -5, i32* @test4.var
store i32 -5, i32* @test4.var
store i32 -5, i32* @test4.var
ret void
}

LLVM IR (-O2):
define void @test4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void cleanup_module(void) { printk("** Goodbye Cruel World! **\n"); }


x86 assembly (clang, -O0):
<cleanup_module>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_module>:
lea    0xee9(%rip),%rdi
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"** Goodbye Cruel World! **\0A\00"
define void @cleanup_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"** Goodbye Cruel World! **\0A\00"
define void @cleanup_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
void usr2_handler(int s) { return; }


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

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

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

LLVM IR (-O2):
define void @usr2_handler(i32 %0) {
ret void
}
/* Variables and functions */
double pow(int, double);
double two_to_y(double x) { return pow(2, x); }


x86 assembly (clang, -O0):
<two_to_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_to_y>:
mov    $0x2,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @two_to_y(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(i32 2, double %3)
ret double %4
}

LLVM IR (-O2):
define double @two_to_y(double %0) {
%2 = tail call double @pow(i32 2, double %0)
ret double %2
}
int ab_cmp(int a, int b) {
  if (a == b)
    return 0;
  if (a > b)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<ab_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <ab_cmp+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1141 <ab_cmp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <ab_cmp+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <ab_cmp+0x41>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ab_cmp>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ab_cmp(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(void const *, size_t, size_t, int /*<<< orphan*/ *);
size_t fwrite2(const void *ptr, size_t size, size_t nmemb, FILE *stream,
               size_t *written_byte_count) {
  size_t n;
  n = fwrite(ptr, size, nmemb, stream);
  *written_byte_count = n * nmemb;
  return n;
}


x86 assembly (clang, -O0):
<fwrite2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fwrite@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
imul   -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite2>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rdx,%rbx
call   1030 <fwrite@plt>
imul   %rax,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @fwrite2(i8* %0, i64 %1, i64 %2, i32* %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i64*
%11 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i64* %4, i64** %10
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i32*, i32** %9
%16 = call i64 @fwrite(i8* %12, i64 %13, i64 %14, i32* %15)
store i64 %16, i64* %11
%17 = load i64, i64* %11
%18 = load i64, i64* %8
%19 = mul i64 %17, %18
%20 = load i64*, i64** %10
store i64 %19, i64* %20
%21 = load i64, i64* %11
ret i64 %21
}

LLVM IR (-O2):
define i64 @fwrite2(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3, i64* nocapture writeonly %4) {
%6 = tail call i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
%7 = mul i64 %6, %2
store i64 %7, i64* %4
ret i64 %6
}
/* Variables and functions */
int PAPI_thread_init(unsigned long (*)());
void papif_thread_init(unsigned long int (*handle)(void), int *check) {
  *check = PAPI_thread_init(handle);
}


x86 assembly (clang, -O0):
<papif_thread_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PAPI_thread_init@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_thread_init>:
push   %rbx
mov    %rsi,%rbx
call   1030 <PAPI_thread_init@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_thread_init(i64 ()* %0, i32* %1) {
%3 = alloca i64 ()*
%4 = alloca i32*
store i64 ()* %0, i64 ()** %3
store i32* %1, i32** %4
%5 = load i64 ()*, i64 ()** %3
%6 = bitcast i64 ()* %5 to i64 (...)*
%7 = call i32 @PAPI_thread_init(i64 (...)* %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @papif_thread_init(i64 ()* %0, i32* nocapture writeonly %1) {
%3 = bitcast i64 ()* %0 to i64 (...)*
%4 = tail call i32 @PAPI_thread_init(i64 (...)* %3)
store i32 %4, i32* %1
ret void
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ car(struct object *);
struct object *cdr(int /*<<< orphan*/);
struct object *prim_cdr(struct object *args) {
  return (cdr(car((args))));
}


x86 assembly (clang, -O0):
<prim_cdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <car@plt>
mov    %eax,%edi
call   1030 <cdr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim_cdr>:
push   %rax
call   1040 <car@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <cdr@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define %struct.object* @prim_cdr(%struct.object* %0) {
%2 = alloca %struct.object*
store %struct.object* %0, %struct.object** %2
%3 = load %struct.object*, %struct.object** %2
%4 = call i32 @car(%struct.object* %3)
%5 = call %struct.object* @cdr(i32 %4)
ret %struct.object* %5
}

LLVM IR (-O2):
%struct.object = type { i32 }
define %struct.object* @prim_cdr(%struct.object* %0) {
%2 = tail call i32 @car(%struct.object* %0)
%3 = tail call %struct.object* @cdr(i32 %2)
ret %struct.object* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *f;
  f = fopen("test.dat", "w");
  fprintf(f, "Hello world\n");
  fclose(f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int fabs(double);
int sprawdzRozw(double a, double b, double c, double x) {
  return (fabs(a * x * x * x * x + b * x * x + c) < 1e-5);
}


x86 assembly (clang, -O0):
<sprawdzRozw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe8e(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprawdzRozw>:
push   %rax
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sprawdzRozw(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = fmul double %9, %10
%12 = load double, double* %8
%13 = fmul double %11, %12
%14 = load double, double* %8
%15 = fmul double %13, %14
%16 = load double, double* %8
%17 = load double, double* %6
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %15, double %16, double %21)
%23 = load double, double* %7
%24 = fadd double %22, %23
%25 = call i32 @fabs(double %24)
%26 = sitofp i32 %25 to double
%27 = fcmp olt double %26, 1.000000e-05
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @sprawdzRozw(double %0, double %1, double %2, double %3) {
%5 = fmul double %0, %3
%6 = fmul double %5, %3
%7 = fmul double %6, %3
%8 = fmul double %1, %3
%9 = fmul double %8, %3
%10 = tail call double @llvm.fmuladd.f64(double %7, double %3, double %9)
%11 = fadd double %10, %2
%12 = tail call i32 @fabs(double %11)
%13 = icmp slt i32 %12, 1
%14 = zext i1 %13 to i32
ret i32 %14
}
void le_uint32_write(void *ptr, unsigned v) {
  unsigned char *ptr8 = (unsigned char *)ptr;
  ptr8[0] = v & 0xFF;
  ptr8[1] = (v >> 8) & 0xFF;
  ptr8[2] = (v >> 16) & 0xFF;
  ptr8[3] = (v >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<le_uint32_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_uint32_write>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @le_uint32_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i32, i32* %4
%19 = lshr i32 %18, 16
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = load i32, i32* %4
%25 = lshr i32 %24, 24
%26 = and i32 %25, 255
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 3
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @le_uint32_write(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
OP(ed, e3) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int deQueue();
int /*<<< orphan*/ printf(char *, long);
void *printThreadId(void *arg) {
  int sock = deQueue();
  long tid;
  tid = (long)arg;
  printf("Hi %ld\n", tid);
}


x86 assembly (clang, -O0):
<printThreadId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <deQueue@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printThreadId>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <deQueue@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Hi %ld\0A\00"
define i8* @printThreadId(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
%6 = call i32 (...) @deQueue()
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hi %ld\0A\00"
define noalias i8* @printThreadId(i8* %0) {
%2 = tail call i32 (...) @deQueue()
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* undef
}
/* Type definitions */
struct callFunctionItem {
  int dummy;
};

/* Variables and functions */
struct callFunctionItem *
AddFunctionToCallListWithContext(void *, char const *, int, void (*)(void *),
                                 struct callFunctionItem *,
                                 int /*<<< orphan*/ *);
struct callFunctionItem *AddFunctionToCallList(void *theEnv, const char *name,
                                               int priority,
                                               void (*func)(void *),
                                               struct callFunctionItem *head) {
  return AddFunctionToCallListWithContext(theEnv, name, priority, func, head,
                                          NULL);
}


x86 assembly (clang, -O0):
<AddFunctionToCallList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <AddFunctionToCallListWithContext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddFunctionToCallList>:
xor    %r9d,%r9d
jmp    1030 <AddFunctionToCallListWithContext@plt>

LLVM IR (-O0):
%struct.callFunctionItem = type { i32 }
define %struct.callFunctionItem* @AddFunctionToCallList(i8* %0, i8* %1, i32 %2, void (i8*)* %3, %struct.callFunctionItem* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca void (i8*)*
%10 = alloca %struct.callFunctionItem*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store void (i8*)* %3, void (i8*)** %9
store %struct.callFunctionItem* %4, %struct.callFunctionItem** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load void (i8*)*, void (i8*)** %9
%15 = load %struct.callFunctionItem*, %struct.callFunctionItem** %10
%16 = call %struct.callFunctionItem* @AddFunctionToCallListWithContext(i8* %11, i8* %12, i32 %13, void (i8*)* %14, %struct.callFunctionItem* %15, i32* null)
ret %struct.callFunctionItem* %16
}

LLVM IR (-O2):
%struct.callFunctionItem = type { i32 }
define %struct.callFunctionItem* @AddFunctionToCallList(i8* %0, i8* %1, i32 %2, void (i8*)* %3, %struct.callFunctionItem* %4) {
%6 = tail call %struct.callFunctionItem* @AddFunctionToCallListWithContext(i8* %0, i8* %1, i32 %2, void (i8*)* %3, %struct.callFunctionItem* %4, i32* null)
ret %struct.callFunctionItem* %6
}
/* Variables and functions */
char *strchr(char *d, int c) {
  while (c != *d) {
    if ('\0' == *d++)
      return NULL;
  }
  return d;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     114b <strchr+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1146 <strchr+0x46>
movq   $0x0,-0x8(%rbp)
jmp    1153 <strchr+0x53>
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %7, %10
br i1 %11, label %12, label %20
12: ; preds = %6
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = icmp eq i32 0, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i8* null, i8** %3
br label %22
19: ; preds = %12
br label %6
20: ; preds = %6
%21 = load i8*, i8** %4
store i8* %21, i8** %3
br label %22
22: ; preds = %20, %18
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %8
%12 = phi i8* [ null, %8 ], [ %4, %3 ]
ret i8* %12
}
int cairo_code_draw_toggleSwitch_get_width() { return 11; }


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

x86 assembly (clang, -O2):
<cairo_code_draw_toggleSwitch_get_width>:
mov    $0xb,%eax
ret

LLVM IR (-O0):
define i32 @cairo_code_draw_toggleSwitch_get_width() {
ret i32 11
}

LLVM IR (-O2):
define i32 @cairo_code_draw_toggleSwitch_get_width() {
ret i32 11
}
/* Variables and functions */
char *getlogin();
int main(void) {
  char *login;
  login = getlogin();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @getlogin()
ret i32 0
}
float Sleef_sinf_u35(float x) { return __builtin_sinf(x); }


x86 assembly (clang, -O0):
<Sleef_sinf_u35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_sinf_u35>:
jmp    1030 <sinf@plt>

LLVM IR (-O0):
define float @Sleef_sinf_u35(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sinf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Sleef_sinf_u35(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ warn(char *);
int configure(int strict) {
  if (strict)
    warn("init is not configurable");
  return -1;
}


x86 assembly (clang, -O0):
<configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1131 <configure+0x21>
lea    0xed4(%rip),%rdi
call   1030 <warn@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure>:
test   %edi,%edi
je     1125 <configure+0x15>
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <warn@plt>
add    $0x8,%rsp
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"init is not configurable\00"
define i32 @configure(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 %7
5: ; preds = %1
%6 = call i32 @warn(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 -1
}

LLVM IR (-O2):
@.str = [25 x i8] c"init is not configurable\00"
define i32 @configure(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @warn(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 -1
}
/* Variables and functions */
int japi_getfontascent(int);
int j_getfontascent(int arg0) { return (japi_getfontascent(arg0)); }


x86 assembly (clang, -O0):
<j_getfontascent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <japi_getfontascent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_getfontascent>:
jmp    1030 <japi_getfontascent@plt>

LLVM IR (-O0):
define i32 @j_getfontascent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @japi_getfontascent(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @j_getfontascent(i32 %0) {
%2 = tail call i32 @japi_getfontascent(i32 %0)
ret i32 %2
}
void gtk_socket_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_socket_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void *malloc(size_t);
void *getspace(int blk) {
  void *bp;
  bp = malloc((size_t)blk);
  if (bp == NULL)
    errx(11, "no memory");
  return bp;
}


x86 assembly (clang, -O0):
<getspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <getspace+0x34>
mov    $0xb,%edi
lea    0xeb1(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getspace>:
push   %rbx
movslq %edi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <getspace+0x22>
lea    0xec8(%rip),%rsi
mov    $0xb,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"no memory\00"
define i8* @getspace(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @errx(i32 11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"no memory\00"
define noalias i8* @getspace(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @errx(i32 11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xf7() {
  Assert_real((ispunct(247) == 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_ispunct.c",
              1240, ("ispunct should be 0 for 0xf7"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xf7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf7,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4d8,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf7\00"
define void @t_ispunct_0xf7() {
%1 = call i64 @ispunct(i32 247)
%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 1240, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf7\00"
define void @t_ispunct_0xf7() {
%1 = tail call i64 @ispunct(i32 247)
%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 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char *, char *);
FILE *my_fopen_write(char *filename) {
  if (filename == NULL || strcmp(filename, "-") == 0) {
    return stdout;
  }
  return fopen(filename, "wb");
}


x86 assembly (clang, -O0):
<my_fopen_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <my_fopen_write+0x31>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1164 <my_fopen_write+0x44>
mov    0x2e88(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <my_fopen_write+0x58>
mov    -0x10(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fopen_write>:
push   %rbx
test   %rdi,%rdi
je     114a <my_fopen_write+0x2a>
mov    %rdi,%rbx
lea    0xed0(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     114a <my_fopen_write+0x2a>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fopen@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.1 = [3 x i8] c"wb\00"
define i32* @my_fopen_write(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6, %1
%11 = load i32*, i32** @stdout
store i32* %11, i32** %2
br label %15
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %14, i32** %2
br label %15
15: ; preds = %12, %10
%16 = load i32*, i32** %2
ret i32* %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.1 = [3 x i8] c"wb\00"
define i32* @my_fopen_write(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %1
%7 = load i32*, i32** @stdout
br label %10
8: ; preds = %3
%9 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = phi i32* [ %7, %6 ], [ %9, %8 ]
ret i32* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmplt_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmplt_ps(__m128 __a, __m128 __b) {
  return _mm_cmplt_ps(__a, __b);
}


x86 assembly (clang, -O0):
<test_mm_cmplt_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_cmplt_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmplt_ps>:
jmp    1030 <_mm_cmplt_ps@plt>

LLVM IR (-O0):
define i32 @test_mm_cmplt_ps(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* %4
%7 = call i32 @_mm_cmplt_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmplt_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmplt_ps(i32 %0, i32 %1)
ret i32 %3
}