xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int /*<<< orphan*/ assert(int);
int fcntl(int, int /*<<< orphan*/, int);
void set_nonblock(int fd) {
  int fl;
  fl = fcntl(fd, F_GETFL, 0);
  assert(fl != -1);
  fl = fcntl(fd, F_SETFL, fl | O_NONBLOCK);
  assert(fl != -1);
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e80(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
call   1040 <assert@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    0x2e93(%rip),%rax
or     (%rax),%ebp
mov    %ebx,%edi
mov    %ebp,%edx
call   1030 <fcntl@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <assert@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %13, %14
%16 = call i32 @fcntl(i32 %11, i32 %12, i32 %15)
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, -1
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* @F_SETFL
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %8, %3
%10 = tail call i32 @fcntl(i32 %0, i32 %7, i32 %9)
%11 = icmp ne i32 %10, -1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double get_time() {
  struct timeval t;
  struct timezone tzp;
  gettimeofday(&t, &tzp);
  return t.tv_sec + t.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
%struct.timezone = type { i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
%struct.timezone = type { i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
void get_map(char *s, int *map) {
  int i;
  for (i = 0; i < 13 * 15; i++) {
    sscanf(s, "%d", &map[i]);
    s += 2;
  }
}


x86 assembly (clang, -O0):
<get_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xc3,-0x14(%rbp)
jge    116d <get_map+0x5d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xeb2(%rip),%rsi
call   1030 <sscanf@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <get_map+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_map>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed9(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    (%r14,%rbx,1),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
add    $0x4,%r12
add    $0x2,%rbx
cmp    $0x186,%rbx
jne    1130 <get_map+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @get_map(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 195
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8* %17, i8** %3
br label %18
18: ; preds = %9
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @get_map(i8* nocapture %0, i32* %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i32, i32* %1, i64 %4
%7 = tail call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = getelementptr inbounds i8, i8* %5, i64 2
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 195
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
int sched_clock_suspend(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sched_clock_suspend() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sched_clock_suspend() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 101;
  if (i < 100) {
    printf("lesser!\n");
  } else {
    printf("Greater!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x65,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x3d>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"lesser!\0A\00"
@.str.1 = [10 x i8] c"Greater!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 101, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"Greater!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double pow(double, int);
double albedoModel(double a, double theta) {
  double x1, x2;
  x1 = 0.06 * (pow(theta / 0.7853982, 3));
  x2 = 0.25 * (pow(theta / 1.5707963, 8));
  return (a + x1 + x2);
}


x86 assembly (clang, -O0):
<albedoModel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee9(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x8,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<albedoModel>:
sub    $0x18,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
divsd  0xed5(%rip),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
mulsd  0xecb(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
divsd  0xec0(%rip),%xmm0
mov    $0x8,%edi
call   1030 <pow@plt>
mulsd  0xeb6(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @albedoModel(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = fdiv double %7, 0x3FE921FB67EACAE5
%9 = call double @pow(double %8, i32 3)
%10 = fmul double 6.000000e-02, %9
store double %10, double* %5
%11 = load double, double* %4
%12 = fdiv double %11, 0x3FF921FB4D12D84A
%13 = call double @pow(double %12, i32 8)
%14 = fmul double 2.500000e-01, %13
store double %14, double* %6
%15 = load double, double* %3
%16 = load double, double* %5
%17 = fadd double %15, %16
%18 = load double, double* %6
%19 = fadd double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @albedoModel(double %0, double %1) {
%3 = fdiv double %1, 0x3FE921FB67EACAE5
%4 = tail call double @pow(double %3, i32 3)
%5 = fmul double %4, 6.000000e-02
%6 = fdiv double %1, 0x3FF921FB4D12D84A
%7 = tail call double @pow(double %6, i32 8)
%8 = fmul double %7, 2.500000e-01
%9 = fadd double %5, %0
%10 = fadd double %9, %8
ret double %10
}
int get_len() { return 37; }


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

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

LLVM IR (-O0):
define i32 @get_len() {
ret i32 37
}

LLVM IR (-O2):
define i32 @get_len() {
ret i32 37
}
void upcrt_proc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @upcrt_proc_init() {
ret void
}
/* Type definitions */
typedef scalar_t__ mqd_t;

/* Variables and functions */
int mq_close(scalar_t__);
void test_mq_close_prototype(void) {
  mqd_t mqdes;
  int err;
  mqdes = 0;
  err = mq_close(mqdes);
  (void)err;
}


x86 assembly (clang, -O0):
<test_mq_close_prototype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mq_close@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_mq_close_prototype() {
%1 = alloca i64
%2 = alloca i32
store i64 0, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @mq_close(i64 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
define void @test_mq_close_prototype() {
%1 = tail call i32 @mq_close(i64 0)
ret void
}
int do_760() { return 760; }


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

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

LLVM IR (-O0):
define i32 @do_760() {
ret i32 760
}

LLVM IR (-O2):
define i32 @do_760() {
ret i32 760
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_function(const void *a, const void *b) {
  return (strcmp((char *)a, (char *)b));
}


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

x86 assembly (clang, -O2):
<compare_function>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_function(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void wideLeftShift(unsigned *hi, unsigned *lo, int count) {
  *hi = *hi << count | *lo >> ((sizeof(unsigned) * 8) - count);
  *lo = *lo << count;
}


x86 assembly (clang, -O0):
<wideLeftShift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
movslq -0x14(%rbp),%rdx
mov    $0x20,%ecx
sub    %rdx,%rcx
shr    %cl,%eax
mov    -0x18(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wideLeftShift>:
mov    %edx,%ecx
mov    (%rsi),%eax
shld   %cl,%eax,(%rdi)
shll   %cl,(%rsi)
ret

LLVM IR (-O0):
define void @wideLeftShift(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* %7
%9 = load i32, i32* %6
%10 = shl i32 %8, %9
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = sub i64 32, %14
%16 = trunc i64 %15 to i32
%17 = lshr i32 %12, %16
%18 = or i32 %10, %17
%19 = load i32*, i32** %4
store i32 %18, i32* %19
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = load i32, i32* %6
%23 = shl i32 %21, %22
%24 = load i32*, i32** %5
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @wideLeftShift(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = shl i32 %4, %2
%6 = load i32, i32* %1
%7 = sub i32 32, %2
%8 = lshr i32 %6, %7
%9 = or i32 %8, %5
store i32 %9, i32* %0
%10 = load i32, i32* %1
%11 = shl i32 %10, %2
store i32 %11, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ r4030_delay();
void r4030_write_reg32(unsigned long addr, unsigned val) {
  *((volatile unsigned int *)addr) = val;
  r4030_delay();
}


x86 assembly (clang, -O0):
<r4030_write_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <r4030_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4030_write_reg32>:
mov    %esi,(%rdi)
xor    %eax,%eax
jmp    1030 <r4030_delay@plt>

LLVM IR (-O0):
define void @r4030_write_reg32(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
%8 = call i32 (...) @r4030_delay()
ret void
}

LLVM IR (-O2):
define void @r4030_write_reg32(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
%4 = tail call i32 (...) @r4030_delay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void status_exit(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @status_exit() {
%1 = tail call i32 (...) @closelog()
ret void
}
int test_imm_FBint8_reg(signed char val) {
  return ((val) & (0xFB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FBint8_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, 251
%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_FBint8_reg(i8 signext %0) {
%2 = and i8 %0, -5
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int camera_init() {}


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

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

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

LLVM IR (-O2):
define i32 @camera_init() {
ret i32 undef
}
float modff(float x, float *y) {
  *y = (long)x;
  return (x - *y);
}


x86 assembly (clang, -O0):
<modff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modff>:
cvttss2si %xmm0,%rax
cvtsi2ss %rax,%xmm1
movss  %xmm1,(%rdi)
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @modff(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = fptosi float %5 to i64
%7 = sitofp i64 %6 to float
%8 = load float*, float** %4
store float %7, float* %8
%9 = load float, float* %3
%10 = load float*, float** %4
%11 = load float, float* %10
%12 = fsub float %9, %11
ret float %12
}

LLVM IR (-O2):
define float @modff(float %0, float* nocapture writeonly %1) {
%3 = fptosi float %0 to i64
%4 = sitofp i64 %3 to float
store float %4, float* %1
%5 = fsub float %0, %4
ret float %5
}
void ADC_DelSig_1_ISR3(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_DelSig_1_ISR3() {
ret void
}
void VecAdd3fv(float v[3], const float a[3], const float b[3]) {
  v[0] = a[0] + b[0];
  v[1] = a[1] + b[1];
  v[2] = a[2] + b[2];
}


x86 assembly (clang, -O0):
<VecAdd3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecAdd3fv>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @VecAdd3fv(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** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @VecAdd3fv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
void clean_malloc() {}


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

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

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

LLVM IR (-O2):
define void @clean_malloc() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ numbers;

/* Variables and functions */
int /*<<< orphan*/ radixSort(int *, int);
int main(int argc, const char *argv[]) {
  int numbers[] = {328, 989, 45, 234, 23,   65,   98,
                   908, 543, 87, 98,  8675, 4353, 765};
  int size = sizeof(numbers) / sizeof(int);
  radixSort(numbers, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
movl   $0xe,-0x54(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   1030 <radixSort@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xe,%esi
call   1030 <radixSort@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.numbers = [14 x i32] [i32 328, i32 989, i32 45, i32 234, i32 23, i32 65, i32 98, i32 908, i32 543, i32 87, i32 98, i32 8675, i32 4353, i32 765]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [14 x i32]* %6 to i8*
store i32 14, i32* %7
%9 = getelementptr inbounds [14 x i32], [14 x i32]* %6, i64 0, i64 0
%10 = load i32, i32* %7
%11 = call i32 @radixSort(i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.numbers = [14 x i32] [i32 328, i32 989, i32 45, i32 234, i32 23, i32 65, i32 98, i32 908, i32 543, i32 87, i32 98, i32 8675, i32 4353, i32 765]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i32]
%4 = bitcast [14 x i32]* %3 to i8*
%5 = getelementptr inbounds [14 x i32], [14 x i32]* %3, i64 0, i64 0
%6 = call i32 @radixSort(i32* %5, i32 14)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t pow2(uint8_t x) { return x * x; }


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

x86 assembly (clang, -O2):
<pow2>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int fibonacci(unsigned int pPosition) {
  if (!pPosition) {
    return 0;
  }
  if (pPosition == 1) {
    return 1;
  }
  return (fibonacci(pPosition - 1) + fibonacci(pPosition - 2));
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add i32 %4, -1
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ SYS_getpid;
int /*<<< orphan*/ printf(char *, int);
int syscall(int /*<<< orphan*/);
int main() {
  int id = syscall(SYS_getpid);
  printf("getpid: %d\n", id);
  return 42;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_getpid = global i32 0
@.str = [12 x i8] c"getpid: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @SYS_getpid
%4 = call i32 @syscall(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 42
}

LLVM IR (-O2):
@SYS_getpid = global i32 0
@.str = [12 x i8] c"getpid: %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @SYS_getpid
%2 = tail call i32 @syscall(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 42
}
/* Variables and functions */
char ConvertColorToStorage(char);
void ConvertColorsToStorage(char *colors, int length) {
  int i;
  for (i = 0; i < length; i++) {
    colors[i] = ConvertColorToStorage(colors[i]);
  }
}


x86 assembly (clang, -O0):
<ConvertColorsToStorage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <ConvertColorsToStorage+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ConvertColorToStorage@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ConvertColorsToStorage+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertColorsToStorage>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <ConvertColorsToStorage+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <ConvertColorToStorage@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <ConvertColorsToStorage+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ConvertColorsToStorage(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @ConvertColorToStorage(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void __asan_report_load_n() {}


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

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

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

LLVM IR (-O2):
define void @__asan_report_load_n() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_wildcard(void) {
  printf("\nit support tilda '~' expansion ,'*' expansion,and  $' expansion");
  printf("\nfor any problem contact amrit kumar at amritkrs@gmail.com\n");
}


x86 assembly (clang, -O0):
<help_wildcard>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_wildcard>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"\0Ait support tilda '~' expansion ,'*' expansion,and $' expansion\00"
@.str.1 = [60 x i8] c"\0Afor any problem contact amrit kumar at amritkrs@gmail.com\0A\00"
define void @help_wildcard() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"\0Ait support tilda '~' expansion ,'*' expansion,and $' expansion\00"
@str = [59 x i8] c"\0Afor any problem contact amrit kumar at amritkrs@gmail.com\00"
define void @help_wildcard() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fprintf(stderr,
          "%s [-t] [-v] [-b] [-g] [-s] [-a] [-2] [-5] [-q MAX_OFFSET] [-w "
          "MIN_SIZE] [-m MAX_SIZE]\n"
          "\t-t:\tACT test\n"
          "\t-v:\tACT verify\n"
          "\t-b:\tACT benchmark\n"
          "\t-g:\tARCH generic\n"
          "\t-s:\tARCH SSE\n"
          "\t-a:\tARCH AVX\n"
          "\t-2:\tARCH AVX2\n"
          "\t-5:\tARCH AVX512\n"
          "\t-q MAX_OFFSET:\tverify offset(0-MAX_OFFSET) default:63\n"
          "\t-w MIN_SIZE:\tverify size range MIN, default:1\n"
          "\t-m MAX_SIZE:\tverify size range MAX, default:2047\n",
          prog);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [367 x i8] c"%s [-t] [-v] [-b] [-g] [-s] [-a] [-2] [-5] [-q MAX_OFFSET] [-w MIN_SIZE] [-m MAX_SIZE]\0A\09-t:\09ACT test\0A\09-v:\09ACT verify\0A\09-b:\09ACT benchmark\0A\09-g:\09ARCH generic\0A\09-s:\09ARCH SSE\0A\09-a:\09ARCH AVX\0A\09-2:\09ARCH AVX2\0A\09-5:\09ARCH AVX512\0A\09-q MAX_OFFSET:\09verify offset(0-MAX_OFFSET) default:63\0A\09-w MIN_SIZE:\09verify size range MIN, default:1\0A\09-m MAX_SIZE:\09verify size range MAX, default:2047\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([367 x i8], [367 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [367 x i8] c"%s [-t] [-v] [-b] [-g] [-s] [-a] [-2] [-5] [-q MAX_OFFSET] [-w MIN_SIZE] [-m MAX_SIZE]\0A\09-t:\09ACT test\0A\09-v:\09ACT verify\0A\09-b:\09ACT benchmark\0A\09-g:\09ARCH generic\0A\09-s:\09ARCH SSE\0A\09-a:\09ARCH AVX\0A\09-2:\09ARCH AVX2\0A\09-5:\09ARCH AVX512\0A\09-q MAX_OFFSET:\09verify offset(0-MAX_OFFSET) default:63\0A\09-w MIN_SIZE:\09verify size range MIN, default:1\0A\09-m MAX_SIZE:\09verify size range MAX, default:2047\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([367 x i8], [367 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void print_version(void) { fprintf(stderr, "%s %s\n", "diffbin", "1.0"); }


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xedc(%rip),%rdx
lea    0xedd(%rip),%rcx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xee0(%rip),%rdx
lea    0xee1(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [8 x i8] c"diffbin\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @print_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [8 x i8] c"diffbin\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @print_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int test_imm_18uint32_mem(unsigned int *val) {
  return ((*val) & (0x18 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_18uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 24
%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_18uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 24
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *_sbrk(int);
int munmap(void *start, int length) {
  if (_sbrk(-length) == ((void *)-1))
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %edi,%edi
sub    -0x14(%rbp),%edi
call   1030 <_sbrk@plt>
mov    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jne    1145 <munmap+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <munmap+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munmap>:
push   %rax
mov    %esi,%edi
neg    %edi
call   1030 <_sbrk@plt>
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @munmap(i8* nocapture readnone %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i8* @_sbrk(i32 %3)
%5 = icmp eq i8* %4, inttoptr (i64 -1 to i8*)
%6 = sext i1 %5 to i32
ret i32 %6
}
int _ht_cmp_int(void *d1, void *d2) {
  int i1 = *(int *)d1;
  int i2 = *(int *)d2;
  int i = i1 - i2;
  int result = 0;
  if (i < 0)
    result = -1;
  else if (i > 0)
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<_ht_cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1144 <_ht_cmp_int+0x44>
movl   $0xffffffff,-0x20(%rbp)
jmp    115a <_ht_cmp_int+0x5a>
cmpl   $0x0,-0x1c(%rbp)
jle    1155 <_ht_cmp_int+0x55>
movl   $0x1,-0x20(%rbp)
jmp    115a <_ht_cmp_int+0x5a>
mov    -0x20(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_ht_cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = icmp sgt i32 %7, -1
%11 = select i1 %10, i32 %9, i32 -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void scamper_tcp6_close(int fd) {
  close(fd);
  return;
}


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

LLVM IR (-O0):
define void @scamper_tcp6_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_tcp6_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int _binarySearch(int *, int /*<<< orphan*/, int, int);
int binarySearch(int *A, int size, int val) {
  return _binarySearch(A, 0, size - 1, val);
}


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

x86 assembly (clang, -O2):
<binarySearch>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <_binarySearch@plt>

LLVM IR (-O0):
define i32 @binarySearch(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 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @_binarySearch(i32* %7, i32 0, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @binarySearch(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @_binarySearch(i32* %0, i32 0, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
float __nv_fmaxf(float, float);
float fmaxf(float __a, float __b) { return __nv_fmaxf(__a, __b); }


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

x86 assembly (clang, -O2):
<fmaxf>:
jmp    1030 <__nv_fmaxf@plt>

LLVM IR (-O0):
define float @fmaxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__nv_fmaxf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @fmaxf(float %0, float %1) {
%3 = tail call float @__nv_fmaxf(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *wcsrchr(const wchar_t *haystack, wchar_t needle) {
  wchar_t *found = NULL;
  while (*haystack) {
    if (*haystack == needle)
      found = (wchar_t *)haystack;
    haystack++;
  }
  return found;
}


x86 assembly (clang, -O0):
<wcsrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <wcsrchr+0x4c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    113b <wcsrchr+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <wcsrchr+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsrchr>:
mov    (%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1124 <wcsrchr+0x24>
nopw   0x0(%rax,%rax,1)
cmp    %rsi,%rcx
cmove  %rdi,%rax
mov    0x8(%rdi),%rcx
add    $0x8,%rdi
test   %rcx,%rcx
jne    1110 <wcsrchr+0x10>
ret

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

LLVM IR (-O2):
define i64* @wcsrchr(i64* %0, i64 %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ %3, %2 ]
%7 = phi i64* [ %10, %5 ], [ null, %2 ]
%8 = phi i64* [ %11, %5 ], [ %0, %2 ]
%9 = icmp eq i64 %6, %1
%10 = select i1 %9, i64* %8, i64* %7
%11 = getelementptr inbounds i64, i64* %8, i64 1
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i64* [ null, %2 ], [ %10, %5 ]
ret i64* %15
}
int __infer_nondet_int() {
  int ret;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @__infer_nondet_int() {
ret i32 undef
}