xunge/DecIR huggingface dataset:
int number_uppers(int upper_result, int current_number_uppers) {
  if (upper_result == 6) {
    current_number_uppers++;
  }
  return current_number_uppers;
}


x86 assembly (clang, -O0):
<number_uppers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x6,-0x4(%rbp)
jne    111d <number_uppers+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_uppers>:
xor    %eax,%eax
cmp    $0x6,%edi
sete   %al
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @number_uppers(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 = icmp eq i32 %5, 6
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @number_uppers(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 6
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %1
ret i32 %5
}
int test_imm_43int8_mem(signed char *val) {
  return ((*val) & (-0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffbd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_43int8_mem>:
testb  $0xbd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_43int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -67
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_43int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -67
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debugPrint(char *);
int /*<<< orphan*/ next_glEndConditionalRender();
int /*<<< orphan*/ printGLError();
void glEndConditionalRender() {
  next_glEndConditionalRender();
  printGLError();
  debugPrint("glEndConditionalRender()\n");
}


x86 assembly (clang, -O0):
<glEndConditionalRender>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <next_glEndConditionalRender@plt>
mov    $0x0,%al
call   1030 <printGLError@plt>
lea    0xeb7(%rip),%rdi
call   1050 <debugPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glEndConditionalRender>:
push   %rax
xor    %eax,%eax
call   1040 <next_glEndConditionalRender@plt>
xor    %eax,%eax
call   1030 <printGLError@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1050 <debugPrint@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"glEndConditionalRender()\0A\00"
define void @glEndConditionalRender() {
%1 = call i32 (...) @next_glEndConditionalRender()
%2 = call i32 (...) @printGLError()
%3 = call i32 @debugPrint(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"glEndConditionalRender()\0A\00"
define void @glEndConditionalRender() {
%1 = tail call i32 (...) @next_glEndConditionalRender()
%2 = tail call i32 (...) @printGLError()
%3 = tail call i32 @debugPrint(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_10int16_mem(short *val) {
  return ((*val) & (0x10 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_10int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x10,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_10int16_mem>:
testb  $0x10,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_10int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 16
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_10int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 16
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void SWAP8(uint8_t *const x, uint8_t *const y) {
  uint8_t _x = *x;
  *x = *y;
  *y = _x;
}


x86 assembly (clang, -O0):
<SWAP8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWAP8>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @SWAP8(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @SWAP8(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void irq_handler(void) { printf("Floating point exception (core dumped)\n"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Floating point exception (core dumped)\0A\00"
define void @irq_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Floating point exception (core dumped)\00"
define void @irq_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *doubleToString(int);
int parseNum(char *, int);
char *wum_mul(char *a, char *b) {
  return doubleToString((parseNum(a, 10) * parseNum(b, 10)));
}


x86 assembly (clang, -O0):
<wum_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseNum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseNum@plt>
mov    -0x14(%rbp),%edi
imul   %eax,%edi
call   1040 <doubleToString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wum_mul>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    $0xa,%esi
call   1030 <parseNum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <parseNum@plt>
imul   %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <doubleToString@plt>

LLVM IR (-O0):
define i8* @wum_mul(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 = call i32 @parseNum(i8* %5, i32 10)
%7 = load i8*, i8** %4
%8 = call i32 @parseNum(i8* %7, i32 10)
%9 = mul nsw i32 %6, %8
%10 = call i8* @doubleToString(i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @wum_mul(i8* %0, i8* %1) {
%3 = tail call i32 @parseNum(i8* %0, i32 10)
%4 = tail call i32 @parseNum(i8* %1, i32 10)
%5 = mul nsw i32 %4, %3
%6 = tail call i8* @doubleToString(i32 %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x = 100;
  int i = 0;
  while (x > 0) {
    x = x / 2;
    i = i + 1;
  }
  printf("Value %d\n", i);
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115a <main+0x4a>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x18(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"Value %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 2
store i32 %13, i32* %6
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 1
store i32 %15, i32* %7
br label %8
16: ; preds = %8
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [10 x i8] c"Value %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 7
}
__attribute__((visibility("default"))) unsigned long
trio_to_unsigned_long(const char *string, char **endp, int base) {
  assert(string);
  assert((base >= 2) && (base <= 36));
  return strtoul(string, endp, base);
}


x86 assembly (clang, -O0):
<trio_to_unsigned_long>:
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    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
cmpl   $0x2,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jl     1157 <trio_to_unsigned_long+0x37>
cmpl   $0x24,-0x14(%rbp)
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strtoul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_to_unsigned_long>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <assert@plt>
lea    -0x2(%r15),%eax
xor    %edi,%edi
cmp    $0x23,%eax
setb   %dil
xor    %eax,%eax
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strtoul@plt>

LLVM IR (-O0):
define i64 @trio_to_unsigned_long(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 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %7)
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 2
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %6
%13 = icmp sle i32 %12, 36
br label %14
14: ; preds = %11, %3
%15 = phi i1 [ false, %3 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %16)
%18 = load i8*, i8** %4
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = call i64 @strtoul(i8* %18, i8** %19, i32 %20)
ret i64 %21
}

LLVM IR (-O2):
define i64 @trio_to_unsigned_long(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %0)
%5 = add i32 %2, -2
%6 = icmp ult i32 %5, 35
%7 = zext i1 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
%9 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %9
}
int doublecmp0(double a, double b) {
  double x;
  int r = (b != b) - (a != a);
  if (r)
    return r;
  x = a - b;
  return (x > 0) - (x < 0);
}


x86 assembly (clang, -O0):
<doublecmp0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %cl
setp   %dl
or     %dl,%cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1157 <doublecmp0+0x57>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <doublecmp0+0x90>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doublecmp0>:
xor    %eax,%eax
ucomisd %xmm1,%xmm1
setp   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm0
setp   %cl
sub    %ecx,%eax
je     1117 <doublecmp0+0x17>
ret
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @doublecmp0(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %5
%9 = load double, double* %5
%10 = fcmp une double %8, %9
%11 = zext i1 %10 to i32
%12 = load double, double* %4
%13 = load double, double* %4
%14 = fcmp une double %12, %13
%15 = zext i1 %14 to i32
%16 = sub nsw i32 %11, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = load i32, i32* %7
store i32 %20, i32* %3
br label %32
21: ; preds = %2
%22 = load double, double* %4
%23 = load double, double* %5
%24 = fsub double %22, %23
store double %24, double* %6
%25 = load double, double* %6
%26 = fcmp ogt double %25, 0.000000e+00
%27 = zext i1 %26 to i32
%28 = load double, double* %6
%29 = fcmp olt double %28, 0.000000e+00
%30 = zext i1 %29 to i32
%31 = sub nsw i32 %27, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %21, %19
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @doublecmp0(double %0, double %1) {
%3 = fcmp uno double %1, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = fcmp uno double %0, 0.000000e+00
%6 = sext i1 %5 to i32
%7 = add nsw i32 %4, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = fsub double %0, %1
%11 = fcmp ogt double %10, 0.000000e+00
%12 = zext i1 %11 to i32
%13 = fcmp olt double %10, 0.000000e+00
%14 = sext i1 %13 to i32
%15 = add nsw i32 %14, %12
br label %16
16: ; preds = %2, %9
%17 = phi i32 [ %15, %9 ], [ %7, %2 ]
ret i32 %17
}
char ConverterRNA(char Nucleotide) {
  switch (Nucleotide) {
  case 'A':
    return 'U';
  case 'T':
    return 'A';
  case 'C':
    return 'G';
  case 'G':
    return 'C';
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ConverterRNA>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1158 <ConverterRNA+0x58>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x55,-0x1(%rbp)
jmp    115c <ConverterRNA+0x5c>
movb   $0x41,-0x1(%rbp)
jmp    115c <ConverterRNA+0x5c>
movb   $0x47,-0x1(%rbp)
jmp    115c <ConverterRNA+0x5c>
movb   $0x43,-0x1(%rbp)
jmp    115c <ConverterRNA+0x5c>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConverterRNA>:
add    $0xffffffbf,%edi
cmp    $0x13,%edi
ja     111d <ConverterRNA+0x1d>
mov    $0x55,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x47,%al
ret
xor    %eax,%eax
ret
mov    $0x43,%al
ret
mov    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @ConverterRNA(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 84, label %7
i32 67, label %8
i32 71, label %9
]
6: ; preds = %1
store i8 85, i8* %2
br label %11
7: ; preds = %1
store i8 65, i8* %2
br label %11
8: ; preds = %1
store i8 71, i8* %2
br label %11
9: ; preds = %1
store i8 67, i8* %2
br label %11
10: ; preds = %1
store i8 0, i8* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @ConverterRNA(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 84, label %3
i32 67, label %4
i32 71, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i8 [ 0, %6 ], [ 67, %5 ], [ 71, %4 ], [ 65, %3 ], [ 85, %1 ]
ret i8 %8
}
int foo(int x) {
  x = x + 1;
  return x;
}


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

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
unsigned int msg_bytes2U32(char *str) {
  return (unsigned int)((0xff & str[0]) | ((0xff & str[1]) << 8) |
                        ((0xff & str[2]) << 16) | ((0xff & str[3]) << 24));
}


x86 assembly (clang, -O0):
<msg_bytes2U32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @msg_bytes2U32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void free_int_matrix(int **matrix, int nRow) {
  unsigned int i;
  for (i = 0; i < nRow; ++i)
    free(matrix[i]);
  free(matrix);
}


x86 assembly (clang, -O0):
<free_int_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <free_int_matrix+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_int_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_int_matrix(i32** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %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 i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void g_arith_sqrt_u64_f(void *s, void *d, void *o) {}


x86 assembly (clang, -O0):
<g_arith_sqrt_u64_f>:
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_u64_f>:
ret

LLVM IR (-O0):
define void @g_arith_sqrt_u64_f(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_u64_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_file(char *, char *, int);
void setup() { create_file("test.txt", "abcdefg", 0666); }


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x1b6,%edx
call   1030 <create_file@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x1b6,%edx
jmp    1030 <create_file@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [8 x i8] c"abcdefg\00"
define void @setup() {
%1 = call i32 @create_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 438)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [8 x i8] c"abcdefg\00"
define void @setup() {
%1 = tail call i32 @create_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 438)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ showint(int);
void main(int argc, char *argv[]) {
  int a;
  a = atoi(argv[1]);
  showint(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <showint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <showint@plt>

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @showint(i32 %10)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @showint(i32 %5)
ret void
}
short int shortint_ignoring_signedlonglong(short int x, signed long long y) {
  return x;
}


x86 assembly (clang, -O0):
<shortint_ignoring_signedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortint_ignoring_signedlonglong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @shortint_ignoring_signedlonglong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_signedlonglong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int wInterpret(int, char **);
int main(int argc, char **argv) { return wInterpret(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <wInterpret@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @wInterpret(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
unsigned simple_hash(const void *source) {
  return ((unsigned int)((uintptr_t)(source)));
}


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

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

LLVM IR (-O0):
define i32 @simple_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @simple_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void insertResult(int res, int d) {
  if (res == 0) {
    printf("Invalid Index\n");
  } else {
    printf("Element %d is inserted\n", d);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<insertResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113b <insertResult+0x2b>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114c <insertResult+0x3c>
mov    -0x8(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertResult>:
push   %rax
test   %edi,%edi
je     1145 <insertResult+0x15>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1151 <insertResult+0x21>
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Invalid Index\0A\00"
@.str.1 = [24 x i8] c"Element %d is inserted\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @insertResult(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Element %d is inserted\0A\00"
@str = [14 x i8] c"Invalid Index\00"
define void @insertResult(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int /*<<< orphan*/);
int dup(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int xdup(int fd) {
  int ret = dup(fd);
  if (ret < 0)
    die("dup failed: %s", strerror(errno));
  return ret;
}


x86 assembly (clang, -O0):
<xdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <dup@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    116c <xdup+0x3c>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdup>:
push   %rbx
call   1030 <dup@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1158 <xdup+0x28>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <die@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"dup failed: %s\00"
@errno = global i32 0
define i32 @xdup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dup(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"dup failed: %s\00"
@errno = global i32 0
define i32 @xdup(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void putchars(char *start, int count) {
  if (count > 0) {
    char c = *start;
    putchar(c);
    putchars(start + 1, count - 1);
  }
}


x86 assembly (clang, -O0):
<putchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115e <putchars+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <putchars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchars>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <putchars+0x24>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <putchars+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @putchars(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 i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
store i8 %10, i8* %5
%11 = load i8, i8* %5
%12 = call i32 @putchar(i8 signext %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
br label %17
17: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @putchars(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i32 @putchar(i8 signext %7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add nsw i32 %5, -1
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
void gdk_window_get_pointer() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_pointer() {
ret void
}
unsigned int weather_get_int_press() { return 22; }


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

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

LLVM IR (-O0):
define i32 @weather_get_int_press() {
ret i32 22
}

LLVM IR (-O2):
define i32 @weather_get_int_press() {
ret i32 22
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_KEEPALIVE;
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int setkeepalive(int fd) {
  int keepalive = 1;
  if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(int)) != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<setkeepalive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
je     115c <setkeepalive+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <setkeepalive+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setkeepalive>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @setkeepalive(i32 %0) {
%2 = alloca i32
%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* @SOL_SOCKET
%7 = load i32, i32* @SO_KEEPALIVE
%8 = call i64 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %4, i32 4)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @setkeepalive(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_KEEPALIVE
%6 = call i64 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ init_text();
int /*<<< orphan*/ make_lookup_tables();
void init_gsub() {
  make_lookup_tables();
  init_text();
}


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

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

LLVM IR (-O0):
define void @init_gsub() {
%1 = call i32 (...) @make_lookup_tables()
%2 = call i32 (...) @init_text()
ret void
}

LLVM IR (-O2):
define void @init_gsub() {
%1 = tail call i32 (...) @make_lookup_tables()
%2 = tail call i32 (...) @init_text()
ret void
}
int g(struct B *b) {
  struct B {
    int i;
  };
  return b->i;
}


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

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

LLVM IR (-O0):
%struct.B = type { i32 }
define i32 @g(%struct.B* %0) {
%2 = alloca %struct.B*
store %struct.B* %0, %struct.B** %2
%3 = load %struct.B*, %struct.B** %2
%4 = getelementptr inbounds %struct.B, %struct.B* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.B = type { i32 }
define i32 @g(%struct.B* nocapture %0) {
%2 = getelementptr inbounds %struct.B, %struct.B* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int equal_int(void *ip, void *jp) {
  if (*(int *)ip == *(int *)jp) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <equal_int+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1131 <equal_int+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ne i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ strcmp(char *, char *);
void strcmp_less() {
  Assert_real((strcmp("equal", "notequal") < 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/string/strcmp.c",
              17, ("Should be < 0"));
}


x86 assembly (clang, -O0):
<strcmp_less>:
push   %rbp
mov    %rsp,%rbp
lea    0xed8(%rip),%rdi
lea    0xece(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x11,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_less>:
push   %rax
lea    0xedb(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcmp@plt>
shr    $0x3f,%rax
lea    0xeca(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    %eax,%edi
mov    $0x11,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"notequal\00"
@.str.2 = [163 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/string/strcmp.c\00"
@.str.3 = [14 x i8] c"Should be < 0\00"
define void @strcmp_less() {
%1 = call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"notequal\00"
@.str.2 = [163 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/string/strcmp.c\00"
@.str.3 = [14 x i8] c"Should be < 0\00"
define void @strcmp_less() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int node_counter(int pulse100ms, int counter_at_last, int *output) {
  int _tmp000;
  if (pulse100ms == 1) {
    _tmp000 = (counter_at_last + 1);
  } else if (pulse100ms == 0) {
    _tmp000 = counter_at_last;
  }
  *output = (_tmp000 % 10);
  return 1;
}


x86 assembly (clang, -O0):
<node_counter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1126 <node_counter+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <node_counter+0x3b>
cmpl   $0x0,-0x4(%rbp)
jne    1136 <node_counter+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    113b <node_counter+0x3b>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_counter>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
add    %esi,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @node_counter(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 1
%5 = zext i1 %4 to i32
%6 = add nsw i32 %5, %1
%7 = srem i32 %6, 10
store i32 %7, i32* %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
int yrc_uiRestore(void) {
  clrtoeol();
  refresh();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<yrc_uiRestore>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clrtoeol@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yrc_uiRestore>:
push   %rax
xor    %eax,%eax
call   1050 <clrtoeol@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yrc_uiRestore() {
%1 = call i32 (...) @clrtoeol()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @yrc_uiRestore() {
%1 = tail call i32 (...) @clrtoeol()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int da(int, int);
int dp(int, int);
int place_robot(int x, int y, int th, int tu) {
  if (dp(x, y) != 1 || da(th, tu) != 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<place_robot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <dp@plt>
cmp    $0x1,%eax
jne    115c <place_robot+0x3c>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <da@plt>
cmp    $0x1,%eax
je     1168 <place_robot+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <place_robot+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<place_robot>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1040 <dp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1148 <place_robot+0x28>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <da@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @place_robot(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @dp(i32 %0, i32 %1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @da(i32 %2, i32 %3)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ PlayTone(int, int);
void Growl() { PlayTone(500, 100); }


x86 assembly (clang, -O0):
<Growl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f4,%edi
mov    $0x64,%esi
call   1030 <PlayTone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Growl>:
mov    $0x1f4,%edi
mov    $0x64,%esi
jmp    1030 <PlayTone@plt>

LLVM IR (-O0):
define void @Growl() {
%1 = call i32 @PlayTone(i32 500, i32 100)
ret void
}

LLVM IR (-O2):
define void @Growl() {
%1 = tail call i32 @PlayTone(i32 500, i32 100)
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
int wcwidth(wchar_t wc) { return (wc > 0); }


x86 assembly (clang, -O0):
<wcwidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcwidth>:
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i32 @wcwidth(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @wcwidth(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}