xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ kill(int, int /*<<< orphan*/);
int mdmon_pid(int);
int mdmon_running(int devnum) {
  int pid = mdmon_pid(devnum);
  if (pid <= 0)
    return 0;
  if (kill(pid, 0) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<mdmon_running>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <mdmon_pid@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     114c <mdmon_running+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1173 <mdmon_running+0x53>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1040 <kill@plt>
cmp    $0x0,%rax
jne    116c <mdmon_running+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <mdmon_running+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdmon_running>:
push   %rax
call   1030 <mdmon_pid@plt>
test   %eax,%eax
jle    1140 <mdmon_running+0x20>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <kill@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mdmon_running(i32 %0) {
%2 = tail call i32 @mdmon_pid(i32 %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @kill(i32 %2, i32 0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
long strtol(char *, char **, int);
long parse_int(char *c, char *err) {
  char *strtol_last_char_ptr = c;
  long value = strtol(c, &strtol_last_char_ptr, 10);
  if (strtol_last_char_ptr == c) {
    fprintf(stderr, err, c);
    exit(-1);
  }
  return value;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    118c <parse_int+0x5c>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
cmp    %rbx,(%rsp)
je     1159 <parse_int+0x29>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i64 @parse_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = call i64 @strtol(i8* %8, i8** %5, i32 10)
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %4
%16 = load i8*, i8** %3
%17 = call i32 @fprintf(i32 %14, i8* %15, i8* %16)
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %2
%20 = load i64, i64* %6
ret i64 %20
}

LLVM IR (-O2):
@stderr = global i32 0
define i64 @parse_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* %0, i8** %3
%5 = call i64 @strtol(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* %1, i8* %0)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret i64 %5
}
unsigned int iJIT_GetNewMethodID() {
  static unsigned int methodID = 1;
  if (methodID == 0)
    return 0;
  return methodID++;
}


x86 assembly (clang, -O0):
<iJIT_GetNewMethodID>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f15(%rip)
jne    111d <iJIT_GetNewMethodID+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1131 <iJIT_GetNewMethodID+0x31>
mov    0x2efd(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2ef2(%rip)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iJIT_GetNewMethodID>:
mov    0x2f1a(%rip),%eax
test   %eax,%eax
je     1113 <iJIT_GetNewMethodID+0x13>
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0d(%rip)
ret

LLVM IR (-O0):
@iJIT_GetNewMethodID.methodID = internal global i32 1
define i32 @iJIT_GetNewMethodID() {
%1 = alloca i32
%2 = load i32, i32* @iJIT_GetNewMethodID.methodID
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %8
5: ; preds = %0
%6 = load i32, i32* @iJIT_GetNewMethodID.methodID
%7 = add i32 %6, 1
store i32 %7, i32* @iJIT_GetNewMethodID.methodID
store i32 %6, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@iJIT_GetNewMethodID.methodID = internal unnamed_addr global i32 1
define i32 @iJIT_GetNewMethodID() {
%1 = load i32, i32* @iJIT_GetNewMethodID.methodID
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = add i32 %1, 1
store i32 %4, i32* @iJIT_GetNewMethodID.methodID
br label %5
5: ; preds = %0, %3
ret i32 %1
}
/* Variables and functions */
float __nv_fmaf(float, float, float);
float fmaf(float __a, float __b, float __c) { return __nv_fmaf(__a, __b, __c); }


x86 assembly (clang, -O0):
<fmaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <__nv_fmaf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaf>:
jmp    1030 <__nv_fmaf@plt>

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

LLVM IR (-O2):
define float @fmaf(float %0, float %1, float %2) {
%4 = tail call float @__nv_fmaf(float %0, float %1, float %2)
ret float %4
}
/* Type definitions */
struct syntax_args {
  int dummy;
};
struct interp_context {
  int dummy;
};

/* Variables and functions */
int syntax_parse_func_args(struct interp_context *, struct syntax_args *);
int syntax_parse_call_args(struct interp_context *ctx,
                           struct syntax_args *args) {
  return syntax_parse_func_args(ctx, args);
}


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

x86 assembly (clang, -O2):
<syntax_parse_call_args>:
jmp    1030 <syntax_parse_func_args@plt>

LLVM IR (-O0):
%struct.interp_context = type { i32 }
%struct.syntax_args = type { i32 }
define i32 @syntax_parse_call_args(%struct.interp_context* %0, %struct.syntax_args* %1) {
%3 = alloca %struct.interp_context*
%4 = alloca %struct.syntax_args*
store %struct.interp_context* %0, %struct.interp_context** %3
store %struct.syntax_args* %1, %struct.syntax_args** %4
%5 = load %struct.interp_context*, %struct.interp_context** %3
%6 = load %struct.syntax_args*, %struct.syntax_args** %4
%7 = call i32 @syntax_parse_func_args(%struct.interp_context* %5, %struct.syntax_args* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.interp_context = type { i32 }
%struct.syntax_args = type { i32 }
define i32 @syntax_parse_call_args(%struct.interp_context* %0, %struct.syntax_args* %1) {
%3 = tail call i32 @syntax_parse_func_args(%struct.interp_context* %0, %struct.syntax_args* %1)
ret i32 %3
}
void rotateClockwise() {}


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

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

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

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

/* Variables and functions */
char feed_text_iterator_set_line(struct feed_text_iterator *const,
                                 unsigned long);
char feed_text_iterator_home_line(
    struct feed_text_iterator *const p_text_iterator) {
  return feed_text_iterator_set_line(p_text_iterator, 0ul);
}


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

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

LLVM IR (-O0):
%struct.feed_text_iterator = type { i32 }
define signext i8 @feed_text_iterator_home_line(%struct.feed_text_iterator* %0) {
%2 = alloca %struct.feed_text_iterator*
store %struct.feed_text_iterator* %0, %struct.feed_text_iterator** %2
%3 = load %struct.feed_text_iterator*, %struct.feed_text_iterator** %2
%4 = call signext i8 @feed_text_iterator_set_line(%struct.feed_text_iterator* %3, i64 0)
ret i8 %4
}

LLVM IR (-O2):
%struct.feed_text_iterator = type { i32 }
define signext i8 @feed_text_iterator_home_line(%struct.feed_text_iterator* %0) {
%2 = tail call signext i8 @feed_text_iterator_set_line(%struct.feed_text_iterator* %0, i64 0)
ret i8 %2
}
void discrete_world_2D_testbench_init_function_unit_add_pos(unsigned int w,
                                                            unsigned int h,
                                                            unsigned int x,
                                                            unsigned int y,
                                                            void *new_unit) {
  *(long *)new_unit = x + y;
}


x86 assembly (clang, -O0):
<discrete_world_2D_testbench_init_function_unit_add_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<discrete_world_2D_testbench_init_function_unit_add_pos>:
add    %ecx,%edx
mov    %rdx,(%r8)
ret

LLVM IR (-O0):
define void @discrete_world_2D_testbench_init_function_unit_add_pos(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %8
%12 = load i32, i32* %9
%13 = add i32 %11, %12
%14 = zext i32 %13 to i64
%15 = load i8*, i8** %10
%16 = bitcast i8* %15 to i64*
store i64 %14, i64* %16
ret void
}

LLVM IR (-O2):
define void @discrete_world_2D_testbench_init_function_unit_add_pos(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4) {
%6 = add i32 %3, %2
%7 = zext i32 %6 to i64
%8 = bitcast i8* %4 to i64*
store i64 %7, i64* %8
ret void
}
void INT_Excep_SCI8_ERI8(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI8_ERI8() {
ret void
}
void __bug(char *file, int line, void *data) { return; }


x86 assembly (clang, -O0):
<__bug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__bug(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void *thread_test6(void *arg) {
  int id = *(int *)arg;
  fputs("t%d: starting; errno %p\n", stdout);
  sleep(id);
  fputs("t%d: exiting\n", stdout);
  return (void *)(intptr_t)id;
}


x86 assembly (clang, -O0):
<thread_test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1030 <fputs@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <fputs@plt>
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_test6>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%esi
lea    0xec9(%rip),%rdi
call   1030 <fputs@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
mov    (%r14),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
movslq %ebx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"t%d: starting; errno %p\0A\00"
@stdout = global i32 0
@.str.1 = [14 x i8] c"t%d: exiting\0A\00"
define i8* @thread_test6(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @sleep(i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"t%d: starting; errno %p\0A\00"
@stdout = global i32 0
@.str.1 = [14 x i8] c"t%d: exiting\0A\00"
define i8* @thread_test6(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @sleep(i32 %3)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = sext i32 %3 to i64
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t EndianCvt16(int16_t x) {
  return ((x >> 8) & 0xff) | ((x << 8) & 0xff00);
}


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

x86 assembly (clang, -O2):
<EndianCvt16>:
rol    $0x8,%di
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @EndianCvt16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void cw1200_itp_wake_up_tx(struct cw1200_common *priv) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define void @cw1200_itp_wake_up_tx(%struct.cw1200_common* nocapture %0) {
ret void
}
/* Variables and functions */
int ap_cmd_set_int(int, int, int);
int ap_set_current(int session, int pos) {
  return ap_cmd_set_int(session, 0xcc35, pos);
}


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

x86 assembly (clang, -O2):
<ap_set_current>:
mov    %esi,%edx
mov    $0xcc35,%esi
jmp    1030 <ap_cmd_set_int@plt>

LLVM IR (-O0):
define i32 @ap_set_current(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 @ap_cmd_set_int(i32 %5, i32 52277, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_set_current(i32 %0, i32 %1) {
%3 = tail call i32 @ap_cmd_set_int(i32 %0, i32 52277, i32 %1)
ret i32 %3
}
void swap(struct tree **lhs, struct tree **rhs) {
  struct tree *tmp = *lhs;
  *lhs = *rhs;
  *rhs = tmp;
}


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

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

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

LLVM IR (-O2):
%struct.tree = type opaque
define void @swap(%struct.tree** nocapture %0, %struct.tree** nocapture %1) {
%3 = load %struct.tree*, %struct.tree** %0
%4 = load %struct.tree*, %struct.tree** %1
store %struct.tree* %4, %struct.tree** %0
store %struct.tree* %3, %struct.tree** %1
ret void
}
void Get_break(char *AsmName, int Opcode, int OpcodeImm) {}


x86 assembly (clang, -O0):
<Get_break>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Get_break(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_buf(char *, int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ use_buf(char *);
void use_memcpy() {
  char src[100];
  char tgt[100];
  fill_buf(src, 99);
  memcpy(tgt, src, 100);
  use_buf(tgt);
}


x86 assembly (clang, -O0):
<use_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0x70(%rbp),%rdi
mov    $0x63,%esi
call   1040 <fill_buf@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x64,%edx
call   1030 <memcpy@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <use_buf@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_memcpy>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0x70(%rsp),%r14
mov    %r14,%rdi
mov    $0x63,%esi
call   1040 <fill_buf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x64,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
call   1050 <use_buf@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @use_memcpy() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @fill_buf(i8* %3, i32 99)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 100)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @use_buf(i8* %8)
ret void
}

LLVM IR (-O2):
define void @use_memcpy() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @fill_buf(i8* %3, i32 99)
%6 = call i32 @memcpy(i8* %4, i8* %3, i32 100)
%7 = call i32 @use_buf(i8* %4)
ret void
}
void foo210() {}


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

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

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

LLVM IR (-O2):
define void @foo210() {
ret void
}
/* Variables and functions */
int rec2(int);
int rec1(int x) {
  if (x == 0)
    return 0;
  else
    return rec2(x - 1);
}


x86 assembly (clang, -O0):
<rec1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <rec1+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <rec1+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <rec2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec1>:
test   %edi,%edi
je     111c <rec1+0xc>
add    $0xffffffff,%edi
jmp    1030 <rec2@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rec1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @rec2(i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @rec1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @rec2(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
main(argc, argv) register char *argv[];
{
  register i;
  if (argc > 1)
    for (i = 1; i < argc; i++)
      ot(argv[i]);
  else
    ot("a.out");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1169 <main+0x59>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1164 <main+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <ot@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <main+0x27>
jmp    1177 <main+0x67>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <ot@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1146 <main+0x36>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1030 <ot@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
jmp    1154 <main+0x44>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <ot@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"a.out\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %15, label %6
13: ; preds = %2
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %6, %13
ret i32 0
}
int bibl_illegalinmode(int mode) {
  if (mode < (100) || mode > ((100) + 11))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bibl_illegalinmode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jl     111b <bibl_illegalinmode+0x1b>
cmpl   $0x6f,-0x8(%rbp)
jle    1127 <bibl_illegalinmode+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <bibl_illegalinmode+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bibl_illegalinmode>:
add    $0xffffff90,%edi
xor    %eax,%eax
cmp    $0xfffffff4,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @bibl_illegalinmode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 100
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 111
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 1, i32* %2
br label %11
10: ; preds = %6
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @bibl_illegalinmode(i32 %0) {
%2 = add i32 %0, -112
%3 = icmp ult i32 %2, -12
%4 = zext i1 %3 to i32
ret i32 %4
}
int Section2First(int number) { return number / 1000; }


x86 assembly (clang, -O0):
<Section2First>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section2First>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Section2First(i32 %0) {
%2 = sdiv i32 %0, 1000
ret i32 %2
}
reset_tcp(tcb) register struct tcb *tcb;
{ close_self(tcb, 1); }


x86 assembly (clang, -O0):
<reset_tcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <close_self@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_tcp>:
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <close_self@plt>

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @reset_tcp(%struct.tcb* %0) {
%2 = alloca i32
%3 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %3
%4 = load %struct.tcb*, %struct.tcb** %3
%5 = call i32 (%struct.tcb*, i32, ...) bitcast (i32 (...)* @close_self to i32 (%struct.tcb*, i32, ...)*)(%struct.tcb* %4, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @reset_tcp(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, i32, ...) bitcast (i32 (...)* @close_self to i32 (%struct.tcb*, i32, ...)*)(%struct.tcb* %0, i32 1)
ret i32 undef
}
/* Variables and functions */
int instantiateClassInSpace(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int primitiveBehavior_BasicNew_(int receiver, int *arguments) {
  return (instantiateClassInSpace(receiver,
                                  ((arguments[0] & 0x80000000)
                                       ? (((-1 << 31) | arguments[0]) >> 1)
                                       : (arguments[0] >> 1)),
                                  0, 0));
}


x86 assembly (clang, -O0):
<primitiveBehavior_BasicNew_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     114f <primitiveBehavior_BasicNew_+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
or     $0x80000000,%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115b <primitiveBehavior_BasicNew_+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <instantiateClassInSpace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitiveBehavior_BasicNew_>:
mov    (%rsi),%esi
sar    %esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <instantiateClassInSpace@plt>

LLVM IR (-O0):
define i32 @primitiveBehavior_BasicNew_(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 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = and i32 %8, -2147483648
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = or i32 -2147483648, %14
%16 = ashr i32 %15, 1
br label %22
17: ; preds = %2
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = ashr i32 %20, 1
br label %22
22: ; preds = %17, %11
%23 = phi i32 [ %16, %11 ], [ %21, %17 ]
%24 = call i32 @instantiateClassInSpace(i32 %5, i32 %23, i32 0, i32 0)
ret i32 %24
}

LLVM IR (-O2):
define i32 @primitiveBehavior_BasicNew_(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = ashr i32 %3, 1
%5 = tail call i32 @instantiateClassInSpace(i32 %0, i32 %4, i32 0, i32 0)
ret i32 %5
}
/* Variables and functions */
int _get_bit(const char *s, size_t s_len, size_t bit_pos) {
  return (bit_pos >> 3) >= s_len ? 0
                                 : s[bit_pos >> 3] & (1 << (7 - (bit_pos & 7)));
}


x86 assembly (clang, -O0):
<_get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x3,%rax
cmp    -0x10(%rbp),%rax
jb     112c <_get_bit+0x2c>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <_get_bit+0x5a>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rdx
and    $0x7,%rdx
mov    $0x7,%ecx
sub    %rdx,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_bit>:
mov    %rdx,%rcx
shr    $0x3,%rcx
xor    %eax,%eax
cmp    %rsi,%rcx
jae    1122 <_get_bit+0x22>
movzbl (%rdi,%rcx,1),%esi
not    %dl
and    $0x7,%dl
mov    $0x1,%eax
mov    %edx,%ecx
shl    %cl,%eax
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @_get_bit(i8* nocapture %0, i64 %1, i64 %2) {
%4 = lshr i64 %2, 3
%5 = icmp ult i64 %4, %1
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 %4
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = trunc i64 %2 to i32
%11 = and i32 %10, 7
%12 = xor i32 %11, 7
%13 = shl nuw i32 1, %12
%14 = and i32 %13, %9
br label %15
15: ; preds = %3, %6
%16 = phi i32 [ %14, %6 ], [ 0, %3 ]
ret i32 %16
}
void save_tcpinfo(struct iperf_stream *sp, struct iperf_interval_results *irp) {
}


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

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

LLVM IR (-O0):
%struct.iperf_stream = type opaque
%struct.iperf_interval_results = type opaque
define void @save_tcpinfo(%struct.iperf_stream* %0, %struct.iperf_interval_results* %1) {
%3 = alloca %struct.iperf_stream*
%4 = alloca %struct.iperf_interval_results*
store %struct.iperf_stream* %0, %struct.iperf_stream** %3
store %struct.iperf_interval_results* %1, %struct.iperf_interval_results** %4
ret void
}

LLVM IR (-O2):
%struct.iperf_stream = type opaque
%struct.iperf_interval_results = type opaque
define void @save_tcpinfo(%struct.iperf_stream* nocapture %0, %struct.iperf_interval_results* nocapture %1) {
ret void
}
unsigned int eruConfigureETL0(unsigned int exs_a_input,
                              unsigned int exs_b_input, unsigned int exicon) {
  unsigned int exisel = (*((volatile unsigned int *const)(0x40010600 + 0x00)));
  exisel &= !((3 << 0) | (3 << 2));
  exisel |= ((exs_a_input << 0) | (exs_b_input << 2));
  (*((volatile unsigned int *const)(0x40010600 + 0x00))) = exisel;
  (*((volatile unsigned int *const)(0x40010600 + 0x10))) = exicon;
  return 0;
}


x86 assembly (clang, -O0):
<eruConfigureETL0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x40010600,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x40010600,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0x40010610,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eruConfigureETL0>:
mov    0x40010600,%eax
shl    $0x2,%esi
or     %edi,%esi
mov    %esi,0x40010600
mov    %edx,0x40010610
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @eruConfigureETL0(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load volatile i32, i32* inttoptr (i64 1073808896 to i32*)
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = and i32 %9, 0
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = shl i32 %11, 0
%13 = load i32, i32* %5
%14 = shl i32 %13, 2
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = or i32 %16, %15
store i32 %17, i32* %7
%18 = load i32, i32* %7
store volatile i32 %18, i32* inttoptr (i64 1073808896 to i32*)
%19 = load i32, i32* %6
store volatile i32 %19, i32* inttoptr (i64 1073808912 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @eruConfigureETL0(i32 %0, i32 %1, i32 %2) {
%4 = load volatile i32, i32* inttoptr (i64 1073808896 to i32*)
%5 = shl i32 %1, 2
%6 = or i32 %5, %0
store volatile i32 %6, i32* inttoptr (i64 1073808896 to i32*)
store volatile i32 %2, i32* inttoptr (i64 1073808912 to i32*)
ret i32 0
}
void RTTimeNormalize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeNormalize() {
ret void
}
void half_adder(char a, char b, char *s, char *c) {
  *s = xor(a, b);
  *c = and(a, b);
}


x86 assembly (clang, -O0):
<half_adder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movsbl -0x1(%rbp),%edi
movsbl -0x2(%rbp),%esi
mov    $0x0,%al
call   1040 <xor@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x1(%rbp),%edi
movsbl -0x2(%rbp),%esi
mov    $0x0,%al
call   1030 <and@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_adder>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <xor@plt>
mov    %al,(%r15)
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <and@plt>
mov    %al,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @half_adder(i8 signext %0, i8 signext %1, i8* %2, i8* %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i8*
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @xor to i32 (i32, i32, ...)*)(i32 %10, i32 %12)
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %7
store i8 %14, i8* %15
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
%20 = call i32 (i32, i32, ...) bitcast (i32 (...)* @and to i32 (i32, i32, ...)*)(i32 %17, i32 %19)
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %8
store i8 %21, i8* %22
ret void
}

LLVM IR (-O2):
define void @half_adder(i8 signext %0, i8 signext %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = sext i8 %0 to i32
%6 = sext i8 %1 to i32
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @xor to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @and to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
ret void
}
/* Variables and functions */
bool isRightAngled(double hypotenuse, double side1, double side2) {
  return ((hypotenuse * hypotenuse) == (side1 * side1 + side2 * side2));
}


x86 assembly (clang, -O0):
<isRightAngled>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRightAngled>:
mulsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isRightAngled(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = load double, double* %5
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %6
%14 = fmul double %12, %13
%15 = call double @llvm.fmuladd.f64(double %10, double %11, double %14)
%16 = fcmp oeq double %9, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @isRightAngled(double %0, double %1, double %2) {
%4 = fmul double %0, %0
%5 = fmul double %2, %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
%7 = fcmp oeq double %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printN1(int n) {
  for (int i = 1; i <= n; i++) {
    printf("%d\t", i);
  }
}


x86 assembly (clang, -O0):
<printN1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114b <printN1+0x3b>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printN1+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printN1>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114d <printN1+0x3d>
mov    %edi,%r15d
neg    %r15d
mov    $0x1,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <printN1+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
define void @printN1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8
%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):
@.str = [4 x i8] c"%d\09\00"
define void @printN1(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %0
br i1 %8, label %3, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vscanf(char *, int /*<<< orphan*/);
void uninivar_vscanf(void) {
  char *format;
  va_list arg;
  (void)vscanf(format, arg);
}


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

x86 assembly (clang, -O2):
<uninivar_vscanf>:
jmp    1030 <vscanf@plt>

LLVM IR (-O0):
define void @uninivar_vscanf() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i8*, i8** %1
%4 = load i32, i32* %2
%5 = call i32 @vscanf(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_vscanf() {
%1 = tail call i32 @vscanf(i8* undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int arc, char **argv) {
  printf("You made it\n");
  exit(EXIT_SUCCESS);
}


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    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"You made it\0A\00"
@EXIT_SUCCESS = global i32 0
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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"You made it\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void stop2() {
  printf("Child process 2 is killed by parent!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<stop2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Child process 2 is killed by parent!\0A\00"
define void @stop2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"Child process 2 is killed by parent!\00"
define void @stop2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void IWDGTimerInit(unsigned long ulConfig) {
  ;
  (*((volatile unsigned long *)(0x40003000))) = 0x00005555;
  (*((volatile unsigned long *)(0x40003008))) = ulConfig;
}


x86 assembly (clang, -O0):
<IWDGTimerInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40003000,%eax
movq   $0x5555,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x40003008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IWDGTimerInit>:
movq   $0x5555,0x40003000
mov    %rdi,0x40003008
40
ret

LLVM IR (-O0):
define void @IWDGTimerInit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
store volatile i64 21845, i64* inttoptr (i64 1073754112 to i64*)
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1073754120 to i64*)
ret void
}

LLVM IR (-O2):
define void @IWDGTimerInit(i64 %0) {
store volatile i64 21845, i64* inttoptr (i64 1073754112 to i64*)
store volatile i64 %0, i64* inttoptr (i64 1073754120 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
uint32_t prng_uint32() { return (uint32_t)rand(); }


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

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

LLVM IR (-O0):
define i32 @prng_uint32() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @prng_uint32() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ncgfree(void *ptr) { free((char *)ptr); }


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

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


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

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

LLVM IR (-O0):
define i32 @max_fleets() {
ret i32 10
}

LLVM IR (-O2):
define i32 @max_fleets() {
ret i32 10
}