xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ delay_setup();
int /*<<< orphan*/ line_setup();
int /*<<< orphan*/ metro_setup();
int /*<<< orphan*/ pipe_setup();
int /*<<< orphan*/ timer_setup();
void x_time_setup(void) {
  delay_setup();
  metro_setup();
  line_setup();
  timer_setup();
  pipe_setup();
}


x86 assembly (clang, -O0):
<x_time_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <delay_setup@plt>
mov    $0x0,%al
call   1070 <metro_setup@plt>
mov    $0x0,%al
call   1030 <line_setup@plt>
mov    $0x0,%al
call   1050 <timer_setup@plt>
mov    $0x0,%al
call   1040 <pipe_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_time_setup>:
push   %rax
xor    %eax,%eax
call   1060 <delay_setup@plt>
xor    %eax,%eax
call   1070 <metro_setup@plt>
xor    %eax,%eax
call   1030 <line_setup@plt>
xor    %eax,%eax
call   1050 <timer_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pipe_setup@plt>

LLVM IR (-O0):
define void @x_time_setup() {
%1 = call i32 (...) @delay_setup()
%2 = call i32 (...) @metro_setup()
%3 = call i32 (...) @line_setup()
%4 = call i32 (...) @timer_setup()
%5 = call i32 (...) @pipe_setup()
ret void
}

LLVM IR (-O2):
define void @x_time_setup() {
%1 = tail call i32 (...) @delay_setup()
%2 = tail call i32 (...) @metro_setup()
%3 = tail call i32 (...) @line_setup()
%4 = tail call i32 (...) @timer_setup()
%5 = tail call i32 (...) @pipe_setup()
ret void
}
int i8080_hal_io_input(int port) {
  extern int hal_io_input(int port);
  return hal_io_input(port);
}


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

x86 assembly (clang, -O2):
<i8080_hal_io_input>:
jmp    1030 <hal_io_input@plt>

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

LLVM IR (-O2):
define i32 @i8080_hal_io_input(i32 %0) {
%2 = tail call i32 @hal_io_input(i32 %0)
ret i32 %2
}
/* Variables and functions */
int findIndex(int *, int, int, int /*<<< orphan*/);
int findMinIndex(int *arr, int first, int last) {
  return findIndex(arr, first, last, 0);
}


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

x86 assembly (clang, -O2):
<findMinIndex>:
xor    %ecx,%ecx
jmp    1030 <findIndex@plt>

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

LLVM IR (-O2):
define i32 @findMinIndex(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @findIndex(i32* %0, i32 %1, i32 %2, i32 0)
ret i32 %4
}
void OCSP_RESPBYTES_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_RESPBYTES_free() {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
void start_watch(struct timespec *);
void stop_watch(struct timespec *timer) { return start_watch(timer); }


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

x86 assembly (clang, -O2):
<stop_watch>:
jmp    1030 <start_watch@plt>

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @stop_watch(%struct.timespec* %0) {
tail call void @start_watch(%struct.timespec* %0)
ret void
}
int main(int argc, char **argv) {
  switch (0) {
  case 0:
    1 + (int __attribute__((unit(m))))2;
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ japi_setalign(int, int);
void j_setalign(int arg0, int arg1) { japi_setalign(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setalign>:
jmp    1030 <japi_setalign@plt>

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

LLVM IR (-O2):
define void @j_setalign(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setalign(i32 %0, i32 %1)
ret void
}
void dummy() {}


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

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

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

LLVM IR (-O2):
define void @dummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, long, long, long, long, long, long);
void exit(long err) {
  syscall(0x3c, (long)(err), (long)(0), (long)(0), (long)(0), (long)(0),
          (long)(0));
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x3c,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
movq   $0x0,(%rsp)
call   1030 <syscall@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    $0x3c,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>

LLVM IR (-O0):
define void @exit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @syscall(i32 60, i64 %3, i64 0, i64 0, i64 0, i64 0, i64 0)
unreachable
}

LLVM IR (-O2):
define void @exit(i64 %0) {
%2 = tail call i32 @syscall(i32 60, i64 %0, i64 0, i64 0, i64 0, i64 0, i64 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ get_type();
int /*<<< orphan*/ my_putstr(char *);
int /*<<< orphan*/ splash_screen();
void init() {
  my_putstr("\e[0;31m     Veuillez selectionner le type de remplissage\n");
  my_putstr("     1) Random (etape 1)\n");
  my_putstr("     2) Fichier (etape 4)\n\e[0m");
  get_type();
  splash_screen();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <my_putstr@plt>
lea    0xef3(%rip),%rdi
call   1030 <my_putstr@plt>
lea    0xf01(%rip),%rdi
call   1030 <my_putstr@plt>
mov    $0x0,%al
call   1050 <get_type@plt>
mov    $0x0,%al
call   1040 <splash_screen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <my_putstr@plt>
lea    0xef6(%rip),%rdi
call   1030 <my_putstr@plt>
lea    0xf04(%rip),%rdi
call   1030 <my_putstr@plt>
xor    %eax,%eax
call   1050 <get_type@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <splash_screen@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"\1B[0;31m Veuillez selectionner le type de remplissage\0A\00"
@.str.1 = [26 x i8] c" 1) Random (etape 1)\0A\00"
@.str.2 = [31 x i8] c" 2) Fichier (etape 4)\0A\1B[0m\00"
define void @init() {
%1 = call i32 @my_putstr(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @my_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @my_putstr(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @get_type()
%5 = call i32 (...) @splash_screen()
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"\1B[0;31m Veuillez selectionner le type de remplissage\0A\00"
@.str.1 = [26 x i8] c" 1) Random (etape 1)\0A\00"
@.str.2 = [31 x i8] c" 2) Fichier (etape 4)\0A\1B[0m\00"
define void @init() {
%1 = tail call i32 @my_putstr(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @my_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @my_putstr(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @get_type()
%5 = tail call i32 (...) @splash_screen()
ret void
}
int __attribute__((no)) neq(int a, int b) { return -(a == b); }


x86 assembly (clang, -O0):
<neq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neq>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @neq(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @neq(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mp2_940_start(int /*<<< orphan*/);
void Main940() { mp2_940_start(0); }


x86 assembly (clang, -O0):
<Main940>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mp2_940_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Main940>:
xor    %edi,%edi
jmp    1030 <mp2_940_start@plt>

LLVM IR (-O0):
define void @Main940() {
%1 = call i32 @mp2_940_start(i32 0)
ret void
}

LLVM IR (-O2):
define void @Main940() {
%1 = tail call i32 @mp2_940_start(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daa();
void opcode_27() { daa(); }


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

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

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

LLVM IR (-O2):
define void @opcode_27() {
%1 = tail call i32 (...) @daa()
ret void
}
/* Variables and functions */
char *smalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *dupstr(char *s) {
  char *r = smalloc(1 + strlen(s));
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <smalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <smalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 1, %5
%7 = call i8* @smalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @smalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int inc(int start, int end, int pos) {
  if (end > start) {
    return (pos >= start && pos < end);
  } else {
    return (pos < end || pos >= start);
  }
}


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1146 <inc+0x46>
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     1136 <inc+0x36>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <inc+0x6e>
mov    -0x10(%rbp),%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0x12(%rbp)
jl     1163 <inc+0x63>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
cmp    %edi,%esi
jle    1114 <inc+0x14>
cmp    %edi,%edx
setge  %cl
cmp    %esi,%edx
setl   %al
and    %cl,%al
movzbl %al,%eax
ret
cmp    %esi,%edx
setl   %cl
cmp    %edi,%edx
setge  %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @inc(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %3
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = icmp slt i32 %16, %17
br label %19
19: ; preds = %15, %11
%20 = phi i1 [ false, %11 ], [ %18, %15 ]
%21 = zext i1 %20 to i32
store i32 %21, i32* %4
br label %33
22: ; preds = %3
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = icmp slt i32 %23, %24
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i32, i32* %7
%28 = load i32, i32* %5
%29 = icmp sge i32 %27, %28
br label %30
30: ; preds = %26, %22
%31 = phi i1 [ true, %22 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
store i32 %32, i32* %4
br label %33
33: ; preds = %30, %19
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @inc(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = icmp sge i32 %2, %0
%7 = icmp slt i32 %2, %1
%8 = and i1 %6, %7
br label %13
9: ; preds = %3
%10 = icmp slt i32 %2, %1
%11 = icmp sge i32 %2, %0
%12 = or i1 %10, %11
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ %8, %5 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}
int has_box_on(char ch) { return ch == '$' || ch == '*'; }


x86 assembly (clang, -O0):
<has_box_on>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x24,%ecx
mov    %al,-0x2(%rbp)
je     1129 <has_box_on+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_box_on>:
cmp    $0x24,%dil
sete   %al
cmp    $0x2a,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @has_box_on(i8 signext %0) {
%2 = icmp eq i8 %0, 36
%3 = icmp eq i8 %0, 42
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ can_oc_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  base_test();
  can_oc_test(0xfffc0000);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0xfffc0000,%edi
call   1030 <can_oc_test@plt>
mov    $0x0,%al
call   1040 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0xfffc0000,%edi
call   1030 <can_oc_test@plt>
xor    %eax,%eax
call   1040 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @can_oc_test(i32 -262144)
%4 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @can_oc_test(i32 -262144)
%4 = tail call i32 (...) @report_end()
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int number_of_facets(int dim, int *nbr) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(582, &dim, nbr, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<number_of_facets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x246,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_facets>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x246,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @number_of_facets(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 582, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @number_of_facets(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 582, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
/* Variables and functions */
int thingy(int, char **);
int main(int argc, char *argv[]) { return thingy(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @thingy(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free5(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<free5>:
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):
<free5>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free5(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 @free5(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
onintr() { return (1); }


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

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

LLVM IR (-O0):
define i32 @onintr() {
ret i32 1
}

LLVM IR (-O2):
define i32 @onintr() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __libclog_printf(char *, ...);
int /*<<< orphan*/ abort();
void __dj_assert(const char *msg, const char *file, int line) {
  __libclog_printf("Assertion failed at line %u in file %s\n", line, file);
  __libclog_printf("Assertion: '%s'\n", msg);
  abort();
}


x86 assembly (clang, -O0):
<__dj_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <__libclog_printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <__libclog_printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__dj_assert>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
mov    %edx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <__libclog_printf@plt>
lea    0xee7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <__libclog_printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Assertion failed at line %u in file %s\0A\00"
@.str.1 = [17 x i8] c"Assertion: '%s'\0A\00"
define void @__dj_assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %5
%9 = call i32 (i8*, ...) @__libclog_printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @__libclog_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"Assertion failed at line %u in file %s\0A\00"
@.str.1 = [17 x i8] c"Assertion: '%s'\0A\00"
define void @__dj_assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @__libclog_printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
%5 = tail call i32 (i8*, ...) @__libclog_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int getentropy(void *buffer, size_t length) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<getentropy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getentropy>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @getentropy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @getentropy(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void *get_XKeyPressedEvent_display(void *_p) {
  return (void *)((XKeyPressedEvent *)_p)->display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XKeyPressedEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XKeyPressedEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
void bzero(char *buf, int len) {
  while (len--)
    *buf++ = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1136 <bzero+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    110b <bzero+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
je     1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void XkbFreeGeomOverlayRows() {}


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

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

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

LLVM IR (-O2):
define void @XkbFreeGeomOverlayRows() {
ret void
}
void add_char(char **ps, int *pchars_generated, int buf_len, char ch) {
  if ((*pchars_generated)++ < buf_len) {
    *(*ps)++ = ch;
  }
  if (*pchars_generated == buf_len) {
    *(*ps - 1) = 0;
  }
}


x86 assembly (clang, -O0):
<add_char>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
cmp    -0x14(%rbp),%eax
jge    1140 <add_char+0x40>
mov    -0x15(%rbp),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    115a <add_char+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,-0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_char>:
mov    (%rsi),%eax
lea    0x1(%rax),%r8d
mov    %r8d,(%rsi)
cmp    %edx,%eax
jl     1113 <add_char+0x13>
cmp    %edx,%r8d
je     1128 <add_char+0x28>
ret
mov    (%rdi),%r8
lea    0x1(%r8),%rax
mov    %rax,(%rdi)
mov    %cl,(%r8)
mov    (%rsi),%r8d
cmp    %edx,%r8d
jne    1112 <add_char+0x12>
mov    (%rdi),%rax
movb   $0x0,-0x1(%rax)
ret

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

LLVM IR (-O2):
define void @add_char(i8** nocapture %0, i32* nocapture %1, i32 %2, i8 signext %3) {
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = icmp slt i32 %5, %2
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
store i8 %3, i8* %9
%11 = load i32, i32* %1
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %11, %8 ], [ %6, %4 ]
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %0
%17 = getelementptr inbounds i8, i8* %16, i64 -1
store i8 0, i8* %17
br label %18
18: ; preds = %15, %12
ret void
}
/* Type definitions */
struct soap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ soap_close_logfile(struct soap *, int);
void soap_close_logfiles(struct soap *soap) {
  int i;
  for (i = 0; i < 3; i++)
    soap_close_logfile(soap, i);
}


x86 assembly (clang, -O0):
<soap_close_logfiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1147 <soap_close_logfiles+0x37>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <soap_close_logfile@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <soap_close_logfiles+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soap_close_logfiles>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <soap_close_logfile@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <soap_close_logfile@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1030 <soap_close_logfile@plt>

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

LLVM IR (-O2):
%struct.soap = type { i32 }
define void @soap_close_logfiles(%struct.soap* %0) {
%2 = tail call i32 @soap_close_logfile(%struct.soap* %0, i32 0)
%3 = tail call i32 @soap_close_logfile(%struct.soap* %0, i32 1)
%4 = tail call i32 @soap_close_logfile(%struct.soap* %0, i32 2)
ret void
}
nseg(n) { return ((n + 127) >> 7); }


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

x86 assembly (clang, -O2):
<nseg>:
lea    0x7f(%rdi),%eax
sar    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @nseg(i32 %0) {
%2 = add nsw i32 %0, 127
%3 = ashr i32 %2, 7
ret i32 %3
}
/* Type definitions */
typedef int uLong;

/* Variables and functions */
int compressBound(long);
int /*<<< orphan*/ printf(char *, int);
void testCompressBound(void) {
  uLong ret = compressBound(10L);
  if (ret != 23)
    printf("compressBound(): Error: %lu\n", ret);
  printf("compressBound: %lu\n", ret);
}


x86 assembly (clang, -O0):
<testCompressBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <compressBound@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x17,-0x4(%rbp)
je     114e <testCompressBound+0x2e>
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCompressBound>:
push   %rbx
mov    $0xa,%edi
call   1040 <compressBound@plt>
mov    %eax,%ebx
cmp    $0x17,%eax
je     1140 <testCompressBound+0x20>
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"compressBound(): Error: %lu\0A\00"
@.str.1 = [20 x i8] c"compressBound: %lu\0A\00"
define void @testCompressBound() {
%1 = alloca i32
%2 = call i32 @compressBound(i64 10)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 23
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %0
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"compressBound(): Error: %lu\0A\00"
@.str.1 = [20 x i8] c"compressBound: %lu\0A\00"
define void @testCompressBound() {
%1 = tail call i32 @compressBound(i64 10)
%2 = icmp eq i32 %1, 23
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_wave(int /*<<< orphan*/ *, double, double);
void write_sync(FILE *wavfile) {
  write_wave(wavfile, 0.030, 568.0);
  write_wave(wavfile, 0.170, 2272.0);
}


x86 assembly (clang, -O0):
<write_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
call   1030 <write_wave@plt>
mov    -0x8(%rbp),%rdi
movsd  0xebf(%rip),%xmm0
movsd  0xebf(%rip),%xmm1
call   1030 <write_wave@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sync>:
push   %rbx
mov    %rdi,%rbx
movsd  0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
call   1030 <write_wave@plt>
movsd  0xedf(%rip),%xmm0
movsd  0xedf(%rip),%xmm1
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <write_wave@plt>

LLVM IR (-O0):
define void @write_sync(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @write_wave(i32* %3, double 3.000000e-02, double 5.680000e+02)
%5 = load i32*, i32** %2
%6 = call i32 @write_wave(i32* %5, double 1.700000e-01, double 2.272000e+03)
ret void
}

LLVM IR (-O2):
define void @write_sync(i32* %0) {
%2 = tail call i32 @write_wave(i32* %0, double 3.000000e-02, double 5.680000e+02)
%3 = tail call i32 @write_wave(i32* %0, double 1.700000e-01, double 2.272000e+03)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_execve;
int syscall3(int /*<<< orphan*/, long, long, long);
int execve(char *f, char **argv, char **envp) {
  return syscall3(SYS_execve, (long)f, (long)argv, (long)envp);
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
@SYS_execve = global i32 0
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @SYS_execve
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = load i8**, i8*** %5
%11 = ptrtoint i8** %10 to i64
%12 = load i8**, i8*** %6
%13 = ptrtoint i8** %12 to i64
%14 = call i32 @syscall3(i32 %7, i64 %9, i64 %11, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
@SYS_execve = global i32 0
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = load i32, i32* @SYS_execve
%5 = ptrtoint i8* %0 to i64
%6 = ptrtoint i8** %1 to i64
%7 = ptrtoint i8** %2 to i64
%8 = tail call i32 @syscall3(i32 %4, i64 %5, i64 %6, i64 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  printf("please input a string!!\n");
  char str[256];
  scanf(" %s", str);
  printf("input string: %s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x110(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"please input a string!!\0A\00"
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [18 x i8] c"input string: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [18 x i8] c"input string: %s\0A\00"
@str = [24 x i8] c"please input a string!!\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void bcopy(const void *src, void *dst, size_t n) { memmove(dst, src, n); }


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

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %1, i8* %0, i64 %2)
ret void
}
/* Type definitions */
struct Cyc_Set_Set {
  int dummy;
};

/* Variables and functions */
struct Cyc_Set_Set *Cyc_AssnDef_term_fr_logicvar(void *);
int Cyc_Set_member(struct Cyc_Set_Set *, void *);
int Cyc_AssnDef_logicvar_in_term(void *lvar, void *t) {
  int _T0;
  struct Cyc_Set_Set *lvset = Cyc_AssnDef_term_fr_logicvar(t);
  _T0 = Cyc_Set_member(lvset, lvar);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_AssnDef_logicvar_in_term>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <Cyc_AssnDef_term_fr_logicvar@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <Cyc_Set_member@plt>

LLVM IR (-O0):
%struct.Cyc_Set_Set = type { i32 }
define i32 @Cyc_AssnDef_logicvar_in_term(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.Cyc_Set_Set*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call %struct.Cyc_Set_Set* @Cyc_AssnDef_term_fr_logicvar(i8* %7)
store %struct.Cyc_Set_Set* %8, %struct.Cyc_Set_Set** %6
%9 = load %struct.Cyc_Set_Set*, %struct.Cyc_Set_Set** %6
%10 = load i8*, i8** %3
%11 = call i32 @Cyc_Set_member(%struct.Cyc_Set_Set* %9, i8* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
%struct.Cyc_Set_Set = type { i32 }
define i32 @Cyc_AssnDef_logicvar_in_term(i8* %0, i8* %1) {
%3 = tail call %struct.Cyc_Set_Set* @Cyc_AssnDef_term_fr_logicvar(i8* %1)
%4 = tail call i32 @Cyc_Set_member(%struct.Cyc_Set_Set* %3, i8* %0)
ret i32 %4
}
unsigned deserializeInt(unsigned char *buf) {
  unsigned i;
  i = ((unsigned)buf[0]) << 24;
  i |= ((unsigned)buf[1]) << 16;
  i |= ((unsigned)buf[2]) << 8;
  i |= buf[3];
  return i;
}


x86 assembly (clang, -O0):
<deserializeInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @deserializeInt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ gen_e(unsigned char *);
int /*<<< orphan*/ syndrome(unsigned char *, unsigned char const *,
                            unsigned char *);
void encrypt(unsigned char *s, const unsigned char *pk, unsigned char *e) {
  gen_e(e);
  syndrome(s, pk, e);
}


x86 assembly (clang, -O0):
<encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <gen_e@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <syndrome@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <gen_e@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <syndrome@plt>

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

LLVM IR (-O2):
define void @encrypt(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @gen_e(i8* %2)
%5 = tail call i32 @syndrome(i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print0(int);
void *thread0(void *cmd) {
  while (1) {
    print0(100);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<thread0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <print0@plt>
jmp    111c <thread0+0xc>

x86 assembly (clang, -O2):
<thread0>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <print0@plt>
jmp    1120 <thread0+0x10>

LLVM IR (-O0):
define i8* @thread0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @print0(i32 100)
br label %3
}

LLVM IR (-O2):
define noalias i8* @thread0(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @print0(i32 100)
br label %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
double calcExecTime(struct timeval tv1, struct timeval tv2) {
  double time = (double)(tv2.tv_usec - tv1.tv_usec) / 1000000 +
                (double)(tv2.tv_sec - tv1.tv_sec);
  return time;
}


x86 assembly (clang, -O0):
<calcExecTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcExecTime>:
sub    %rsi,%rcx
cvtsi2sd %rcx,%xmm1
divsd  0xef0(%rip),%xmm1
sub    %rdi,%rdx
cvtsi2sd %rdx,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @calcExecTime(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca double
%8 = bitcast %struct.timeval* %5 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = bitcast %struct.timeval* %6 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
store i64 %2, i64* %12
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
store i64 %3, i64* %13
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%17 = load i64, i64* %16
%18 = sub nsw i64 %15, %17
%19 = sitofp i64 %18 to double
%20 = fdiv double %19, 1.000000e+06
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%22 = load i64, i64* %21
%23 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%24 = load i64, i64* %23
%25 = sub nsw i64 %22, %24
%26 = sitofp i64 %25 to double
%27 = fadd double %20, %26
store double %27, double* %7
%28 = load double, double* %7
ret double %28
}

LLVM IR (-O2):
define double @calcExecTime(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %3, %1
%6 = sitofp i64 %5 to double
%7 = fdiv double %6, 1.000000e+06
%8 = sub nsw i64 %2, %0
%9 = sitofp i64 %8 to double
%10 = fadd double %7, %9
ret double %10
}