xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ func_14(int, char *, unsigned long);
void func_13(int a, char *b, unsigned long c) { func_14(a, b, c); }


x86 assembly (clang, -O0):
<func_13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <func_14@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_13>:
jmp    1030 <func_14@plt>

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

LLVM IR (-O2):
define void @func_13(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_14(i32 %0, i8* %1, i64 %2)
ret void
}
int fun158() { return 158; }


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

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

LLVM IR (-O0):
define i32 @fun158() {
ret i32 158
}

LLVM IR (-O2):
define i32 @fun158() {
ret i32 158
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int Section1(int seconds) {
  printf("\n1.- %d hours, %d minutes and %d seconds", seconds / 3600,
         seconds % 3600 / 60, seconds % 60);
  return 0;
}


x86 assembly (clang, -O0):
<Section1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x8(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section1>:
push   %rax
movslq %edi,%rcx
imul   $0xffffffff91a2b3c5,%rcx,%rsi
shr    $0x20,%rsi
add    %ecx,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0xb,%esi
add    %eax,%esi
imul   $0xe10,%esi,%eax
mov    %ecx,%edx
sub    %eax,%edx
movswl %dx,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %edx,%eax
movzwl %ax,%eax
movswl %ax,%edx
shr    $0xf,%eax
sar    $0x5,%edx
add    %eax,%edx
movswl %dx,%edx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edi
shr    $0x1f,%edi
sar    $0x5,%eax
add    %edi,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%ecx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0A1.- %d hours, %d minutes and %d seconds\00"
define i32 @Section1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 3600
%5 = load i32, i32* %2
%6 = srem i32 %5, 3600
%7 = sdiv i32 %6, 60
%8 = load i32, i32* %2
%9 = srem i32 %8, 60
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"\0A1.- %d hours, %d minutes and %d seconds\00"
define i32 @Section1(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = srem i32 %0, 3600
%4 = trunc i32 %3 to i16
%5 = sdiv i16 %4, 60
%6 = sext i16 %5 to i32
%7 = srem i32 %0, 60
%8 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void out_of_mem(char *f) {
  fprintf(stderr, "Out of memory in function %s!\n", f);
  exit(1);
}


x86 assembly (clang, -O0):
<out_of_mem>:
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):
<out_of_mem>:
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 = [31 x i8] c"Out of memory in function %s!\0A\00"
define void @out_of_mem(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 ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Out of memory in function %s!\0A\00"
define void @out_of_mem(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int isdigit(char symb) { return (symb >= '0' && symb <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int chardinalite(char **s) {
  int i = 0;
  if (s != NULL) {
    for (i = 0; s[i] != NULL; i++)
      ;
  }
  return i;
}


x86 assembly (clang, -O0):
<chardinalite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <chardinalite+0x4c>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1147 <chardinalite+0x47>
jmp    1139 <chardinalite+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <chardinalite+0x21>
jmp    114c <chardinalite+0x4c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chardinalite>:
test   %rdi,%rdi
je     111e <chardinalite+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <chardinalite+0x10>
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define i32 @getWaitExitCode(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void rx(char *msg) {
  printf("Error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<rx>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @rx(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int Y = 100;
  int X = 1;
  int D = 10;
  int d = ((Y - X) / D) == 0 ? ((Y - X) / D) + 1 : ((Y - X) / D) + 1;
  printf("%d", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%eax
jne    115c <main+0x4c>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116c <main+0x5c>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ resources_set_int(char *, int);
int /*<<< orphan*/ ui_update_menus();
void set_warp_mode(int on) {
  resources_set_int("WarpMode", on);
  ui_update_menus();
}


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

x86 assembly (clang, -O2):
<set_warp_mode>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <resources_set_int@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ui_update_menus@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"WarpMode\00"
define void @set_warp_mode(i32 %0) {
%2 = tail call i32 @resources_set_int(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @ui_update_menus()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Lerp_init(void) {
  _hmt_register_covercase("HMM_Lerp", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Lerp_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HMM_Lerp\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Lerp_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_Lerp\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Lerp_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int from_byte_array_to_number(unsigned char *byte_array) {
  unsigned int number = 0;
  unsigned char *pointer = (unsigned char *)&number;
  pointer += sizeof(number) - 4;
  int i;
  for (i = 0; i < 4; i++)
    pointer[i] = byte_array[3 - i];
  return number;
}


x86 assembly (clang, -O0):
<from_byte_array_to_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    115b <from_byte_array_to_number+0x5b>
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1126 <from_byte_array_to_number+0x26>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @from_byte_array_to_number(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = load i8, i8* %0
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %7 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %10, %12
%14 = zext i8 %5 to i32
%15 = shl nuw nsw i32 %14, 8
%16 = or i32 %13, %15
%17 = zext i8 %3 to i32
%18 = or i32 %16, %17
ret i32 %18
}
/* Variables and functions */
void *realloc(void *, unsigned int);
void *javacall_realloc(void *ptr, unsigned int size) {
  return realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<javacall_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define i8* @javacall_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct dbuf_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dbuf_destroy(struct dbuf_s *);
int /*<<< orphan*/ free(struct dbuf_s *);
void dbuf_delete(struct dbuf_s *dbuf) {
  dbuf_destroy(dbuf);
  free(dbuf);
}


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

x86 assembly (clang, -O2):
<dbuf_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dbuf_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.dbuf_s = type { i32 }
define void @dbuf_delete(%struct.dbuf_s* %0) {
%2 = alloca %struct.dbuf_s*
store %struct.dbuf_s* %0, %struct.dbuf_s** %2
%3 = load %struct.dbuf_s*, %struct.dbuf_s** %2
%4 = call i32 @dbuf_destroy(%struct.dbuf_s* %3)
%5 = load %struct.dbuf_s*, %struct.dbuf_s** %2
%6 = call i32 @free(%struct.dbuf_s* %5)
ret void
}

LLVM IR (-O2):
%struct.dbuf_s = type { i32 }
define void @dbuf_delete(%struct.dbuf_s* %0) {
%2 = tail call i32 @dbuf_destroy(%struct.dbuf_s* %0)
%3 = tail call i32 @free(%struct.dbuf_s* %0)
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ reset_key();
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ set_key();
int main(int argc, char *argv[]) {
  scanf("%s", NULL);
  char a;
  set_key();
  while (1) {
    a = getchar();
    printf("%d", a);
  }
  reset_key();
  return 0;
}


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)
lea    0xea3(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <set_key@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x11(%rbp)
lea    0xe85(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
jmp    116d <main+0x2d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
xor    %esi,%esi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1040 <set_key@plt>
lea    0xea6(%rip),%rbx
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null)
%8 = call i32 (...) @set_key()
br label %9
9: ; preds = %2, %9
%10 = call signext i8 (...) @getchar()
store i8 %10, i8* %6
%11 = load i8, i8* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %11)
br label %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null)
%4 = tail call i32 (...) @set_key()
br label %5
5: ; preds = %5, %2
%6 = tail call signext i8 (...) @getchar()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %6)
br label %5
}
void gdk_x11_colormap_get_xdisplay() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_colormap_get_xdisplay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x80() {
  Assert_real((isalpha(128) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              645, ("isalpha should be 0 for 0x80"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x80>:
push   %rax
mov    $0x80,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x285,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x80\00"
define void @t_isalpha_0x80() {
%1 = call i64 @isalpha(i32 128)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 645, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x80\00"
define void @t_isalpha_0x80() {
%1 = tail call i64 @isalpha(i32 128)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 645, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void testfunc_00(const short *ap, short *bp) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[25];
  bp[1] = ap[26];
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xa(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xe(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x12(%rax)
mov    -0x8(%rbp),%rax
mov    0x32(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
movzwl 0x1e(%rdi),%eax
mov    %ax,(%rsi)
movzwl 0xa(%rdi),%eax
mov    %ax,0x4(%rsi)
movzwl 0xe(%rdi),%eax
mov    %ax,0x12(%rsi)
movzwl 0x32(%rdi),%eax
mov    %ax,(%rsi)
movzwl 0x34(%rdi),%eax
mov    %ax,0x2(%rsi)
ret

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

LLVM IR (-O2):
define void @testfunc_00(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 15
%4 = load i16, i16* %3
store i16 %4, i16* %1
%5 = getelementptr inbounds i16, i16* %0, i64 5
%6 = load i16, i16* %5
%7 = getelementptr inbounds i16, i16* %1, i64 2
store i16 %6, i16* %7
%8 = getelementptr inbounds i16, i16* %0, i64 7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %1, i64 9
store i16 %9, i16* %10
%11 = getelementptr inbounds i16, i16* %0, i64 25
%12 = load i16, i16* %11
store i16 %12, i16* %1
%13 = getelementptr inbounds i16, i16* %0, i64 26
%14 = load i16, i16* %13
%15 = getelementptr inbounds i16, i16* %1, i64 1
store i16 %14, i16* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main();
void _start(void) { main(); }


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

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

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

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @main()
ret void
}
void kvm_pmu_reset(struct kvm_vcpu *vcpu) {}


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

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

LLVM IR (-O0):
%struct.kvm_vcpu = type opaque
define void @kvm_pmu_reset(%struct.kvm_vcpu* %0) {
%2 = alloca %struct.kvm_vcpu*
store %struct.kvm_vcpu* %0, %struct.kvm_vcpu** %2
ret void
}

LLVM IR (-O2):
%struct.kvm_vcpu = type opaque
define void @kvm_pmu_reset(%struct.kvm_vcpu* nocapture %0) {
ret void
}
void led(const char nibble) {}


x86 assembly (clang, -O0):
<led>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @led(i8 signext %0) {
ret void
}
/* Type definitions */
struct midi_buffer {
  int dummy;
};

/* Variables and functions */
int midi_parse(struct midi_buffer *, unsigned char *, int);
int read(int, unsigned char *, int);
int midi_read(struct midi_buffer *buf, int fd) {
  unsigned char bytes[1024];
  int size;
  size = read(fd, bytes, 1024);
  if (size > 0) {
    return midi_parse(buf, bytes, size);
  } else {
    return size;
  }
}


x86 assembly (clang, -O0):
<midi_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
jle    1177 <midi_read+0x57>
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    -0x424(%rbp),%edx
call   1030 <midi_parse@plt>
mov    %eax,-0x4(%rbp)
jmp    1180 <midi_read+0x60>
mov    -0x424(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_read>:
push   %rbx
sub    $0x400,%rsp
mov    %esi,%eax
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    114d <midi_read+0x2d>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <midi_parse@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.midi_buffer = type { i32 }
define i32 @midi_read(%struct.midi_buffer* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.midi_buffer*
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = alloca i32
store %struct.midi_buffer* %0, %struct.midi_buffer** %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 1024)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load %struct.midi_buffer*, %struct.midi_buffer** %4
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%16 = load i32, i32* %7
%17 = call i32 @midi_parse(%struct.midi_buffer* %14, i8* %15, i32 %16)
store i32 %17, i32* %3
br label %20
18: ; preds = %2
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %20
20: ; preds = %18, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.midi_buffer = type { i32 }
define i32 @midi_read(%struct.midi_buffer* %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %1, i8* %4, i32 1024)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @midi_parse(%struct.midi_buffer* %0, i8* %4, i32 %5)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Type definitions */
typedef size_t uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
void zero_array_from(int64_t *arr, uint64_t len, uint64_t off) {
  for (; off < len; ++off) {
    arr[off] = 0;
  }
}


x86 assembly (clang, -O0):
<zero_array_from>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    113f <zero_array_from+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <zero_array_from+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_array_from>:
mov    %rsi,%rax
sub    %rdx,%rax
jbe    112f <zero_array_from+0x1f>
push   %rax
lea    (%rdi,%rdx,8),%rdi
shl    $0x3,%rax
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero_array_from(i64* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = getelementptr i64, i64* %0, i64 %2
%7 = bitcast i64* %6 to i8*
%8 = sub i64 %1, %2
%9 = shl i64 %8, 3
br label %10
10: ; preds = %5, %3
ret void
}
int compare_data_int(void *num1, void *num2) {
  int key1, key2;
  key1 = *(int *)num1;
  key2 = *(int *)num2;
  if (key1 < key2)
    return -1;
  if (key1 == key2)
    return 0;
  return +1;
}


x86 assembly (clang, -O0):
<compare_data_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <compare_data_int+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compare_data_int+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <compare_data_int+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compare_data_int+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_data_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_data_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 slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int syscall1(int);
int get_free_frames() { return syscall1(509); }


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

x86 assembly (clang, -O2):
<get_free_frames>:
mov    $0x1fd,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define i32 @get_free_frames() {
%1 = call i32 @syscall1(i32 509)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_free_frames() {
%1 = tail call i32 @syscall1(i32 509)
ret i32 %1
}
long CDRshutdown(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @CDRshutdown() {
ret i64 0
}

LLVM IR (-O2):
define i64 @CDRshutdown() {
ret i64 0
}
int len(char *a) {
  int i;
  for (i = 0; a[i] != 10; i++)
    ;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @len(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, 10
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 @len(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, 10
%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
}
unsigned test9(unsigned x) {
  return ((x >> 24) & 0x000000FF) | ((x << 8) & 0x00FF0000);
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
mov    %edi,%eax
rol    $0x8,%eax
and    $0xff00ff,%eax
ret

LLVM IR (-O0):
define i32 @test9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 16711680
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test9(i32 %0) {
%2 = lshr i32 %0, 24
%3 = shl i32 %0, 8
%4 = and i32 %3, 16711680
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
void *calloc(unsigned long, int);
void *Xcalloc(unsigned long n) { return calloc(n, 1); }


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

x86 assembly (clang, -O2):
<Xcalloc>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @Xcalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @calloc(i64 %3, i32 1)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Xcalloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
ret i8* %2
}
int putbyte(char **dst, unsigned char value) {
  **dst = value;
  (*dst)++;
  return sizeof(char);
}


x86 assembly (clang, -O0):
<putbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbyte>:
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @putbyte(i8** %0, i8 zeroext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8 %5, i8* %7
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %8
ret i32 1
}

LLVM IR (-O2):
define i32 @putbyte(i8** nocapture %0, i8 zeroext %1) {
%3 = load i8*, i8** %0
store i8 %1, i8* %3
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
ret i32 1
}
int fun1220() { return 1220; }


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

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

LLVM IR (-O0):
define i32 @fun1220() {
ret i32 1220
}

LLVM IR (-O2):
define i32 @fun1220() {
ret i32 1220
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
extern void psb_intel_opregion_fini(struct drm_device *dev) {}


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

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define void @psb_intel_opregion_fini(%struct.drm_device* %0) {
%2 = alloca %struct.drm_device*
store %struct.drm_device* %0, %struct.drm_device** %2
ret void
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define void @psb_intel_opregion_fini(%struct.drm_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cginc1iw(void) { ngen("%s\t(%%rax)", "incq", 0); }


x86 assembly (clang, -O0):
<cginc1iw>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc1iw>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%rax)\00"
@.str.1 = [5 x i8] c"incq\00"
define void @cginc1iw() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%rax)\00"
@.str.1 = [5 x i8] c"incq\00"
define void @cginc1iw() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
int seqlen(char *seq) {
  int len;
  len = 0;
  while (seq[len] != 4)
    len += 1;
  return (len);
}


x86 assembly (clang, -O0):
<seqlen>:
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    $0x4,%eax
je     1132 <seqlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <seqlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @seqlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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, 4
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @seqlen(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, 4
%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
}
unsigned long guessReasonableMaxmemory(void) {
  unsigned long const one_giga = 1024 * 1024;
  return one_giga;
}


x86 assembly (clang, -O0):
<guessReasonableMaxmemory>:
push   %rbp
mov    %rsp,%rbp
movq   $0x100000,-0x8(%rbp)
mov    $0x100000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @guessReasonableMaxmemory() {
%1 = alloca i64
store i64 1048576, i64* %1
ret i64 1048576
}

LLVM IR (-O2):
define i64 @guessReasonableMaxmemory() {
ret i64 1048576
}
/* Variables and functions */
int gca_cmp2_size(const void *aa, const void *bb, void *p) {
  (void)p;
  const size_t a = *(const size_t *)aa;
  const size_t b = *(const size_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp2_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x28(%rbp),%rcx
cmp    -0x20(%rbp),%rcx
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp2_size>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp2_size(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
store i64 %15, i64* %8
%16 = load i64, i64* %7
%17 = load i64, i64* %8
%18 = icmp ugt i64 %16, %17
%19 = zext i1 %18 to i32
%20 = load i64, i64* %8
%21 = load i64, i64* %7
%22 = icmp ugt i64 %20, %21
%23 = zext i1 %22 to i32
%24 = sub nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @gca_cmp2_size(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %4
%6 = bitcast i8* %1 to i64*
%7 = load i64, i64* %6
%8 = icmp ugt i64 %5, %7
%9 = zext i1 %8 to i32
%10 = icmp ugt i64 %7, %5
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}
int test_imm_BDint16_mem(short *val) {
  return ((*val) & (0xBD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BDint16_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, 189
%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_BDint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 189
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int IsPalindrome(int num) {
  int n = num, rev = 0;
  while (num) {
    rev *= 10;
    rev += num % 10;
    num /= 10;
  }
  return n == rev;
}


x86 assembly (clang, -O0):
<IsPalindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <IsPalindrome+0x49>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1114 <IsPalindrome+0x14>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsPalindrome>:
xor    %edx,%edx
test   %edi,%edi
je     1141 <IsPalindrome+0x41>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
lea    (%rdx,%rdx,4),%r8d
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
lea    (%rdx,%r8,2),%edx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <IsPalindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @IsPalindrome(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}