xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void read_sweep_vars(char *Result, char *data) {
  strcpy(Result, data);
  if (Result[(int)strlen(Result) - 1] == ']') {
    Result[(int)strlen(Result) - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<read_sweep_vars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
jne    118a <read_sweep_vars+0x6a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sweep_vars>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmpb   $0x5d,(%rbx,%rax,1)
jne    1140 <read_sweep_vars+0x20>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @read_sweep_vars(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 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = trunc i64 %10 to i32
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %8, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 93
br i1 %17, label %18, label %26
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = load i8*, i8** %3
%21 = call i64 @strlen(i8* %20)
%22 = trunc i64 %21 to i32
%23 = sub nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %19, i64 %24
store i8 0, i8* %25
br label %26
26: ; preds = %18, %2
ret void
}

LLVM IR (-O2):
define void @read_sweep_vars(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = shl i64 %4, 32
%6 = add i64 %5, -4294967296
%7 = ashr exact i64 %6, 32
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 93
br i1 %10, label %11, label %12
11: ; preds = %2
store i8 0, i8* %8
br label %12
12: ; preds = %11, %2
ret void
}
unsigned long clk_get_rate(struct clk *c) { return 48000000; }


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define i64 @clk_get_rate(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
ret i64 48000000
}

LLVM IR (-O2):
%struct.clk = type opaque
define i64 @clk_get_rate(%struct.clk* nocapture readnone %0) {
ret i64 48000000
}
/* Variables and functions */
int /*<<< orphan*/ os_freakout();
int os_signal(int, int *);
int raise(int sig) {
  int rc;
  if (os_signal(sig, &rc) == -1)
    os_freakout();
  return rc;
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <os_signal@plt>
cmp    $0xffffffff,%eax
jne    1147 <raise+0x27>
mov    $0x0,%al
call   1040 <os_freakout@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <os_signal@plt>
cmp    $0xffffffff,%eax
jne    1137 <raise+0x17>
xor    %eax,%eax
call   1040 <os_freakout@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @os_signal(i32 %4, i32* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @os_freakout()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @os_signal(i32 %0, i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @os_freakout()
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}
/* Variables and functions */
double arcsec(double);
double aoffsec(double n, int offset) {
  return arcsec(n) + 2 * 3.14159265358979323846 * offset;
}


x86 assembly (clang, -O0):
<aoffsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <arcsec@plt>
movaps %xmm0,%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xec6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aoffsec>:
push   %rbx
mov    %edi,%ebx
call   1030 <arcsec@plt>
cvtsi2sd %ebx,%xmm1
mulsd  0xedc(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @aoffsec(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = call double @arcsec(double %5)
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double 0x401921FB54442D18, double %8, double %6)
ret double %9
}

LLVM IR (-O2):
define double @aoffsec(double %0, i32 %1) {
%3 = tail call double @arcsec(double %0)
%4 = sitofp i32 %1 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0x401921FB54442D18, double %3)
ret double %5
}
int between(float f, float g, float h) {
  if ((f == g) || (g == h))
    return (0);
  return ((f < g) ? (g < h ? 1 : -1) : (h < g ? 1 : -1));
}


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    112d <between+0x2d>
jp     112d <between+0x2d>
jmp    1142 <between+0x42>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    114e <between+0x4e>
jp     114e <between+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <between+0xa6>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1183 <between+0x83>
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    11a0 <between+0xa0>
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<between>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
jne    1109 <between+0x9>
jnp    112c <between+0x2c>
ucomiss %xmm2,%xmm1
jne    1110 <between+0x10>
jnp    112c <between+0x2c>
xor    %eax,%eax
ucomiss %xmm1,%xmm2
seta   %al
xor    %ecx,%ecx
ucomiss %xmm2,%xmm1
seta   %cl
ucomiss %xmm0,%xmm1
cmova  %eax,%ecx
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @between(float %0, float %1, float %2) {
%4 = alloca i32
%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* %5
%9 = load float, float* %6
%10 = fcmp oeq float %8, %9
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fcmp oeq float %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11, %3
store i32 0, i32* %4
br label %34
16: ; preds = %11
%17 = load float, float* %5
%18 = load float, float* %6
%19 = fcmp olt float %17, %18
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load float, float* %6
%22 = load float, float* %7
%23 = fcmp olt float %21, %22
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 -1
br label %32
26: ; preds = %16
%27 = load float, float* %7
%28 = load float, float* %6
%29 = fcmp olt float %27, %28
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 1, i32 -1
br label %32
32: ; preds = %26, %20
%33 = phi i32 [ %25, %20 ], [ %31, %26 ]
store i32 %33, i32* %4
br label %34
34: ; preds = %32, %15
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @between(float %0, float %1, float %2) {
%4 = fcmp oeq float %0, %1
%5 = fcmp oeq float %1, %2
%6 = or i1 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = fcmp olt float %0, %1
%9 = fcmp olt float %1, %2
%10 = select i1 %9, i32 1, i32 -1
%11 = fcmp olt float %2, %1
%12 = select i1 %11, i32 1, i32 -1
%13 = select i1 %8, i32 %10, i32 %12
br label %14
14: ; preds = %3, %7
%15 = phi i32 [ %13, %7 ], [ 0, %3 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int ASN1_item_i2d_bio(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPublicKey_it;
int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa) {
  return ASN1_item_i2d_bio(&RSAPublicKey_it, bp, rsa);
}


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

x86 assembly (clang, -O2):
<i2d_RSAPublicKey_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_i2d_bio@plt>

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

LLVM IR (-O2):
@RSAPublicKey_it = global i32 0
define i32 @i2d_RSAPublicKey_bio(i32* %0, i32* %1) {
%3 = tail call i32 @ASN1_item_i2d_bio(i32* @RSAPublicKey_it, i32* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ getbegyx(int /*<<< orphan*/ *, int, int);
void ncurses_getbegyx(WINDOW *win, int *y, int *x) { getbegyx(win, *y, *x); }


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

x86 assembly (clang, -O2):
<ncurses_getbegyx>:
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <getbegyx@plt>

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

LLVM IR (-O2):
define void @ncurses_getbegyx(i32* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 @getbegyx(i32* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
long double __qcos(long double);
long double __q_cos(long double *arg) { return (__qcos(*arg)); }


x86 assembly (clang, -O0):
<__q_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qcos@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_cos>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qcos@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__q_cos(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = load x86_fp80*, x86_fp80** %2
%4 = load x86_fp80, x86_fp80* %3
%5 = call x86_fp80 @__qcos(x86_fp80 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @__q_cos(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qcos(x86_fp80 %2)
ret x86_fp80 %3
}
unsigned umagic(unsigned value) { return value + 42; }


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

x86 assembly (clang, -O2):
<umagic>:
lea    0x2a(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @umagic(i32 %0) {
%2 = add i32 %0, 42
ret i32 %2
}
__attribute__((used)) int _close(int file) { return -1; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @_close to i8*)], section "llvm.metadata"
define i32 @_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 -1
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @_close to i8*)], section "llvm.metadata"
define i32 @_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
void funcion1() {
  int dato = 53;
  char num1 = 'a';
  printf("Funcion1, dato=%d, num1=%c\n", dato, num1);
  return;
}


x86 assembly (clang, -O0):
<funcion1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x35,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed3(%rip),%rdi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcion1>:
lea    0xee9(%rip),%rdi
mov    $0x35,%esi
mov    $0x61,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Funcion1, dato=%d, num1=%c\0A\00"
define void @funcion1() {
%1 = alloca i32
%2 = alloca i8
store i32 53, i32* %1
store i8 97, i8* %2
%3 = load i32, i32* %1
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3, i8 signext %4)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Funcion1, dato=%d, num1=%c\0A\00"
define void @funcion1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 53, i8 signext 97)
ret void
}
void foo760() {}


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

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

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

LLVM IR (-O2):
define void @foo760() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _keymgr_get_and_lock_processwide_ptr_2(unsigned int,
                                                          void **);
void *_keymgr_get_and_lock_processwide_ptr(unsigned int key) {
  void *result = NULL;
  _keymgr_get_and_lock_processwide_ptr_2(key, &result);
  return result;
}


x86 assembly (clang, -O0):
<_keymgr_get_and_lock_processwide_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <_keymgr_get_and_lock_processwide_ptr_2@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_keymgr_get_and_lock_processwide_ptr>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <_keymgr_get_and_lock_processwide_ptr_2@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @_keymgr_get_and_lock_processwide_ptr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = call i32 @_keymgr_get_and_lock_processwide_ptr_2(i32 %4, i8** %3)
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @_keymgr_get_and_lock_processwide_ptr(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @_keymgr_get_and_lock_processwide_ptr_2(i32 %0, i8** %2)
%5 = load i8*, i8** %2
ret i8* %5
}
void outbyte(char b) { (void)b; }


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

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

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

LLVM IR (-O2):
define void @outbyte(i8 signext %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ bell_duration;
};
typedef TYPE_1__ XKeyboardState;

/* Variables and functions */
unsigned get_XKeyboardState_bell_duration(void *_p) {
  return (unsigned)((XKeyboardState *)_p)->bell_duration;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XKeyboardState_bell_duration(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void fz_unlock_default(void *user, int lock) {}


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

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

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

LLVM IR (-O2):
define void @fz_unlock_default(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double rint(double);
double nearbyint(double x) { return rint(x); }


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

x86 assembly (clang, -O2):
<nearbyint>:
jmp    1030 <rint@plt>

LLVM IR (-O0):
define double @nearbyint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.rint.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @nearbyint(double %0) {
%2 = tail call double @llvm.rint.f64(double %0)
ret double %2
}
/* Variables and functions */
int __cvmx_helper_rgmii_probe(int);
int __cvmx_helper_rgmii_enumerate(int interface) {
  return __cvmx_helper_rgmii_probe(interface);
}


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

x86 assembly (clang, -O2):
<__cvmx_helper_rgmii_enumerate>:
jmp    1030 <__cvmx_helper_rgmii_probe@plt>

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

LLVM IR (-O2):
define i32 @__cvmx_helper_rgmii_enumerate(i32 %0) {
%2 = tail call i32 @__cvmx_helper_rgmii_probe(i32 %0)
ret i32 %2
}
int __bid_is754R(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__bid_is754R() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ dbg_channel_write(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void _llprint(const char *str) { dbg_channel_write(str, strlen(str)); }


x86 assembly (clang, -O0):
<_llprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <dbg_channel_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_llprint>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <dbg_channel_write@plt>

LLVM IR (-O0):
define void @_llprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @dbg_channel_write(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @_llprint(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @dbg_channel_write(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool streq(char const *a, char const *b) { return strcmp(a, b) == 0; }


x86 assembly (clang, -O0):
<streq>:
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>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void puti(i, r) register unsigned int i;
register unsigned int r;
{
  register unsigned int q, s;
  if ((q = i / r) != 0)
    puti(q, r);
  s = i % r;
  if (s <= 9)
    outc(s + '0');
  else
    outc(s - 10 + 'A');
}


x86 assembly (clang, -O0):
<puti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     114d <puti+0x2d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <puti@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
ja     1174 <puti+0x54>
mov    -0x10(%rbp),%edi
add    $0x30,%edi
mov    $0x0,%al
call   1040 <outc@plt>
jmp    1184 <puti+0x64>
mov    -0x10(%rbp),%edi
sub    $0xa,%edi
add    $0x41,%edi
mov    $0x0,%al
call   1040 <outc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puti>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    %edi,%esi
ja     113a <puti+0x1a>
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <puti@plt>
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
lea    0x37(%rdx),%eax
lea    0x30(%rdx),%edi
cmp    $0xa,%edx
cmovae %eax,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outc@plt>

LLVM IR (-O0):
define void @puti(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = udiv i32 %7, %8
store i32 %9, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = urem i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = icmp ule i32 %18, 9
br i1 %19, label %20, label %24
20: ; preds = %14
%21 = load i32, i32* %6
%22 = add i32 %21, 48
%23 = call i32 (i32, ...) bitcast (i32 (...)* @outc to i32 (i32, ...)*)(i32 %22)
br label %29
24: ; preds = %14
%25 = load i32, i32* %6
%26 = sub i32 %25, 10
%27 = add i32 %26, 65
%28 = call i32 (i32, ...) bitcast (i32 (...)* @outc to i32 (i32, ...)*)(i32 %27)
br label %29
29: ; preds = %24, %20
ret void
}

LLVM IR (-O2):
define void @puti(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, %0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = udiv i32 %0, %1
tail call void @puti(i32 %5, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = urem i32 %0, %1
%8 = icmp ult i32 %7, 10
%9 = select i1 %8, i32 48, i32 55
%10 = add i32 %7, %9
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @outc to i32 (i32, ...)*)(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_error();
int /*<<< orphan*/ set_error_(char *, int);
scalar_t__ setdomainname(char *, int);
void net_setdomainname(char *domainname, int len) {
  clear_error();
  if (setdomainname(domainname, len) != 0) {
    set_error_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/LibertyEiffel/Liberty/refs/"
               "heads/master/sys/plugins/net/c/net.c",
               633);
  }
}


x86 assembly (clang, -O0):
<net_setdomainname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1050 <clear_error@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <setdomainname@plt>
cmp    $0x0,%rax
je     116d <net_setdomainname+0x3d>
lea    0xe9d(%rip),%rdi
mov    $0x279,%esi
call   1040 <set_error_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_setdomainname>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <clear_error@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <setdomainname@plt>
test   %rax,%rax
je     1165 <net_setdomainname+0x35>
lea    0xeab(%rip),%rdi
mov    $0x279,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <set_error_@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LibertyEiffel/Liberty/refs/heads/master/sys/plugins/net/c/net.c\00"
define void @net_setdomainname(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @clear_error()
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i64 @setdomainname(i8* %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @set_error_(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 633)
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LibertyEiffel/Liberty/refs/heads/master/sys/plugins/net/c/net.c\00"
define void @net_setdomainname(i8* %0, i32 %1) {
%3 = tail call i32 (...) @clear_error()
%4 = tail call i64 @setdomainname(i8* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @set_error_(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 633)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ u64;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ WriteUint64Le(int /*<<< orphan*/, void *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, double *, int);
int32_t WriteDoubleLe(double value, void *out) {
  assert(out != NULL);
  uint64_t u64;
  memcpy(&u64, &value, sizeof(u64));
  return WriteUint64Le(u64, out);
}


x86 assembly (clang, -O0):
<WriteDoubleLe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x14(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <WriteUint64Le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDoubleLe>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
call   1050 <WriteUint64Le@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @WriteDoubleLe(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i32
store double %0, double* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @memcpy(i32* %5, double* %3, i32 4)
%11 = load i32, i32* %5
%12 = load i8*, i8** %4
%13 = call i32 @WriteUint64Le(i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @WriteDoubleLe(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = icmp ne i8* %1, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = bitcast i32* %4 to i8*
%9 = call i32 @memcpy(i32* %4, double* %3, i32 4)
%10 = load i32, i32* %4
%11 = call i32 @WriteUint64Le(i32 %10, i8* %1)
ret i32 %11
}
/* Variables and functions */
int pow(float, int);
float volume_esfera(float r) { return (4 / 3 * 3.141592 * pow(r, 3)); }


x86 assembly (clang, -O0):
<volume_esfera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume_esfera>:
push   %rax
mov    $0x3,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @volume_esfera(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @pow(float %3, i32 3)
%5 = sitofp i32 %4 to double
%6 = fmul double 0x400921FAFC8B007A, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @volume_esfera(float %0) {
%2 = tail call i32 @pow(float %0, i32 3)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x400921FAFC8B007A
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime_r(int /*<<< orphan*/, char *);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ const *);
char *ctime_r(const time_t *timep, char *buf) {
  return asctime_r(localtime(timep), buf);
}


x86 assembly (clang, -O0):
<ctime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <asctime_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <asctime_r@plt>

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

LLVM IR (-O2):
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = tail call i32 @localtime(i32* %0)
%4 = tail call i8* @asctime_r(i32 %3, i8* %1)
ret i8* %4
}
void outstr(s) char *s;
{ printf("%s", s); }


x86 assembly (clang, -O0):
<outstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outstr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @outstr(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void hash_remainder(void *hash, void *out) {
  *(uint32_t *)out = *(uint32_t *)hash;
}


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

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

LLVM IR (-O0):
define void @hash_remainder(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @hash_remainder(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ loop(long, int);
scalar_t__ loop2(long, int);
int main(int argc, char *argv[]) {
  long x = 0xABCD1234;
  assert(loop(x, 3) == loop2(x, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xabcd1234,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x3,%esi
call   1030 <loop@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x3,%esi
call   1040 <loop2@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xabcd1234,%edi
mov    $0x3,%esi
call   1030 <loop@plt>
mov    %rax,%rbx
mov    $0xabcd1234,%edi
mov    $0x3,%esi
call   1040 <loop2@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 2882343476, i64* %6
%7 = load i64, i64* %6
%8 = call i64 @loop(i64 %7, i32 3)
%9 = load i64, i64* %6
%10 = call i64 @loop2(i64 %9, i32 3)
%11 = icmp eq i64 %8, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @loop(i64 2882343476, i32 3)
%4 = tail call i64 @loop2(i64 2882343476, i32 3)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
/* Variables and functions */
void ui_destroy_cursor(void *cursor) {}


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

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

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

LLVM IR (-O2):
define void @ui_destroy_cursor(i8* nocapture %0) {
ret void
}
int test_imm_D7uint8_mem(unsigned char *val) {
  return ((*val) & (-0xD7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D7uint8_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, -215
%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_D7uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 41
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double pow(double, int);
double Lout(double e_0, double t0) { return (5.67 * pow(10, -8) * pow(t0, 4)); }


x86 assembly (clang, -O0):
<Lout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
mov    $0xfffffff8,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lout>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  0xede(%rip),%xmm0
mov    $0xfffffff8,%edi
call   1030 <pow@plt>
mulsd  0xed4(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Lout(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double @pow(double 1.000000e+01, i32 -8)
%6 = fmul double 5.670000e+00, %5
%7 = load double, double* %4
%8 = call double @pow(double %7, i32 4)
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @Lout(double %0, double %1) {
%3 = tail call double @pow(double 1.000000e+01, i32 -8)
%4 = fmul double %3, 5.670000e+00
%5 = tail call double @pow(double %1, i32 4)
%6 = fmul double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ mrr_send_radio_data(int /*<<< orphan*/);
int /*<<< orphan*/ pmu_setting_temp_based(int);
void send_beacon() {
  pmu_setting_temp_based(1);
  mrr_send_radio_data(0);
}


x86 assembly (clang, -O0):
<send_beacon>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <pmu_setting_temp_based@plt>
xor    %edi,%edi
call   1040 <mrr_send_radio_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_beacon>:
push   %rax
mov    $0x1,%edi
call   1030 <pmu_setting_temp_based@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <mrr_send_radio_data@plt>

LLVM IR (-O0):
define void @send_beacon() {
%1 = call i32 @pmu_setting_temp_based(i32 1)
%2 = call i32 @mrr_send_radio_data(i32 0)
ret void
}

LLVM IR (-O2):
define void @send_beacon() {
%1 = tail call i32 @pmu_setting_temp_based(i32 1)
%2 = tail call i32 @mrr_send_radio_data(i32 0)
ret void
}
int execute_getgid32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getgid32() {
ret i32 0
}
void TIM5_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM5_IRQHandler() {
ret void
}
int fun1128() { return 1128; }


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

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

LLVM IR (-O0):
define i32 @fun1128() {
ret i32 1128
}

LLVM IR (-O2):
define i32 @fun1128() {
ret i32 1128
}
/* Variables and functions */
void *read_byte(void *, int *);
void *read_oid_part(void *src, int *part) {
  int v;
  int val = 0;
  do {
    src = read_byte(src, &v);
    val = (val << 7) + (v & 0x7F);
  } while (v > 127);
  *part = val;
  return src;
}


x86 assembly (clang, -O0):
<read_oid_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <read_byte@plt>
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x7,%eax
mov    -0x14(%rbp),%ecx
and    $0x7f,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x7f,-0x14(%rbp)
jg     1127 <read_oid_part+0x17>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_oid_part>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rax
xor    %ebp,%ebp
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <read_byte@plt>
mov    %ebp,%ecx
shl    $0x7,%ecx
mov    0xc(%rsp),%edx
mov    %edx,%ebp
and    $0x7f,%ebp
or     %ecx,%ebp
cmp    $0x7f,%edx
jg     1130 <read_oid_part+0x20>
mov    %ebp,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @read_oid_part(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %8, %5 ]
%7 = phi i32 [ 0, %2 ], [ %12, %5 ]
%8 = call i8* @read_byte(i8* %6, i32* %3)
%9 = shl i32 %7, 7
%10 = load i32, i32* %3
%11 = and i32 %10, 127
%12 = or i32 %11, %9
%13 = icmp sgt i32 %10, 127
br i1 %13, label %5, label %14
14: ; preds = %5
store i32 %12, i32* %1
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_message() { printf("hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define void @show_message() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @show_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
void tag6(void (*handler)(void *), void *arg) { (*handler)(arg); }


x86 assembly (clang, -O0):
<tag6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag6>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @tag6(void (i8*)* nocapture %0, i8* %1) {
tail call void %0(i8* %1)
ret void
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
struct hash *lib_hash_create_size(int, unsigned int (*)(char *),
                                  int (*)(void *, void *));
struct hash *hash_create(unsigned int (*hash_key)(char *),
                         int (*hash_cmp)(void *, void *)) {
  return lib_hash_create_size(10240, hash_key, hash_cmp);
}


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

x86 assembly (clang, -O2):
<hash_create>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2800,%edi
jmp    1030 <lib_hash_create_size@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define %struct.hash* @hash_create(i32 (i8*)* %0, i32 (i8*, i8*)* %1) {
%3 = alloca i32 (i8*)*
%4 = alloca i32 (i8*, i8*)*
store i32 (i8*)* %0, i32 (i8*)** %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
%5 = load i32 (i8*)*, i32 (i8*)** %3
%6 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %4
%7 = call %struct.hash* @lib_hash_create_size(i32 10240, i32 (i8*)* %5, i32 (i8*, i8*)* %6)
ret %struct.hash* %7
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define %struct.hash* @hash_create(i32 (i8*)* %0, i32 (i8*, i8*)* %1) {
%3 = tail call %struct.hash* @lib_hash_create_size(i32 10240, i32 (i8*)* %0, i32 (i8*, i8*)* %1)
ret %struct.hash* %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_read_quaddobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(380, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_read_quaddobl_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x17c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_read_quaddobl_system>:
mov    $0x17c,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_read_quaddobl_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 380, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_read_quaddobl_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 380, i32* undef, i32* undef, double* undef)
ret i32 %1
}
int test_imm_1Dint64_highword_reg(long long val) {
  return ((val >> 32) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Dint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x1d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Dint64_highword_reg>:
movabs $0x1d00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Dint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 29
%6 = icmp ne i64 %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_1Dint64_highword_reg(i64 %0) {
%2 = and i64 %0, 124554051584
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int f211(int *);
int f212(int *p) { return f211(p); }


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

x86 assembly (clang, -O2):
<f212>:
jmp    1030 <f211@plt>

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

LLVM IR (-O2):
define i32 @f212(i32* %0) {
%2 = tail call i32 @f211(i32* %0)
ret i32 %2
}