xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long);
scalar_t__ getpid();
void __attribute__((__no_instrument_function__)) gnu_ptrace_close(void) {
  FILE *trace;
  if ((trace = fopen("TRACE", "a")) == NULL)
    return;
  fprintf(trace,
          "EXIT"
          " %ld\n",
          (long)getpid());
  fclose(trace);
  return;
}


x86 assembly (clang, -O0):
<gnu_ptrace_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    116e <gnu_ptrace_close+0x2e>
jmp    1199 <gnu_ptrace_close+0x59>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xe7d(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_ptrace_close>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     117e <gnu_ptrace_close+0x3e>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"TRACE\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [10 x i8] c"EXIT %ld\0A\00"
define void @gnu_ptrace_close() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
br label %11
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i64 (...) @getpid()
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 %7)
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"TRACE\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [10 x i8] c"EXIT %ld\0A\00"
define void @gnu_ptrace_close() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @getpid()
%5 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 %4)
%6 = tail call i32 @fclose(i32* %1)
br label %7
7: ; preds = %0, %3
ret void
}
int test_imm_5Bint8_reg(signed char val) {
  return ((val) & (0x5B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x5b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Bint8_reg>:
test   $0x5b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Bint8_reg(i8 signext %0) {
%2 = and i8 %0, 91
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void timespec_add_nsec(struct timespec *ts, int nsec) {
  ts->tv_nsec += nsec;
  if (ts->tv_nsec >= 1000000000) {
    ts->tv_nsec -= 1000000000;
    ts->tv_sec++;
  }
}


x86 assembly (clang, -O0):
<timespec_add_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x3b9aca00,(%rax)
jl     1141 <timespec_add_nsec+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x3b9aca00,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_add_nsec>:
add    (%rdi),%esi
mov    %esi,(%rdi)
cmp    $0x3b9aca00,%esi
jl     1118 <timespec_add_nsec+0x18>
add    $0xc4653600,%esi
mov    %esi,(%rdi)
addl   $0x1,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @timespec_add_nsec(%struct.timespec* %0, i32 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %5
store i32 %9, i32* %7
%10 = load %struct.timespec*, %struct.timespec** %3
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = icmp sge i32 %12, 1000000000
br i1 %13, label %14, label %23
14: ; preds = %2
%15 = load %struct.timespec*, %struct.timespec** %3
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = sub nsw i32 %17, 1000000000
store i32 %18, i32* %16
%19 = load %struct.timespec*, %struct.timespec** %3
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
br label %23
23: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @timespec_add_nsec(%struct.timespec* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %1
store i32 %5, i32* %3
%6 = icmp sgt i32 %5, 999999999
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = add nsw i32 %5, -1000000000
store i32 %8, i32* %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
br label %12
12: ; preds = %7, %2
ret void
}
char *skip_white_space(char *pstr) { return pstr; }


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

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

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

LLVM IR (-O2):
define i8* @skip_white_space(i8* readnone returned %0) {
ret i8* %0
}
float copy_float(const float _val) { return _val; }


x86 assembly (clang, -O0):
<copy_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @copy_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}

LLVM IR (-O2):
define float @copy_float(float returned %0) {
ret float %0
}
void thread_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @thread_dummy() {
ret void
}
ft_tablerecread() {}


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

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

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

LLVM IR (-O2):
define i32 @ft_tablerecread() {
ret i32 undef
}
void gtk_text_iter_get_language() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_get_language() {
ret void
}
/* Variables and functions */
int syscall(int, char *, int /*<<< orphan*/);
int gettty(char *tty) { return syscall(41, tty, 0); }


x86 assembly (clang, -O0):
<gettty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x29,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettty>:
mov    %rdi,%rsi
mov    $0x29,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @gettty(i8* %0) {
%2 = tail call i32 @syscall(i32 41, i8* %0, i32 0)
ret i32 %2
}
void RSA_private_encrypt(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_private_encrypt() {
ret void
}
/* Variables and functions */
unsigned short htons(unsigned short);
unsigned short sl_htons(unsigned short hostshort) { return htons(hostshort); }


x86 assembly (clang, -O0):
<sl_htons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <htons@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_htons>:
jmp    1030 <htons@plt>

LLVM IR (-O0):
define zeroext i16 @sl_htons(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @htons(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @sl_htons(i16 zeroext %0) {
%2 = tail call zeroext i16 @htons(i16 zeroext %0)
ret i16 %2
}
/* Type definitions */
struct mux_socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void eventcb(struct mux_socket *sock, int event, void *arg) {
  printf("user event(%d) call\n", event);
}


x86 assembly (clang, -O0):
<eventcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mux_socket = type { i32 }
@.str = [21 x i8] c"user event(%d) call\0A\00"
define void @eventcb(%struct.mux_socket* %0, i32 %1, i8* %2) {
%4 = alloca %struct.mux_socket*
%5 = alloca i32
%6 = alloca i8*
store %struct.mux_socket* %0, %struct.mux_socket** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.mux_socket = type { i32 }
@.str = [21 x i8] c"user event(%d) call\0A\00"
define void @eventcb(%struct.mux_socket* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int expect_value(int parameter, int size) {
  if (parameter == size)
    return 1;
  printf("#Failed: %d != %d\n", parameter, size);
  return 0;
}


x86 assembly (clang, -O0):
<expect_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1136 <expect_value+0x26>
movl   $0x1,-0x4(%rbp)
jmp    114f <expect_value+0x3f>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_value>:
mov    %esi,%edx
mov    $0x1,%eax
cmp    %esi,%edi
je     1130 <expect_value+0x20>
push   %rax
mov    %edi,%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"#Failed: %d != %d\0A\00"
define i32 @expect_value(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %7
}
int SPG_Clamp(int value, int min, int max) {
  return ((value < min) ? min : (value > max) ? max : value);
}


x86 assembly (clang, -O0):
<SPG_Clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <SPG_Clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <SPG_Clamp+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <SPG_Clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <SPG_Clamp+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPG_Clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @SPG_Clamp(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 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @SPG_Clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_xor(void) {
  test("4", "main(){printf(\"%d\", 7^3);}");
  test("7", "main(){int i=4; i^=3; printf(\"%d\", i);}");
}


x86 assembly (clang, -O0):
<TEST_xor>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <test@plt>
lea    0xeef(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_xor>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <test@plt>
lea    0xef2(%rip),%rdi
lea    0xeed(%rip),%rsi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"4\00"
@.str.1 = [27 x i8] c"main(){printf(\22%d\22, 7^3);}\00"
@.str.2 = [2 x i8] c"7\00"
@.str.3 = [40 x i8] c"main(){int i=4; i^=3; printf(\22%d\22, i);}\00"
define void @TEST_xor() {
%1 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"4\00"
@.str.1 = [27 x i8] c"main(){printf(\22%d\22, 7^3);}\00"
@.str.2 = [2 x i8] c"7\00"
@.str.3 = [40 x i8] c"main(){int i=4; i^=3; printf(\22%d\22, i);}\00"
define void @TEST_xor() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}
BOOST_AUTO_TEST_CASE(max) {
  TESTCASE2(max, 0, 0, 0);
  TESTCASE2(max, 0, 1, 1);
  TESTCASE2(max, 1, 0, 1);
  TESTCASE2(max, 1, 1, 1);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%ecx
xor    %edx,%edx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <TESTCASE2@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0, i32 0)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %6, i32 0, i32 1, i32 1)
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %8, i32 1, i32 0, i32 1)
%10 = load i32, i32* %3
%11 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %10, i32 1, i32 1, i32 1)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0, i32 0)
%3 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1, i32 1)
%4 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0, i32 1)
%5 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 1, i32 1)
ret i32 undef
}
/* Type definitions */
typedef int dev_t;

/* Variables and functions */
dev_t makedev(int maj, int min) { return ((maj & 0xFF) << 8) | (min & 0xFF); }


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

x86 assembly (clang, -O2):
<makedev>:
shl    $0x8,%edi
movzwl %di,%ecx
movzbl %sil,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @makedev(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 = and i32 %5, 255
%7 = shl i32 %6, 8
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @makedev(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = and i32 %3, 65280
%5 = and i32 %1, 255
%6 = or i32 %4, %5
ret i32 %6
}
int test_imm_1Euint16_reg(unsigned short val) {
  return ((val) & (-0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Euint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Euint16_reg>:
test   $0xffe2,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Euint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -30
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ console();
int /*<<< orphan*/ printf(char *, char *);
char *test_failure_str(int);
int /*<<< orphan*/ test_newline();
void console_failure(int reason) {
  printf("CPU failure: %s", test_failure_str(reason));
  test_newline();
  console();
}


x86 assembly (clang, -O0):
<console_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <test_failure_str@plt>
mov    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <test_newline@plt>
mov    $0x0,%al
call   1050 <console@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_failure>:
push   %rax
call   1040 <test_failure_str@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <test_newline@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <console@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"CPU failure: %s\00"
define void @console_failure(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @test_failure_str(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @test_newline()
%7 = call i32 (...) @console()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"CPU failure: %s\00"
define void @console_failure(i32 %0) {
%2 = tail call i8* @test_failure_str(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 (...) @test_newline()
%5 = tail call i32 (...) @console()
ret void
}
/* Variables and functions */
unsigned int dec(unsigned int);
unsigned int inc(unsigned int);
unsigned int add_recr(unsigned int a, unsigned int b) {
  if (a == 0) {
    return b;
  } else {
    return inc(add_recr(dec(a), b));
  }
}


x86 assembly (clang, -O0):
<add_recr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1153 <add_recr+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <add_recr+0x3f>
mov    -0x8(%rbp),%edi
call   1040 <dec@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <add_recr@plt>
mov    %eax,%edi
call   1050 <inc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_recr>:
push   %rbx
mov    %esi,%ebx
test   %edi,%edi
je     114d <add_recr+0x1d>
call   1040 <dec@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <add_recr@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <inc@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @add_recr(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %9, %6 ], [ %1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = tail call i32 @dec(i32 %0)
%8 = tail call i32 @add_recr(i32 %7, i32 %1)
%9 = tail call i32 @inc(i32 %8)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
extern void freelist(char **arglist) {
  char **cp = arglist;
  while (*cp)
    free(*cp++);
  free(arglist);
}


x86 assembly (clang, -O0):
<freelist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <freelist+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1124 <freelist+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freelist>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freelist+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freelist+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freelist(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = bitcast i8* %5 to i8**
%9 = tail call i32 @free(i8** %8)
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret void
}
int usb_port_resume(struct usb_device *udev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.usb_device = type opaque
define i32 @usb_port_resume(%struct.usb_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void do_help(void) {
  fprintf(stderr, "nartutor [-f dictionary] [-l level] [-d device]\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<do_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"nartutor [-f dictionary] [-l level] [-d device]\0A\00"
@EXIT_SUCCESS = global i32 0
define void @do_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"nartutor [-f dictionary] [-l level] [-d device]\0A\00"
@EXIT_SUCCESS = global i32 0
define void @do_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(float **);
void free_output_image(float **tabtabPixelsOutput) { free(tabtabPixelsOutput); }


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

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

LLVM IR (-O2):
define void @free_output_image(float** nocapture %0) {
%2 = tail call i32 @free(float** %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int /*<<< orphan*/ sumOfTwoEle(int *, int, int);
int main() {
  int A[] = {1, 3, 5, 7};
  int n = sizeof(A) / sizeof(A[0]);
  sumOfTwoEle(A, n, 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    $0x6,%edx
call   1030 <sumOfTwoEle@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x6,%edx
call   1030 <sumOfTwoEle@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [4 x i32] [i32 1, i32 3, i32 5, i32 7]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
store i32 4, i32* %3
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @sumOfTwoEle(i32* %5, i32 %6, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [4 x i32] [i32 1, i32 3, i32 5, i32 7]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @sumOfTwoEle(i32* %3, i32 4, i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main(void) {
  printf("%i\n", sum(3, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x2,%esi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sum(i32 3, i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 3, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int msm_rpm_send_request(struct msm_rpm_request *handle) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.msm_rpm_request = type opaque
define i32 @msm_rpm_send_request(%struct.msm_rpm_request* nocapture readnone %0) {
ret i32 0
}
float clampf(float a, float min_val, float max_val) {
  return (a < min_val ? min_val : (a > max_val ? max_val : a));
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clampf+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <clampf+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <clampf+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <clampf+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clampf(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 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
unsigned gcd(unsigned m, unsigned n) {
  if (m > n)
    return gcd(m - n, n);
  else if (m < n)
    return gcd(m, n - m);
  else
    return m;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1140 <gcd+0x30>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <gcd+0x58>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1162 <gcd+0x52>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <gcd+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
jmp    1110 <gcd+0x10>
sub    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
cmp    %esi,%eax
ja     1104 <gcd+0x4>
sub    %eax,%esi
ja     1110 <gcd+0x10>
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub i32 %10, %11
%13 = load i32, i32* %5
%14 = call i32 @gcd(i32 %12, i32 %13)
store i32 %14, i32* %3
br label %27
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp ult i32 %16, %17
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = sub i32 %21, %22
%24 = call i32 @gcd(i32 %20, i32 %23)
store i32 %24, i32* %3
br label %27
25: ; preds = %15
%26 = load i32, i32* %4
store i32 %26, i32* %3
br label %27
27: ; preds = %25, %19, %9
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %9, %7 ], [ %0, %2 ]
%5 = phi i32 [ %8, %7 ], [ %1, %2 ]
%6 = icmp ugt i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %13, %3
%8 = phi i32 [ %5, %3 ], [ %14, %13 ]
%9 = sub i32 %4, %8
br label %3
10: ; preds = %3, %13
%11 = phi i32 [ %14, %13 ], [ %5, %3 ]
%12 = icmp ugt i32 %11, %4
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = sub i32 %11, %4
%15 = icmp ugt i32 %4, %14
br i1 %15, label %7, label %10
16: ; preds = %10
ret i32 %4
}
void first(void) {
  int a = 10;
  return;
}


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

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

LLVM IR (-O0):
define void @first() {
%1 = alloca i32
store i32 10, i32* %1
ret void
}

LLVM IR (-O2):
define void @first() {
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_disable_wake_up_function(void) {
  char ctlreg_1 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1B, &ctlreg_1, 1) == 0) {
    ctlreg_1 &= ~0x02;
    KIONIX_ACCEL_write_byte(0x1B, ctlreg_1);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_disable_wake_up_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_disable_wake_up_function+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xfffffffd,%eax
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_disable_wake_up_function+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_disable_wake_up_function>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1b,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_disable_wake_up_function+0x41>
movsbl 0xf(%rsp),%esi
and    $0xfffffffd,%esi
mov    %sil,0xf(%rsp)
mov    $0x1b,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_disable_wake_up_function() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -3
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_disable_wake_up_function() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -3
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int8_t;
typedef int int16_t;

/* Variables and functions */
int16_t ld_i16_be(const void *x) {
  return ((((int16_t)(((int8_t *)x)[0])) << 8) |
          ((int16_t)(((uint8_t *)x)[1])));
}


x86 assembly (clang, -O0):
<ld_i16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_i16_be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ld_i16_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ld_i16_be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = or i32 %5, %9
ret i32 %10
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructNameString(struct constructHeader *);
const char *EnvGetDeftemplateName(void *theEnv, void *theDeftemplate) {
  return GetConstructNameString((struct constructHeader *)theDeftemplate);
}


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

x86 assembly (clang, -O2):
<EnvGetDeftemplateName>:
mov    %rsi,%rdi
jmp    1030 <GetConstructNameString@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDeftemplateName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.constructHeader*
%7 = call i8* @GetConstructNameString(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDeftemplateName(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructNameString(%struct.constructHeader* %3)
ret i8* %4
}
void lsm_proc_unmount(struct lxc_conf *lxc_conf) {}


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

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

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

LLVM IR (-O2):
%struct.lxc_conf = type opaque
define void @lsm_proc_unmount(%struct.lxc_conf* nocapture %0) {
ret void
}
void error(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @error(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mqtt_get_type(uint8_t *buffer) { return (buffer[0] & 0xf0) >> 4; }


x86 assembly (clang, -O0):
<mqtt_get_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf0,%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mqtt_get_type>:
mov    (%rdi),%eax
shr    $0x4,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @mqtt_get_type(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 240
%7 = ashr i32 %6, 4
ret i32 %7
}

LLVM IR (-O2):
define i32 @mqtt_get_type(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 4
%4 = and i32 %3, 15
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_mul_su32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_mul_su32(__m64 a, __m64 b) { return _mm_mul_su32(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_mul_su32>:
jmp    1030 <_mm_mul_su32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_mul_su32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mul_su32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int RAND_MAX;
int rand();
float random_unit(void) {
  return (((float)(rand() % (RAND_MAX)) / (float)(RAND_MAX)));
}


x86 assembly (clang, -O0):
<random_unit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2ss %edx,%xmm0
mov    0x2eb8(%rip),%rax
cvtsi2ssl (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_unit>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define float @random_unit() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = srem i32 %1, %2
%4 = sitofp i32 %3 to float
%5 = load i32, i32* @RAND_MAX
%6 = sitofp i32 %5 to float
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define float @random_unit() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = srem i32 %1, %2
%4 = sitofp i32 %3 to float
%5 = sitofp i32 %2 to float
%6 = fdiv float %4, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void scamper_tcp4_close(int fd) {
  close(fd);
  return;
}


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

x86 assembly (clang, -O2):
<scamper_tcp4_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @scamper_tcp4_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int cb_db(int n, char **p, void *closure) { return 0; }


x86 assembly (clang, -O0):
<cb_db>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cb_db(i32 %0, i8** nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
int stack_print() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @stack_print() {
ret i32 1
}