xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This is a web servser on embedded system.\r\n");
  printf("Git test.\r\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"This is a web servser on embedded system.\0D\0A\00"
@.str.1 = [12 x i8] c"Git test.\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [43 x i8] c"This is a web servser on embedded system.\0D\00"
@str.2 = [11 x i8] c"Git test.\0D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CLR(int);
void clr_f0(void) { CLR(0x20); }


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

x86 assembly (clang, -O2):
<clr_f0>:
mov    $0x20,%edi
jmp    1030 <CLR@plt>

LLVM IR (-O0):
define void @clr_f0() {
%1 = call i32 @CLR(i32 32)
ret void
}

LLVM IR (-O2):
define void @clr_f0() {
%1 = tail call i32 @CLR(i32 32)
ret void
}
/* Variables and functions */
short **free_arrayN(void *, int);
short **free_short(short **array, int first) {
  return free_arrayN((void *)array, 2);
}


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

x86 assembly (clang, -O2):
<free_short>:
mov    $0x2,%esi
jmp    1030 <free_arrayN@plt>

LLVM IR (-O0):
define i16** @free_short(i16** %0, i32 %1) {
%3 = alloca i16**
%4 = alloca i32
store i16** %0, i16*** %3
store i32 %1, i32* %4
%5 = load i16**, i16*** %3
%6 = bitcast i16** %5 to i8*
%7 = call i16** @free_arrayN(i8* %6, i32 2)
ret i16** %7
}

LLVM IR (-O2):
define i16** @free_short(i16** %0, i32 %1) {
%3 = bitcast i16** %0 to i8*
%4 = tail call i16** @free_arrayN(i8* %3, i32 2)
ret i16** %4
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int);
int maplow(int i) {
  if (isupper(i))
    i = tolower(i);
  return (i);
}


x86 assembly (clang, -O0):
<maplow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1148 <maplow+0x28>
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maplow>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %rax,%rax
je     1135 <maplow+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tolower@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @maplow(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @tolower(i32 %7)
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @maplow(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tolower(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ enter_program_mode();
int /*<<< orphan*/ exit_program_mode();
int /*<<< orphan*/ pic_goto_mem_location(int);
int pic_read_data();
int /*<<< orphan*/ pic_send_cmd(int);
uint16_t pic_read_device_id(void) {
  uint16_t id;
  enter_program_mode();
  pic_goto_mem_location(0x3FFFFE);
  pic_send_cmd(0x09);
  id = pic_read_data();
  pic_send_cmd(0x09);
  id = (pic_read_data() << 8) | (id & 0xFF);
  exit_program_mode();
  return id;
}


x86 assembly (clang, -O0):
<pic_read_device_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <enter_program_mode@plt>
mov    $0x3ffffe,%edi
call   1030 <pic_goto_mem_location@plt>
mov    $0x9,%edi
call   1060 <pic_send_cmd@plt>
mov    $0x0,%al
call   1040 <pic_read_data@plt>
mov    %eax,-0x4(%rbp)
mov    $0x9,%edi
call   1060 <pic_send_cmd@plt>
mov    $0x0,%al
call   1040 <pic_read_data@plt>
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <exit_program_mode@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_read_device_id>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <enter_program_mode@plt>
mov    $0x3ffffe,%edi
call   1030 <pic_goto_mem_location@plt>
mov    $0x9,%edi
call   1060 <pic_send_cmd@plt>
xor    %eax,%eax
call   1040 <pic_read_data@plt>
mov    %eax,%ebx
mov    $0x9,%edi
call   1060 <pic_send_cmd@plt>
xor    %eax,%eax
call   1040 <pic_read_data@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
movzbl %bl,%eax
or     %eax,%ebp
xor    %eax,%eax
call   1070 <exit_program_mode@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pic_read_device_id() {
%1 = alloca i32
%2 = call i32 (...) @enter_program_mode()
%3 = call i32 @pic_goto_mem_location(i32 4194302)
%4 = call i32 @pic_send_cmd(i32 9)
%5 = call i32 (...) @pic_read_data()
store i32 %5, i32* %1
%6 = call i32 @pic_send_cmd(i32 9)
%7 = call i32 (...) @pic_read_data()
%8 = shl i32 %7, 8
%9 = load i32, i32* %1
%10 = and i32 %9, 255
%11 = or i32 %8, %10
store i32 %11, i32* %1
%12 = call i32 (...) @exit_program_mode()
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @pic_read_device_id() {
%1 = tail call i32 (...) @enter_program_mode()
%2 = tail call i32 @pic_goto_mem_location(i32 4194302)
%3 = tail call i32 @pic_send_cmd(i32 9)
%4 = tail call i32 (...) @pic_read_data()
%5 = tail call i32 @pic_send_cmd(i32 9)
%6 = tail call i32 (...) @pic_read_data()
%7 = shl i32 %6, 8
%8 = and i32 %4, 255
%9 = or i32 %7, %8
%10 = tail call i32 (...) @exit_program_mode()
ret i32 %9
}
/* Variables and functions */
int func(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  printf("Un numero");
  scanf("%d", &n);
  n = func(n);
  printf("%d son los numeros poitivos\n", n);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <func@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <func@plt>
mov    %eax,0x4(%rsp)
lea    0xea9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Un numero\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"%d son los numeros poitivos\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @func(i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Un numero\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"%d son los numeros poitivos\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @func(i32 %5)
store i32 %6, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ ft_islower(int);
int ft_toupper(int c) {
  if (ft_islower(c))
    return (c - 'a' + 'A');
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_islower@plt>
cmp    $0x0,%rax
je     113e <ft_toupper+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <ft_toupper+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = tail call i64 @ft_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ iscntrl(int);
int utliscntrl(int ch) { return (ch <= 0xFF) && iscntrl(ch); }


x86 assembly (clang, -O0):
<utliscntrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xff,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     113f <utliscntrl+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utliscntrl>:
xor    %eax,%eax
cmp    $0xff,%edi
jg     112f <utliscntrl+0x1f>
push   %rax
call   1030 <iscntrl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @utliscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 255
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i64 @iscntrl(i32 %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @utliscntrl(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i64 @iscntrl(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double randd() { return ((double)(rand())) / RAND_MAX; }


x86 assembly (clang, -O0):
<randd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randd() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randd() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ sra_hl();
void opcb_2e() { sra_hl(); }


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

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

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

LLVM IR (-O2):
define void @opcb_2e() {
%1 = tail call i32 (...) @sra_hl()
ret void
}
char *convertTOchar(int val) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @convertTOchar(i32 %0) {
ret i8* undef
}
/* Variables and functions */
int foo(int, int, double, float);
int main(void) {
  int i = -3;
  float f = 3.14f;
  double d = 2.71;
  return foo(i, i, d, f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffd,-0x8(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movsd  0xee8(%rip),%xmm0
movss  0xee8(%rip),%xmm1
mov    $0xfffffffd,%edi
mov    $0xfffffffd,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
store i32 0, i32* %1
store i32 -3, i32* %2
store float 0x40091EB860000000, float* %3
store double 2.710000e+00, double* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = load double, double* %4
%8 = load float, float* %3
%9 = call i32 @foo(i32 %5, i32 %6, double %7, float %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -3, i32 -3, double 2.710000e+00, float 0x40091EB860000000)
ret i32 %1
}
void cleanFilename(char *filename) {
  unsigned int i;
  for (i = 0;; i++) {
    if (filename[i] == '\r') {
      filename[i] = '\0';
      return;
    } else if (filename[i] == '\0') {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<cleanFilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
jne    1133 <cleanFilename+0x33>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
jmp    1164 <cleanFilename+0x64>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    114c <cleanFilename+0x4c>
jmp    1164 <cleanFilename+0x64>
jmp    1151 <cleanFilename+0x51>
jmp    1156 <cleanFilename+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cleanFilename+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanFilename>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
movzbl (%rdi,%rcx,1),%edx
test   %dl,%dl
je     1128 <cleanFilename+0x28>
cmp    $0xd,%dl
je     1124 <cleanFilename+0x24>
add    $0x1,%eax
jmp    1110 <cleanFilename+0x10>
movb   $0x0,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @cleanFilename(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %28, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = zext 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 eq i32 %10, 13
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
br label %31
17: ; preds = %4
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %17
br label %31
26: ; preds = %17
br label %27
27: ; preds = %26
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add i32 %29, 1
store i32 %30, i32* %3
br label %4
31: ; preds = %25, %12
ret void
}

LLVM IR (-O2):
define void @cleanFilename(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i32 [ 0, %1 ], [ %11, %10 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %10 [
i8 13, label %7
i8 0, label %12
]
7: ; preds = %2
%8 = zext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
br label %12
10: ; preds = %2
%11 = add i32 %3, 1
br label %2
12: ; preds = %2, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR6D_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMR6D_swap>:
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 <U_WMRNOTIMPLEMENTED_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMR6D_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR6D_swap(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 i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR6D_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int FE_ALL_EXCEPT;
int get_fpc();
int fetestexcept(int mask) { return get_fpc() & mask & FE_ALL_EXCEPT; }


x86 assembly (clang, -O0):
<fetestexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_fpc@plt>
and    -0x4(%rbp),%eax
mov    0x2eb4(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetestexcept>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_fpc@plt>
and    %ebx,%eax
mov    0x2ebd(%rip),%rcx
and    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_fpc()
%4 = load i32, i32* %2
%5 = and i32 %3, %4
%6 = load i32, i32* @FE_ALL_EXCEPT
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = tail call i32 (...) @get_fpc()
%3 = and i32 %2, %0
%4 = load i32, i32* @FE_ALL_EXCEPT
%5 = and i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void C_Utils_free_byte_ptr(unsigned char *item) { free(item); }


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

x86 assembly (clang, -O2):
<C_Utils_free_byte_ptr>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @C_Utils_free_byte_ptr(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double sqrt(double);
float sqrtf(float);
long double sqrtl(long double);
void test_sqrt(float a0, double a1, long double a2) {
  float l0 = sqrtf(a0);
  double l1 = sqrt(a1);
  long double l2 = sqrtl(a2);
}


x86 assembly (clang, -O0):
<test_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <sqrtf@plt>
movss  %xmm0,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sqrtl@plt>
fstpt  -0x40(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sqrt>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
ja     1156 <test_sqrt+0x26>
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1176 <test_sqrt+0x46>
fldz
fucomip %st(1),%st
ja     118f <test_sqrt+0x5f>
fstp   %st(0)
add    $0x28,%rsp
ret
ucomiss %xmm2,%xmm0
jae    1140 <test_sqrt+0x10>
fstpt  0x14(%rsp)
movsd  %xmm1,0x20(%rsp)
call   1040 <sqrtf@plt>
movsd  0x20(%rsp),%xmm1
fldt   0x14(%rsp)
jmp    1140 <test_sqrt+0x10>
ucomisd %xmm0,%xmm1
jae    1149 <test_sqrt+0x19>
movapd %xmm1,%xmm0
fstpt  0x14(%rsp)
call   1050 <sqrt@plt>
fldt   0x14(%rsp)
jmp    1149 <test_sqrt+0x19>
fstpt  (%rsp)
call   1030 <sqrtl@plt>
jmp    114f <test_sqrt+0x1f>

LLVM IR (-O0):
define void @test_sqrt(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
%7 = alloca float
%8 = alloca double
%9 = alloca x86_fp80
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
%10 = load float, float* %4
%11 = call float @sqrtf(float %10)
store float %11, float* %7
%12 = load double, double* %5
%13 = call double @sqrt(double %12)
store double %13, double* %8
%14 = load x86_fp80, x86_fp80* %6
%15 = call x86_fp80 @sqrtl(x86_fp80 %14)
store x86_fp80 %15, x86_fp80* %9
ret void
}

LLVM IR (-O2):
define void @test_sqrt(float %0, double %1, x86_fp80 %2) {
%4 = fcmp olt float %0, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call float @sqrtf(float %0)
br label %7
7: ; preds = %3, %5
%8 = fcmp olt double %1, 0.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call double @sqrt(double %1)
br label %11
11: ; preds = %7, %9
%12 = fcmp olt x86_fp80 %2, 0xK00000000000000000000
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call x86_fp80 @sqrtl(x86_fp80 %2)
br label %15
15: ; preds = %11, %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void print_file_cb(const char *path, const char *basename, int level,
                   void *user_data_) {
  (void)user_data_;
  (void)level;
  printf("%s/%s\n", path, basename);
}


x86 assembly (clang, -O0):
<print_file_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_file_cb>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s/%s\0A\00"
define void @print_file_cb(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i32, i32* %7
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s/%s\0A\00"
define void @print_file_cb(i8* %0, i8* %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_drawstring(int, int, int, char *);
void j_drawstring(int arg0, int arg1, int arg2, char *arg3) {
  japi_drawstring(arg0, arg1, arg2, arg3);
}


x86 assembly (clang, -O0):
<j_drawstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <japi_drawstring@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_drawstring>:
jmp    1030 <japi_drawstring@plt>

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

LLVM IR (-O2):
define void @j_drawstring(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @japi_drawstring(i32 %0, i32 %1, i32 %2, i8* %3)
ret void
}
void record_backtrace() {}


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

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

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

LLVM IR (-O2):
define void @record_backtrace() {
ret void
}
void gtk_text_buffer_insert_with_tags_by_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_insert_with_tags_by_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ACMP4_DriverIRQHandler();
__attribute__((weak)) void ACMP4_IRQHandler(void) { ACMP4_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @ACMP4_IRQHandler() {
%1 = call i32 (...) @ACMP4_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ACMP4_IRQHandler() {
%1 = tail call i32 (...) @ACMP4_DriverIRQHandler()
ret void
}
void freeStringArray(char **array, int count) {
  for (int i = 0; i < count; i++) {
    free(array[i]);
  }
  free(array);
}


x86 assembly (clang, -O0):
<freeStringArray>:
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
jge    1151 <freeStringArray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeStringArray+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeStringArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeStringArray+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 <freeStringArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeStringArray(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ put_word(int, int);
__attribute__((always_)) void patch_NCAS_3_1_0_392_extra(void) {
  put_word(0x100B172C, 0xEAFFFFFE);
}


x86 assembly (clang, -O0):
<patch_NCAS_3_1_0_392_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100b172c,%edi
mov    $0xeafffffe,%esi
call   1030 <put_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_NCAS_3_1_0_392_extra>:
mov    $0x100b172c,%edi
mov    $0xeafffffe,%esi
jmp    1030 <put_word@plt>

LLVM IR (-O0):
define void @patch_NCAS_3_1_0_392_extra() {
%1 = call i32 @put_word(i32 269162284, i32 -352321538)
ret void
}

LLVM IR (-O2):
define void @patch_NCAS_3_1_0_392_extra() {
%1 = tail call i32 @put_word(i32 269162284, i32 -352321538)
ret void
}
void mus_set_little_endian_double(unsigned char *j, double x) {
  int i;
  unsigned char *ox;
  ox = (unsigned char *)&x;
  for (i = 0; i < 8; i++)
    j[i] = ox[i];
}


x86 assembly (clang, -O0):
<mus_set_little_endian_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    114a <mus_set_little_endian_double+0x4a>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <mus_set_little_endian_double+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_set_little_endian_double>:
movsd  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mus_set_little_endian_double(i8* nocapture writeonly %0, double %1) {
%3 = bitcast i8* %0 to double*
store double %1, double* %3
ret void
}
int sum_array(int my_array[], int *average) {
  int j;
  int total = 0;
  for (j = 0; j < 5; j++) {
    total = total + my_array[j];
  }
  *average = (total / 5);
  return (*average);
}


x86 assembly (clang, -O0):
<sum_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1143 <sum_array+0x43>
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <sum_array+0x1a>
mov    -0x18(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_array>:
movdqu 0x4(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    (%rdi),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @sum_array(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = bitcast i32* %4 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %6)
%8 = add nsw i32 %7, %3
%9 = sdiv i32 %8, 5
store i32 %9, i32* %1
ret i32 %9
}
int main(void) {
  int y = 5;
  printf("The square of "
         "y"
         " is %d.\n",
         ((y) * (y)));
  printf("The square of "
         "2 + 4"
         " is %d.\n",
         ((2 + 4) * (2 + 4)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x24,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"The square of y is %d.\0A\00"
@.str.1 = [28 x i8] c"The square of 2 + 4 is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 36)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The square of y is %d.\0A\00"
@.str.1 = [28 x i8] c"The square of 2 + 4 is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 36)
ret i32 0
}
/* Variables and functions */
int pipe1(char *, int /*<<< orphan*/);
int Pipecmd(void *v) {
  char *str = v;
  return (pipe1(str, 0));
}


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

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

LLVM IR (-O0):
define i32 @Pipecmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @pipe1(i8* %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @Pipecmd(i8* %0) {
%2 = tail call i32 @pipe1(i8* %0, i32 0)
ret i32 %2
}
int main(void) {
  int array[10] = {3, 54, 98, 112, 57, 96, 65, 87, 27, 80};
  int i, max;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 3, i32 54, i32 98, i32 112, i32 57, i32 96, i32 65, i32 87, i32 27, i32 80]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_pt_entry(void *, void *, int);
void *kalloc_pframe();
void *get_new_page(void *vrt_addr, int flags) {
  void *p_addr = kalloc_pframe();
  add_pt_entry(vrt_addr, p_addr, flags | 1);
  return vrt_addr;
}


x86 assembly (clang, -O0):
<get_new_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <kalloc_pframe@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
or     $0x1,%edx
call   1030 <add_pt_entry@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_new_page>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <kalloc_pframe@plt>
or     $0x1,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <add_pt_entry@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @get_new_page(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* (...) @kalloc_pframe()
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = or i32 %9, 1
%11 = call i32 @add_pt_entry(i8* %7, i8* %8, i32 %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @get_new_page(i8* returned %0, i32 %1) {
%3 = tail call i8* (...) @kalloc_pframe()
%4 = or i32 %1, 1
%5 = tail call i32 @add_pt_entry(i8* %0, i8* %3, i32 %4)
ret i8* %0
}
void foo_1_2_2_1_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_2_2_1_2_2() {
ret void
}
char *sums(char *a, char *b) { return b; }


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

x86 assembly (clang, -O2):
<sums>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @sums(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
/* Variables and functions */
int omap_rev();
int is_omap243x(void) {
  return (((omap_rev() >> 20) & 0x0fff) == (0x243)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap243x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x14,%edx
and    $0xfff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x243,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap243x>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xfff00000,%eax
xor    %ecx,%ecx
cmp    $0x24300000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap243x() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 20
%3 = and i32 %2, 4095
%4 = icmp eq i32 %3, 579
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap243x() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -1048576
%3 = icmp eq i32 %2, 607125504
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
void skip(FILE *file) {
  char text[1024] = {0};
  while (fgets(text, 1024, file) != NULL) {
    if (strcmp(text, "\n") == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1198 <skip+0x68>
lea    -0x410(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1193 <skip+0x63>
jmp    1198 <skip+0x68>
jmp    1152 <skip+0x22>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xea8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1185 <skip+0x55>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1160 <skip+0x30>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @skip(i32* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %7, %1
%5 = call i32* @fgets(i8* %3, i32 1024, i32* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %7, %4
ret void
}
/* Variables and functions */
int u8tointcc(char const *);
int u8tointc(char *str) { return u8tointcc((const char *)str); }


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

x86 assembly (clang, -O2):
<u8tointc>:
jmp    1030 <u8tointcc@plt>

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

LLVM IR (-O2):
define i32 @u8tointc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
ret i32 %2
}
void do_pushq_neg(void) {
  unsigned long long int block[3];
  __asm__ __volatile__("movq  %0, %%rdx\n\t"
                       "pushq $0x55555555\n\t"
                       "movq  %%rsp, 0(%%rdx)\n\t"
                       "pushq $0x78988787\n\t"
                       "movq  %%rsp, 8(%%rdx)\n\t"
                       "popq  %%rax\n\t"
                       "movq  %%rax,16(%%rdx)\n\t"
                       "movq  0(%%rdx),%%rsp\n\t"
                       "addq  $8, %%rsp"
                       :
                       : "r"(&block)
                       : "rax", "rdx", "cc", "memory");
  printf("  pushq_neg: delta %lld, top64 0x%016llx\n", block[0] - block[1],
         block[2]);
}


x86 assembly (clang, -O0):
<do_pushq_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
push   $0x78988787
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_pushq_neg>:
sub    $0x18,%rsp
mov    %rsp,%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
push   $0x78988787
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    (%rsp),%rsi
mov    0x10(%rsp),%rdx
sub    0x8(%rsp),%rsi
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c" pushq_neg: delta %lld, top64 0x%016llx\0A\00"
define void @do_pushq_neg() {
%1 = alloca [3 x i64]
%2 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%5 = load i64, i64* %4
%6 = sub i64 %3, %5
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%8 = load i64, i64* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c" pushq_neg: delta %lld, top64 0x%016llx\0A\00"
define void @do_pushq_neg() {
%1 = alloca [3 x i64]
%2 = bitcast [3 x i64]* %1 to i8*
%3 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%9 = load i64, i64* %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void tls_module_init(void) {
  SSL_library_init();
  SSL_load_error_strings();
}


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

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

LLVM IR (-O0):
define void @tls_module_init() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @SSL_load_error_strings()
ret void
}

LLVM IR (-O2):
define void @tls_module_init() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @SSL_load_error_strings()
ret void
}