xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
int32_t UP3D_GetHeaterState(int heater) {
  if ((heater < 1) || (heater > 3))
    return -1;
  return UP3D_GetParameter(0x14 + heater - 1);
}


x86 assembly (clang, -O0):
<UP3D_GetHeaterState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     112f <UP3D_GetHeaterState+0x1f>
cmpl   $0x3,-0x8(%rbp)
jle    113b <UP3D_GetHeaterState+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <UP3D_GetHeaterState+0x3c>
mov    -0x8(%rbp),%edi
add    $0x14,%edi
sub    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetHeaterState>:
lea    -0x4(%rdi),%eax
cmp    $0xfffffffd,%eax
jae    111e <UP3D_GetHeaterState+0xe>
mov    $0xffffffff,%eax
ret
add    $0x13,%edi
jmp    1030 <UP3D_GetParameter@plt>

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

LLVM IR (-O2):
define i32 @UP3D_GetHeaterState(i32 %0) {
%2 = add i32 %0, -4
%3 = icmp ult i32 %2, -3
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nuw nsw i32 %0, 19
%6 = tail call i32 @UP3D_GetParameter(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void putString(const char *s) { printf(s); }


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

x86 assembly (clang, -O2):
<putString>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @putString(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_strings(char *s1, char *s2) {
  if (s1) {
    free(s1);
  }
  if (s2) {
    free(s2);
  }
}


x86 assembly (clang, -O0):
<free_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <free_strings+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
je     1148 <free_strings+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_strings>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     111e <free_strings+0xe>
call   1030 <free@plt>
test   %rbx,%rbx
je     112c <free_strings+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_strings(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @free(i8* %1)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, int);
float addition(float a, int b) {
  printf("a=%f b=%d\n", a, b);
  return a + b;
}


x86 assembly (clang, -O0):
<addition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addition>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movss  %xmm0,0xc(%rsp)
lea    0xedc(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
addss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a=%f b=%d\0A\00"
define float @addition(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %5, i32 %6)
%8 = load float, float* %3
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
%11 = fadd float %8, %10
ret float %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"a=%f b=%d\0A\00"
define float @addition(float %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %0, i32 %1)
%4 = sitofp i32 %1 to float
%5 = fadd float %4, %0
ret float %5
}
/* Type definitions */
struct DateCriteriaPart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeDateCriteriaPart(struct DateCriteriaPart *);
void setDateCriteriaPart(struct DateCriteriaPart **part,
                         struct DateCriteriaPart *newValue) {
  if (*part != NULL) {
    freeDateCriteriaPart(*part);
  }
  *part = newValue;
}


x86 assembly (clang, -O0):
<setDateCriteriaPart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113a <setDateCriteriaPart+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <freeDateCriteriaPart@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDateCriteriaPart>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1127 <setDateCriteriaPart+0x17>
call   1030 <freeDateCriteriaPart@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.DateCriteriaPart = type { i32 }
define void @setDateCriteriaPart(%struct.DateCriteriaPart** %0, %struct.DateCriteriaPart* %1) {
%3 = alloca %struct.DateCriteriaPart**
%4 = alloca %struct.DateCriteriaPart*
store %struct.DateCriteriaPart** %0, %struct.DateCriteriaPart*** %3
store %struct.DateCriteriaPart* %1, %struct.DateCriteriaPart** %4
%5 = load %struct.DateCriteriaPart**, %struct.DateCriteriaPart*** %3
%6 = load %struct.DateCriteriaPart*, %struct.DateCriteriaPart** %5
%7 = icmp ne %struct.DateCriteriaPart* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.DateCriteriaPart**, %struct.DateCriteriaPart*** %3
%10 = load %struct.DateCriteriaPart*, %struct.DateCriteriaPart** %9
%11 = call i32 @freeDateCriteriaPart(%struct.DateCriteriaPart* %10)
br label %12
12: ; preds = %8, %2
%13 = load %struct.DateCriteriaPart*, %struct.DateCriteriaPart** %4
%14 = load %struct.DateCriteriaPart**, %struct.DateCriteriaPart*** %3
store %struct.DateCriteriaPart* %13, %struct.DateCriteriaPart** %14
ret void
}

LLVM IR (-O2):
%struct.DateCriteriaPart = type { i32 }
define void @setDateCriteriaPart(%struct.DateCriteriaPart** nocapture %0, %struct.DateCriteriaPart* %1) {
%3 = load %struct.DateCriteriaPart*, %struct.DateCriteriaPart** %0
%4 = icmp eq %struct.DateCriteriaPart* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @freeDateCriteriaPart(%struct.DateCriteriaPart* %3)
br label %7
7: ; preds = %5, %2
store %struct.DateCriteriaPart* %1, %struct.DateCriteriaPart** %0
ret void
}
int isprime(int n) {
  int imax = n / 2;
  int i;
  for (i = 2; i <= imax; i++) {
    if (n % i)
      continue;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1157 <isprime+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
je     113d <isprime+0x3d>
jmp    1149 <isprime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    115e <isprime+0x5e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <isprime+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <isprime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <isprime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <isprime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @isprime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 2
store i32 %7, i32* %4
store i32 2, i32* %5
br label %8
8: ; preds = %19, %1
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
br label %19
18: ; preds = %12
store i32 0, i32* %2
br label %23
19: ; preds = %17
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
store i32 1, i32* %2
br label %23
23: ; preds = %22, %18
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x50() {
  Assert_real((isprint(80)),
              "/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_isprint.c",
              405, ("isprint should be 1 for P"));
}


x86 assembly (clang, -O0):
<t_isprint_0x50>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x195,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x50>:
push   %rax
mov    $0x50,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x195,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for P\00"
define void @t_isprint_0x50() {
%1 = call i32 @isprint(i32 80)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for P\00"
define void @t_isprint_0x50() {
%1 = tail call i32 @isprint(i32 80)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  {
    state[0UL] = (input[0UL] + 914778474UL) * 2674260758U;
    if (state[0UL] & 1U) {
      state[0UL] += state[0UL];
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = state[0UL] * 238420169UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x3686696a,%rax
movabs $0x9f65fb16,%rcx
imul   %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <RandomFunc+0x4f>
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <RandomFunc+0x58>
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   $0xe3600c9,%rax,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
imul   $0xa36c488c,(%rdi),%eax
add    $0x95df75f8,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = add i64 %9, 914778474
%11 = mul i64 %10, 2674260758
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %12, i32* %13
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %14
%16 = and i32 %15, 1
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %29
18: ; preds = %2
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%22 = load i32, i32* %21
%23 = add i32 %22, %20
store i32 %23, i32* %21
%24 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%27 = load i32, i32* %26
%28 = add i32 %27, %25
store i32 %28, i32* %26
br label %35
29: ; preds = %2
%30 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%31 = load i32, i32* %30
%32 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%33 = load i32, i32* %32
%34 = add i32 %33, %31
store i32 %34, i32* %32
br label %35
35: ; preds = %29, %18
%36 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%37 = load i32, i32* %36
%38 = zext i32 %37 to i64
%39 = mul i64 %38, 238420169
%40 = trunc i64 %39 to i32
%41 = load i32*, i32** %4
%42 = getelementptr inbounds i32, i32* %41, i64 0
store i32 %40, i32* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = mul i32 %3, -1553184628
%5 = add i32 %4, -1780517384
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int dfloor(int /*<<< orphan*/);
int /*<<< orphan*/ mod(double, int);
double square(double a) {
  if (dfloor(mod(a, 2)) == 1) {
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <mod@plt>
mov    %eax,%edi
call   1040 <dfloor@plt>
cmp    $0x1,%eax
jne    115e <square+0x3e>
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116b <square+0x4b>
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rax
mov    $0x2,%edi
call   1030 <mod@plt>
mov    %eax,%edi
call   1040 <dfloor@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
lea    0xebf(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @square(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @mod(double %4, i32 2)
%6 = call i32 @dfloor(i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store double -1.000000e+00, double* %2
br label %10
9: ; preds = %1
store double 1.000000e+00, double* %2
br label %10
10: ; preds = %9, %8
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @square(double %0) {
%2 = tail call i32 @mod(double %0, i32 2)
%3 = tail call i32 @dfloor(i32 %2)
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, double -1.000000e+00, double 1.000000e+00
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ cww__write(int /*<<< orphan*/);
void cww_ref(int64_t refid) { cww__write(refid); }


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

x86 assembly (clang, -O2):
<cww_ref>:
jmp    1030 <cww__write@plt>

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

LLVM IR (-O2):
define void @cww_ref(i32 %0) {
%2 = tail call i32 @cww__write(i32 %0)
ret void
}
void kthread_should_stop(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<kthread_should_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kthread_should_stop>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.kthread_should_stop = [20 x i8] c"kthread_should_stop\00"
define void @kthread_should_stop() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.kthread_should_stop, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.kthread_should_stop = [20 x i8] c"kthread_should_stop\00"
define void @kthread_should_stop() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.kthread_should_stop, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void __eprintf(const char *fmt, const char *expr, int line, const char *file) {
  fprintf(stderr, fmt, expr, line, file);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<__eprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1040 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__eprintf>:
push   %rbx
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2e9d(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @__eprintf(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* %10, i8* %11, i32 %12, i8* %13)
%15 = load i32, i32* @stderr
%16 = call i32 @fflush(i32 %15)
%17 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @__eprintf(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* %0, i8* %1, i32 %2, i8* %3)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x31() {
  Assert_real((isprint(49)),
              "/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_isprint.c",
              250, ("isprint should be 1 for 1"));
}


x86 assembly (clang, -O0):
<t_isprint_0x31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xfa,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x31>:
push   %rax
mov    $0x31,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xfa,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 1\00"
define void @t_isprint_0x31() {
%1 = call i32 @isprint(i32 49)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 1\00"
define void @t_isprint_0x31() {
%1 = tail call i32 @isprint(i32 49)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sha1_write(void *, unsigned char const *, unsigned int);
void sha1_update(void *context, unsigned char const *buf, unsigned int len) {
  sha1_write(context, buf, len);
}


x86 assembly (clang, -O0):
<sha1_update>:
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    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <sha1_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1_update>:
jmp    1030 <sha1_write@plt>

LLVM IR (-O0):
define void @sha1_update(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @sha1_write(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @sha1_update(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @sha1_write(i8* %0, i8* %1, i32 %2)
ret void
}
void rop3_219_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_219_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_219_0_0>:
xor    %esi,%edx
mov    (%rdi),%al
xor    %sil,%al
and    %dl,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_219_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = trunc i32 %30 to i8
store i8 %31, i8* %7
%32 = load i8, i8* %7
%33 = load i8*, i8** %4
store i8 %32, i8* %33
ret void
}

LLVM IR (-O2):
define void @rop3_219_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = and i8 %6, %4
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int errno;
int symlink(char const *, char const *);
int make_symlink(const char *from, const char *to) {
  int err;
  err = symlink(to, from);
  if (err)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<make_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <symlink@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114d <make_symlink+0x3d>
xor    %eax,%eax
mov    0x2e9d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <make_symlink+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_symlink>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <symlink@plt>
mov    0x2eba(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @make_symlink(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @symlink(i8* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @errno
%14 = sub nsw i32 0, %13
store i32 %14, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @make_symlink(i8* %0, i8* %1) {
%3 = tail call i32 @symlink(i8* %1, i8* %0)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 0, i32 %6
ret i32 %7
}
int rt_numa_numa_node_of_cpu(int cpu) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @rt_numa_numa_node_of_cpu(i32 %0) {
ret i32 -1
}
int main(int argc, char **argv) {
  for (int pass = 0; pass < 1000; pass++) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1139 <main+0x39>
jmp    112b <main+0x2b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_server_add_insecure_http2_port() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_server_add_insecure_http2_port>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_server_add_insecure_http2_port>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_add_insecure_http2_port() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_add_insecure_http2_port() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int tamanhostring(char *string) {
  int i;
  for (i = 0; string[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<tamanhostring>:
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 <tamanhostring+0x37>
jmp    1129 <tamanhostring+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <tamanhostring+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tamanhostring(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 @tamanhostring(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 */
char *id2Token(int);
int /*<<< orphan*/ printf(char *, ...);
int tokenPop(unsigned int *);
int listStack(unsigned int repo) {
  return 0;
  int i;
  printf("in stack : ");
  while ((i = tokenPop(&repo)) != 0) {
    printf("%10s\t", id2Token(i));
  }
  printf("\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @listStack(i32 %0) {
ret i32 0
}
regx0adrx1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[x0]) <= (((unsigned short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114c <regx0adrx1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <regx0adrx1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrx1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setbe  %al
ret

LLVM IR (-O0):
define i32 @regx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %23
%25 = load i16, i16* %24
%26 = zext i16 %25 to i32
%27 = icmp sle i32 %21, %26
br i1 %27, label %28, label %29
28: ; preds = %6
store i32 1, i32* %7
br label %30
29: ; preds = %6
store i32 0, i32* %7
br label %30
30: ; preds = %29, %28
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
define i32 @regx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %10
%12 = load i16, i16* %11
%13 = icmp ule i16 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
void XLocaleOfOM() {}


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

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

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

LLVM IR (-O2):
define void @XLocaleOfOM() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ha7net_writeblock_free(char *data) {
  if (data)
    free(data);
}


x86 assembly (clang, -O0):
<ha7net_writeblock_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ha7net_writeblock_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ha7net_writeblock_free>:
test   %rdi,%rdi
je     111a <ha7net_writeblock_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ha7net_writeblock_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ha7net_writeblock_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef enum genwqe_card_state {
  ____Placeholder_genwqe_card_state
} genwqe_card_state;

/* Variables and functions */
int /*<<< orphan*/ GENWQE_GET_CARD_STATE;
int ioctl(int, int /*<<< orphan*/, int *);
int __genwqe_card_get_state(int fd, enum genwqe_card_state *state) {
  return ioctl(fd, GENWQE_GET_CARD_STATE, state);
}


x86 assembly (clang, -O0):
<__genwqe_card_get_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__genwqe_card_get_state>:
mov    %rsi,%rdx
mov    0x2ede(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@GENWQE_GET_CARD_STATE = global i32 0
define i32 @__genwqe_card_get_state(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* @GENWQE_GET_CARD_STATE
%7 = load i32*, i32** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@GENWQE_GET_CARD_STATE = global i32 0
define i32 @__genwqe_card_get_state(i32 %0, i32* %1) {
%3 = load i32, i32* @GENWQE_GET_CARD_STATE
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *s) {
  fprintf(stderr, "%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vector_destroy(struct vector *, int /*<<< orphan*/ *);
void free_func_2dvec(void *vec) {
  struct vector *v = (struct vector *)vec;
  vector_destroy(v, NULL);
}


x86 assembly (clang, -O0):
<free_func_2dvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <vector_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_func_2dvec>:
xor    %esi,%esi
jmp    1030 <vector_destroy@plt>

LLVM IR (-O0):
%struct.vector = type { i32 }
define void @free_func_2dvec(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.vector*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.vector*
store %struct.vector* %5, %struct.vector** %3
%6 = load %struct.vector*, %struct.vector** %3
%7 = call i32 @vector_destroy(%struct.vector* %6, i32* null)
ret void
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define void @free_func_2dvec(i8* %0) {
%2 = bitcast i8* %0 to %struct.vector*
%3 = tail call i32 @vector_destroy(%struct.vector* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd1602_write_com(int);
void lcd1602_init(void) {
  lcd1602_write_com(0x38);
  lcd1602_write_com(0x0c);
  lcd1602_write_com(0x06);
  lcd1602_write_com(0x01);
}


x86 assembly (clang, -O0):
<lcd1602_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <lcd1602_write_com@plt>
mov    $0xc,%edi
call   1030 <lcd1602_write_com@plt>
mov    $0x6,%edi
call   1030 <lcd1602_write_com@plt>
mov    $0x1,%edi
call   1030 <lcd1602_write_com@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd1602_init>:
push   %rax
mov    $0x38,%edi
call   1030 <lcd1602_write_com@plt>
mov    $0xc,%edi
call   1030 <lcd1602_write_com@plt>
mov    $0x6,%edi
call   1030 <lcd1602_write_com@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <lcd1602_write_com@plt>

LLVM IR (-O0):
define void @lcd1602_init() {
%1 = call i32 @lcd1602_write_com(i32 56)
%2 = call i32 @lcd1602_write_com(i32 12)
%3 = call i32 @lcd1602_write_com(i32 6)
%4 = call i32 @lcd1602_write_com(i32 1)
ret void
}

LLVM IR (-O2):
define void @lcd1602_init() {
%1 = tail call i32 @lcd1602_write_com(i32 56)
%2 = tail call i32 @lcd1602_write_com(i32 12)
%3 = tail call i32 @lcd1602_write_com(i32 6)
%4 = tail call i32 @lcd1602_write_com(i32 1)
ret void
}
void g_arith_sqrt_f_u64(void *s, void *d, void *o) {}


x86 assembly (clang, -O0):
<g_arith_sqrt_f_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g_arith_sqrt_f_u64(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_arith_sqrt_f_u64(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int helper_function(void) {
  printf("I am a helper function\n");
  return 42;
}


x86 assembly (clang, -O0):
<helper_function>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_function>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"I am a helper function\0A\00"
define i32 @helper_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 42
}

LLVM IR (-O2):
@str = [23 x i8] c"I am a helper function\00"
define i32 @helper_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ memccpy(char *, char const *, int /*<<< orphan*/, size_t);
char *strncpy(char *dest, const char *src, size_t n) {
  memccpy(dest, src, 0, n);
  return dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <memccpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
push   %rbx
mov    %rdx,%rcx
mov    %rdi,%rbx
xor    %edx,%edx
call   1030 <memccpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memccpy(i8* %7, i8* %8, i32 0, i64 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @strncpy(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @memccpy(i8* %0, i8* %1, i32 0, i64 %2)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fs_univ_setpath(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                   int /*<<< orphan*/,
                                   int /*<<< orphan*/ const *);
int /*<<< orphan*/ strlen(char *);
uint8_t fs_mr_setpath(uint32_t inode, const uint8_t *path) {
  return fs_univ_setpath(0, 0x80, inode, strlen((char *)path), path);
}


x86 assembly (clang, -O0):
<fs_mr_setpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
mov    -0x10(%rbp),%r8
xor    %edi,%edi
mov    $0x80,%esi
call   1040 <fs_univ_setpath@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_setpath>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
mov    $0x80,%esi
mov    %ebp,%edx
mov    %eax,%ecx
mov    %rbx,%r8
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fs_univ_setpath@plt>

LLVM IR (-O0):
define i32 @fs_mr_setpath(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 = bitcast i32* %6 to i8*
%8 = call i32 @strlen(i8* %7)
%9 = load i32*, i32** %4
%10 = call i32 @fs_univ_setpath(i32 0, i32 128, i32 %5, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fs_mr_setpath(i32 %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i32 @fs_univ_setpath(i32 0, i32 128, i32 %0, i32 %4, i32* %1)
ret i32 %5
}
unsigned long ntohl(unsigned long n) {
  return ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n & 0xFF0000) >> 8) |
         ((n & 0xFF000000) >> 24);
}


x86 assembly (clang, -O0):
<ntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
movabs $0xff000000,%rcx
and    -0x8(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohl>:
mov    %rdi,%rax
bswap  %eax
ret

LLVM IR (-O0):
define i64 @ntohl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 255
%5 = shl i64 %4, 24
%6 = load i64, i64* %2
%7 = and i64 %6, 65280
%8 = shl i64 %7, 8
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = and i64 %10, 16711680
%12 = lshr i64 %11, 8
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = and i64 %14, 4278190080
%16 = lshr i64 %15, 24
%17 = or i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @ntohl(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
int ft_toupper(int c) {
  c = (c >= 'a' && c <= 'z') ? (c - 'a' + 'A') : c;
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     112c <ft_toupper+0x2c>
cmpl   $0x7a,-0x4(%rbp)
jg     112c <ft_toupper+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <ft_toupper+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 65
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
store i32 %15, i32* %2
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}