xunge/DecIR huggingface dataset:
/* Variables and functions */
double cos(double);
double sin(double);
double tan(double);
double f2(double x) { return (sin(x + 1.0) * cos(x - 1.0) / tan(x - 1.0)); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xebb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe78(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0xeba(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xea5(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <tan@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = call double @sin(double %4)
%6 = load double, double* %2
%7 = fsub double %6, 1.000000e+00
%8 = call double @cos(double %7)
%9 = fmul double %5, %8
%10 = load double, double* %2
%11 = fsub double %10, 1.000000e+00
%12 = call double @tan(double %11)
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @f2(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = tail call double @sin(double %2)
%4 = fadd double %0, -1.000000e+00
%5 = tail call double @cos(double %4)
%6 = fmul double %3, %5
%7 = tail call double @tan(double %4)
%8 = fdiv double %6, %7
ret double %8
}
int test_imm_CFuint16_reg(unsigned short val) {
  return ((val) & (-0xCF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CFuint16_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, -207
%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_CFuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -207
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xdestroywindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xdestroywindow_display(void *_p) {
  return (void *)((XEvent *)_p)->xdestroywindow.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xdestroywindow_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int myfunction(int arg1, int arg2) {
  int result = arg1 + arg2;
  return result;
}


x86 assembly (clang, -O0):
<myfunction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunction>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @myfunction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @myfunction(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double exp(double);
double newton_func(double *par, int x, void *fdata) {
  return par[0] + (par[1] - par[0]) * exp(-par[2] * x);
}


x86 assembly (clang, -O0):
<newton_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newton_func>:
sub    $0x18,%rsp
movsd  (%rdi),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rdi),%xmm2
movsd  0x10(%rdi),%xmm1
xorpd  0xed0(%rip),%xmm1
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @newton_func(double* %0, i32 %1, i8* %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i8*
store double* %0, double** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = fsub double %12, %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fneg double %19
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to double
%23 = fmul double %20, %22
%24 = call double @exp(double %23)
%25 = call double @llvm.fmuladd.f64(double %16, double %24, double %9)
ret double %25
}

LLVM IR (-O2):
define double @newton_func(double* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = load double, double* %0
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = fsub double %6, %4
%8 = getelementptr inbounds double, double* %0, i64 2
%9 = load double, double* %8
%10 = fneg double %9
%11 = sitofp i32 %1 to double
%12 = fmul double %11, %10
%13 = tail call double @exp(double %12)
%14 = tail call double @llvm.fmuladd.f64(double %7, double %13, double %4)
ret double %14
}
char cmple64(double x, double y) { return x <= y; }


x86 assembly (clang, -O0):
<cmple64>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmple64>:
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define signext i8 @cmple64(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @cmple64(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Type definitions */
struct trixHitPos {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trixHitPosFreeList(struct trixHitPos **);
void freeHitCallback(void *val) {
  struct trixHitPos *posList = val;
  trixHitPosFreeList(&posList);
}


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

x86 assembly (clang, -O2):
<freeHitCallback>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <trixHitPosFreeList@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.trixHitPos = type { i32 }
define void @freeHitCallback(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.trixHitPos*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.trixHitPos*
store %struct.trixHitPos* %5, %struct.trixHitPos** %3
%6 = call i32 @trixHitPosFreeList(%struct.trixHitPos** %3)
ret void
}

LLVM IR (-O2):
%struct.trixHitPos = type { i32 }
define void @freeHitCallback(i8* %0) {
%2 = alloca %struct.trixHitPos*
%3 = bitcast %struct.trixHitPos** %2 to i8*
%4 = bitcast %struct.trixHitPos** %2 to i8**
store i8* %0, i8** %4
%5 = call i32 @trixHitPosFreeList(%struct.trixHitPos** %2)
ret void
}
void glutMouseFunc(void (*func)(int button, int state, int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutMouseFunc(void (i32, i32, i32, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
void *malloc(long long);
int /*<<< orphan*/ sys_die(char *, long long);
extern void *mem_alloc(long long size) {
  void *p = malloc(size);
  if (p == NULL)
    sys_die("OOM: cannot allocate %lld, exiting\n", size);
  return p;
}


x86 assembly (clang, -O0):
<mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <mem_alloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <sys_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <mem_alloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <sys_die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"OOM: cannot allocate %lld, exiting\0A\00"
define i8* @mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @sys_die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [36 x i8] c"OOM: cannot allocate %lld, exiting\0A\00"
define noalias i8* @mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sys_die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void UART_SoilMoisture_Decagon_SaveConfig(void) {}


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

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

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

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

/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_uint_least32_t(uint_least32_t const k1,
                                                uint_least32_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_uint_least32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_uint_least32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_uint_least32_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rot13(char *);
scalar_t__ scanf(char *, char *);
void code(char c[1000]) {
  while (scanf("%1000s", c)) {
    rot13(c);
  }
}


x86 assembly (clang, -O0):
<code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     1154 <code+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <rot13@plt>
jmp    112c <code+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     1168 <code+0x48>
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <rot13@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jne    1150 <code+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%1000s\00"
define void @code(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = call i32 @rot13(i8* %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%1000s\00"
define void @code(i8* %0) {
%2 = tail call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 @rot13(i8* %0)
%6 = tail call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int errno;
char *strerror(int);
int /*<<< orphan*/ u_log(int, char *, char const *, char const *, char *);
void u_perror_real(const char *func, const char *s) {
  int x = errno;
  char *error = strerror(x);
  u_log(1, "%s: %s: %s", func, s, error);
}


x86 assembly (clang, -O0):
<u_perror_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%edi
lea    0xea0(%rip),%rsi
call   1030 <u_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_perror_real>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <u_log@plt>

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

LLVM IR (-O2):
@errno = global i32 0
@.str = [11 x i8] c"%s: %s: %s\00"
define void @u_perror_real(i8* %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @u_log(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %4)
ret void
}
int main(int argc, char **argv) {
  int x;
  double r = argc;
  if (0 > r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1136 <main+0x36>
movl   $0x7,-0x14(%rbp)
jmp    113d <main+0x3d>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x7,%ecx
mov    $0x2a,%eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
store double %9, double* %7
%10 = load double, double* %7
%11 = fcmp ogt double 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 7, i32 42
ret i32 %4
}
float ClampCvar(float min, float max, float value) {
  if (value < min) {
    return min;
  }
  if (value > max) {
    return max;
  }
  return value;
}


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

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

LLVM IR (-O0):
define float @ClampCvar(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %7
%9 = load float, float* %5
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %5
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %7
%15 = load float, float* %6
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %6
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %7
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @ClampCvar(float %0, float %1, float %2) {
%4 = fcmp olt float %2, %0
%5 = fcmp ogt float %2, %1
%6 = select i1 %5, float %1, float %2
%7 = select i1 %4, float %0, float %6
ret float %7
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ mzero(void *, size_t);
void *malloc_mem(size_t size) {
  void *p = malloc(size);
  if (NULL != p) {
    mzero(p, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<malloc_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1152 <malloc_mem+0x32>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <mzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_mem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <malloc_mem+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <mzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @malloc_mem(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* null, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @mzero(i8* %9, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @malloc_mem(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @mzero(i8* %2, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int my_dest_n_len(char *str) {
  int i = 0;
  while (str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_dest_n_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_dest_n_len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_dest_n_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_dest_n_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_dest_n_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_dest_n_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
double mbps(int64_t n, int64_t usec) {
  double mbytes = ((double)n) / (1024.0 * 1024.0);
  double seconds = ((double)usec) / 1000000.0;
  return mbytes / seconds;
}


x86 assembly (clang, -O0):
<mbps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbps>:
cvtsi2sd %rdi,%xmm0
mulsd  0xef3(%rip),%xmm0
cvtsi2sd %rsi,%xmm1
divsd  0xeee(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mbps(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
%6 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 0x4130000000000000
store double %9, double* %5
%10 = load i64, i64* %4
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+06
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fdiv double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @mbps(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = fmul double %3, 0x3EB0000000000000
%5 = sitofp i64 %1 to double
%6 = fdiv double %5, 1.000000e+06
%7 = fdiv double %4, %6
ret double %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBClockEnable(uint32_t ui32Base, uint32_t ui32Div, uint32_t ui32Flags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) = (ui32Div - 1) | ui32Flags;
}


x86 assembly (clang, -O0):
<USBClockEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
or     -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBClockEnable>:
add    $0xffffffff,%esi
or     %edx,%esi
movslq %edi,%rax
mov    %esi,0xfc8(%rax)
ret

LLVM IR (-O0):
define void @USBClockEnable(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* %5
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %6
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 4040
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %10, i32* %14
ret void
}

LLVM IR (-O2):
define void @USBClockEnable(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = or i32 %4, %2
%6 = add nsw i32 %0, 4040
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
ret void
}
int test(int n, int m) {
  if (n < (-5 - (unsigned)m)) {
    if (m < (int)(-5 - (unsigned)n)) {
      return n;
    } else
      return n + m;
  } else {
    return m;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xfffffffb,%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jae    1149 <test+0x49>
mov    -0xc(%rbp),%eax
mov    $0xfffffffb,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    113b <test+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <test+0x4f>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <test+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xfffffffb,%ecx
mov    $0xfffffffb,%edx
sub    %esi,%edx
sub    %edi,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
cmovle %esi,%eax
add    %edi,%eax
cmp    %edi,%edx
cmovbe %esi,%eax
ret

LLVM IR (-O0):
define i32 @test(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 = sub i32 -5, %7
%9 = icmp ult i32 %6, %8
br i1 %9, label %10, label %21
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub i32 -5, %12
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i32, i32* %4
store i32 %16, i32* %3
br label %23
17: ; preds = %10
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = add nsw i32 %18, %19
store i32 %20, i32* %3
br label %23
21: ; preds = %2
%22 = load i32, i32* %5
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %17, %15
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = sub i32 -5, %1
%4 = icmp ugt i32 %3, %0
%5 = sub i32 -5, %0
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 0, i32 %1
%8 = add nsw i32 %7, %0
%9 = select i1 %4, i32 %8, i32 %1
ret i32 %9
}
/* Variables and functions */
scalar_t__ lrand48();
void random_array(unsigned *val, int n) {
  int i;
  for (i = 0; i < n; i++) {
    val[i] = (unsigned)lrand48() & (unsigned)((1 << 29) - 1);
  }
}


x86 assembly (clang, -O0):
<random_array>:
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    115a <random_array+0x4a>
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    %eax,%edx
and    $0x1fffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <random_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <random_array+0x39>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <lrand48@plt>
and    $0x1fffffff,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i64 (...) @lrand48()
%12 = trunc i64 %11 to i32
%13 = and i32 %12, 536870911
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %10
%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):
define void @random_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = tail call i64 (...) @lrand48()
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 536870911
%11 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %10, i32* %11
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
void SIO1_writeData8(unsigned char val) {}


x86 assembly (clang, -O0):
<SIO1_writeData8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SIO1_writeData8(i8 zeroext %0) {
ret void
}
void avformat_open_input() {}


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

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

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

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

/* Variables and functions */
int searchKey(int);
int buscaIdEspecie(FILE *arquivo, int id) {
  char leitura[10];
  short size;
  int id_busca;
  int offset = 0;
  if ((offset = searchKey(id)) != -1) {
    return offset;
  }
  return -1;
}


x86 assembly (clang, -O0):
<buscaIdEspecie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <searchKey@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
je     1145 <buscaIdEspecie+0x35>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <buscaIdEspecie+0x3c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buscaIdEspecie>:
mov    %esi,%edi
jmp    1030 <searchKey@plt>

LLVM IR (-O0):
define i32 @buscaIdEspecie(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [10 x i8]
%7 = alloca i16
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = call i32 @searchKey(i32 %10)
store i32 %11, i32* %9
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %9
store i32 %14, i32* %3
br label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @buscaIdEspecie(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @searchKey(i32 %1)
ret i32 %3
}
/* Variables and functions */
long long MaxDistance();
long long Identifier(long long i) {
  return i + 2 * MaxDistance() - 2 * (i % MaxDistance());
}


x86 assembly (clang, -O0):
<Identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <MaxDistance@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <MaxDistance@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
mov    -0x10(%rbp),%rax
shl    $0x1,%rdx
sub    %rdx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Identifier>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <MaxDistance@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <MaxDistance@plt>
mov    %rax,%rcx
or     %r14,%rax
shr    $0x20,%rax
je     113e <Identifier+0x2e>
mov    %r14,%rax
cqto
idiv   %rcx
jmp    1145 <Identifier+0x35>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
sub    %rdx,%rbx
lea    (%r14,%rbx,2),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @Identifier(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @MaxDistance()
%5 = mul nsw i64 2, %4
%6 = add nsw i64 %3, %5
%7 = load i64, i64* %2
%8 = call i64 (...) @MaxDistance()
%9 = srem i64 %7, %8
%10 = mul nsw i64 2, %9
%11 = sub nsw i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @Identifier(i64 %0) {
%2 = tail call i64 (...) @MaxDistance()
%3 = tail call i64 (...) @MaxDistance()
%4 = srem i64 %0, %3
%5 = sub i64 %2, %4
%6 = shl i64 %5, 1
%7 = add i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int close(int);
int cf_pipe_close(int fd) { return close(fd); }


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

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

LLVM IR (-O2):
define i32 @cf_pipe_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ srandom(int);
void init_random(void) {
  clockid_t clock = CLOCK_MONOTONIC;
  struct timespec ts;
  clock_gettime(clock, &ts);
  srandom((int)ts.tv_sec + (int)ts.tv_nsec);
}


x86 assembly (clang, -O0):
<init_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x18(%rbp),%rax
add    %eax,%edi
call   1030 <srandom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_random>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%edi
add    0x10(%rsp),%edi
call   1030 <srandom@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define void @init_random() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %8, %11
%13 = call i32 @srandom(i32 %12)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define void @init_random() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = bitcast %struct.timespec* %1 to i8*
%4 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %10, %7
%12 = call i32 @srandom(i32 %11)
ret void
}
void s5p6442_default_sdhci1(void) {}


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

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

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

LLVM IR (-O2):
define void @s5p6442_default_sdhci1() {
ret void
}
/* Variables and functions */
unsigned int __native_ctz(unsigned int);
unsigned char __builtin_BitScanForward(unsigned long *index,
                                       unsigned long mask) {
  unsigned int trailing_zeros;
  trailing_zeros = __native_ctz((unsigned int)mask);
  *index = trailing_zeros;
  return (unsigned char)(mask != 0);
}


x86 assembly (clang, -O0):
<__builtin_BitScanForward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <__native_ctz@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__builtin_BitScanForward>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %ebx,%edi
call   1030 <__native_ctz@plt>
mov    %eax,%eax
mov    %rax,(%r14)
test   %rbx,%rbx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i8 @__builtin_BitScanForward(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i32
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = call i32 @__native_ctz(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = load i64*, i64** %3
store i64 %10, i64* %11
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @__builtin_BitScanForward(i64* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @__native_ctz(i32 %3)
%5 = zext i32 %4 to i64
store i64 %5, i64* %0
%6 = icmp ne i64 %1, 0
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ z_ms_print(struct timeval *);
void z_now_ms_print() {
  struct timeval t;
  gettimeofday(&t, NULL);
  z_ms_print(&t);
}


x86 assembly (clang, -O0):
<z_now_ms_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
lea    -0x8(%rbp),%rdi
call   1030 <z_ms_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_now_ms_print>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <z_ms_print@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @z_now_ms_print() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = call i32 @z_ms_print(%struct.timeval* %1)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @z_now_ms_print() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = call i32 @z_ms_print(%struct.timeval* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terror(char *);
void assertIntEQ(int a, int b, char *msg) {
  if (a != b) {
    terror(msg);
  }
}


x86 assembly (clang, -O0):
<assertIntEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1137 <assertIntEQ+0x27>
mov    -0x10(%rbp),%rdi
call   1030 <terror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertIntEQ>:
cmp    %esi,%edi
jne    1115 <assertIntEQ+0x5>
ret
mov    %rdx,%rdi
jmp    1030 <terror@plt>

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

LLVM IR (-O2):
define void @assertIntEQ(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @terror(i8* %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
char *fcla_bin_to_hex(unsigned char *, int);
int /*<<< orphan*/ free(unsigned char *);
unsigned char *hmac_sha256(void *, int /*<<< orphan*/, char *);
char *hmac_sha256_hex(void *key, ssize_t klen, char *data) {
  unsigned char *sha = hmac_sha256(key, klen, data);
  char *hex = fcla_bin_to_hex(sha, 32);
  free(sha);
  return hex;
}


x86 assembly (clang, -O0):
<hmac_sha256_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <hmac_sha256@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   1050 <fcla_bin_to_hex@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac_sha256_hex>:
push   %r14
push   %rbx
push   %rax
call   1040 <hmac_sha256@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x20,%esi
call   1050 <fcla_bin_to_hex@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @hmac_sha256_hex(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i8* @hmac_sha256(i8* %9, i32 %10, i8* %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = call i8* @fcla_bin_to_hex(i8* %13, i32 32)
store i8* %14, i8** %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %8
ret i8* %17
}

LLVM IR (-O2):
define i8* @hmac_sha256_hex(i8* %0, i32 %1, i8* %2) {
%4 = tail call i8* @hmac_sha256(i8* %0, i32 %1, i8* %2)
%5 = tail call i8* @fcla_bin_to_hex(i8* %4, i32 32)
%6 = tail call i32 @free(i8* %4)
ret i8* %5
}
int kernighan(int a) {
  int r = 0;
  for (; a > 0; a &= a - 1)
    r++;
  return r;
}


x86 assembly (clang, -O0):
<kernighan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <kernighan+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <kernighan+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernighan>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <kernighan+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <kernighan+0x10>
ret

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

LLVM IR (-O2):
define i32 @kernighan(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Type definitions */
typedef char const int16_t;

/* Variables and functions */
int16_t get_sint16(const char *buf) {
  return (buf[1] & 0xff) << 8 | (buf[0] & 0xff);
}


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

x86 assembly (clang, -O2):
<get_sint16>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @get_sint16(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
int test_imm_39uint8_mem(unsigned char *val) {
  return ((*val) & (-0x39 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_39uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -57
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}