xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Oi, Mundo cruel!\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Oi, Mundo cruel!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Oi, Mundo cruel!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void SystemConfig_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame2_l");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame1_r");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_0");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_1");
}


x86 assembly (clang, -O0):
<SystemConfig_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef3(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf01(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0d(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemConfig_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef6(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf04(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf10(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.1 = [26 x i8] c"menu/art_blueish/frame1_r\00"
@.str.2 = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.3 = [24 x i8] c"menu/art_blueish/back_1\00"
define void @SystemConfig_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.1 = [26 x i8] c"menu/art_blueish/frame1_r\00"
@.str.2 = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.3 = [24 x i8] c"menu/art_blueish/back_1\00"
define void @SystemConfig_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(int);
double rah1(double psih, double ustar, double zom_0) {
  return ((log(2 / (0.01 * zom_0)) - psih) / (ustar * 0.41));
}


x86 assembly (clang, -O0):
<rah1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee1(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xecc(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
subsd  -0x8(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rah1>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mulsd  0xed8(%rip),%xmm2
movsd  0xed8(%rip),%xmm0
divsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
subsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rah1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fmul double 1.000000e-02, %7
%9 = fdiv double 2.000000e+00, %8
%10 = fptosi double %9 to i32
%11 = call double @log(i32 %10)
%12 = load double, double* %4
%13 = fsub double %11, %12
%14 = load double, double* %5
%15 = fmul double %14, 4.100000e-01
%16 = fdiv double %13, %15
ret double %16
}

LLVM IR (-O2):
define double @rah1(double %0, double %1, double %2) {
%4 = fmul double %2, 1.000000e-02
%5 = fdiv double 2.000000e+00, %4
%6 = fptosi double %5 to i32
%7 = tail call double @log(i32 %6)
%8 = fsub double %7, %0
%9 = fmul double %1, 4.100000e-01
%10 = fdiv double %8, %9
ret double %10
}
void noop(char *p) { *p = 0; }


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

x86 assembly (clang, -O2):
<noop>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @noop(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M5_f(char *s) {
  debug("M5_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M5_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M5_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"M5_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M5_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"M5_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M5_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
scalar_t__ isgreater(long double, long double);
long double fdiml(long double x, long double y) {
  return (isgreater(x, y) ? (x - y) : 0.0L);
}


x86 assembly (clang, -O0):
<fdiml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <isgreater@plt>
cmp    $0x0,%rax
je     1151 <fdiml+0x41>
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fsubrp %st,%st(1)
fstpt  -0x2c(%rbp)
jmp    115b <fdiml+0x4b>
fldz
fstpt  -0x2c(%rbp)
jmp    115b <fdiml+0x4b>
fldt   -0x2c(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdiml>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x20(%rsp)
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <isgreater@plt>
test   %rax,%rax
fldt   0x2c(%rsp)
fldt   0x20(%rsp)
fsubp  %st,%st(1)
fldz
fxch   %st(1)
fcmove %st(1),%st
fstp   %st(1)
add    $0x38,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @isgreater(x86_fp80 %5, x86_fp80 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load x86_fp80, x86_fp80* %3
%11 = load x86_fp80, x86_fp80* %4
%12 = fsub x86_fp80 %10, %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %9
%15 = phi x86_fp80 [ %12, %9 ], [ 0xK00000000000000000000, %13 ]
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @isgreater(x86_fp80 %0, x86_fp80 %1)
%4 = icmp eq i64 %3, 0
%5 = fsub x86_fp80 %0, %1
%6 = select i1 %4, x86_fp80 0xK00000000000000000000, x86_fp80 %5
ret x86_fp80 %6
}
/* Type definitions */
struct sign_expr {
  int dummy;
};
struct object {
  int dummy;
};
struct expr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ minus_expr_class_get();
struct object *object_new(int /*<<< orphan*/);
int /*<<< orphan*/ sign_expr_init(struct sign_expr *, struct expr *);
struct expr *minus_expr_new(struct expr *value) {
  struct object *expr = object_new(minus_expr_class_get());
  sign_expr_init(((struct sign_expr *)(expr)), value);
  return ((struct expr *)(expr));
}


x86 assembly (clang, -O0):
<minus_expr_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <minus_expr_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <sign_expr_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minus_expr_new>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <minus_expr_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <sign_expr_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.sign_expr = type { i32 }
define %struct.expr* @minus_expr_new(%struct.expr* %0) {
%2 = alloca %struct.expr*
%3 = alloca %struct.object*
store %struct.expr* %0, %struct.expr** %2
%4 = call i32 (...) @minus_expr_class_get()
%5 = call %struct.object* @object_new(i32 %4)
store %struct.object* %5, %struct.object** %3
%6 = load %struct.object*, %struct.object** %3
%7 = bitcast %struct.object* %6 to %struct.sign_expr*
%8 = load %struct.expr*, %struct.expr** %2
%9 = call i32 @sign_expr_init(%struct.sign_expr* %7, %struct.expr* %8)
%10 = load %struct.object*, %struct.object** %3
%11 = bitcast %struct.object* %10 to %struct.expr*
ret %struct.expr* %11
}

LLVM IR (-O2):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.sign_expr = type { i32 }
define %struct.expr* @minus_expr_new(%struct.expr* %0) {
%2 = tail call i32 (...) @minus_expr_class_get()
%3 = tail call %struct.object* @object_new(i32 %2)
%4 = bitcast %struct.object* %3 to %struct.sign_expr*
%5 = tail call i32 @sign_expr_init(%struct.sign_expr* %4, %struct.expr* %0)
%6 = bitcast %struct.object* %3 to %struct.expr*
ret %struct.expr* %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t align32_up_4(uint32_t i) {
  i += 3;
  i &= ~((uint32_t)0b11);
  return i;
}


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

x86 assembly (clang, -O2):
<align32_up_4>:
lea    0x3(%rdi),%eax
and    $0xfffffffc,%eax
ret

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

LLVM IR (-O2):
define i32 @align32_up_4(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = and i32 %2, -4
ret i32 %3
}
/* Variables and functions */
int close(int);
__attribute__((weak)) int __real_close(int fd) { return close(fd); }


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

LLVM IR (-O0):
define weak i32 @__real_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 weak i32 @__real_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t MIPS32_LUI(unsigned dst, uint16_t imm) {
  return (0x3C000000 | (dst << 16) | imm);
}


x86 assembly (clang, -O0):
<MIPS32_LUI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     $0x3c000000,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIPS32_LUI>:
mov    %edi,%eax
shl    $0x10,%eax
or     %esi,%eax
or     $0x3c000000,%eax
ret

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

LLVM IR (-O2):
define i32 @MIPS32_LUI(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = or i32 %3, %1
%5 = or i32 %4, 1006632960
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32_ieee_base(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/);
uint32_t crc32_ieee(uint32_t seed, const unsigned char *buf, uint64_t len) {
  return crc32_ieee_base(seed, (uint8_t *)buf, len);
}


x86 assembly (clang, -O0):
<crc32_ieee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <crc32_ieee_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_ieee>:
jmp    1030 <crc32_ieee_base@plt>

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

LLVM IR (-O2):
define i32 @crc32_ieee(i32 %0, i8* %1, i32 %2) {
%4 = bitcast i8* %1 to i32*
%5 = tail call i32 @crc32_ieee_base(i32 %0, i32* %4, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rol(uint32_t src, uint32_t amt) {
  return (src << amt) | (src >> (32 - amt));
}


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int foo(int x, int y) { return (y == 0 || (x && y == 1)) ? x : x % y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <foo+0x28>
cmpl   $0x0,-0x4(%rbp)
je     1133 <foo+0x33>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <foo+0x33>
mov    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
jmp    113d <foo+0x3d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
test   %esi,%esi
je     110f <foo+0xf>
test   %eax,%eax
je     1110 <foo+0x10>
cmp    $0x1,%esi
jne    1110 <foo+0x10>
ret
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp ne i32 %0, 0
%6 = icmp eq i32 %1, 1
%7 = and i1 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = srem i32 %0, %1
br label %10
10: ; preds = %2, %4, %8
%11 = phi i32 [ %9, %8 ], [ %0, %4 ], [ %0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XGetWMNormalHints() {
  printf("XGetWMNormalHints called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"XGetWMNormalHints called\00"
define i32 @XGetWMNormalHints() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ different_type_pointer();
int /*<<< orphan*/ printarg(int, char **);
int /*<<< orphan*/ printenv();
int main(int argc, char *argv[]) {
  printarg(argc, argv);
  printenv();
  different_type_pointer();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <printarg@plt>
mov    $0x0,%al
call   1040 <printenv@plt>
mov    $0x0,%al
call   1030 <different_type_pointer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <printarg@plt>
xor    %eax,%eax
call   1040 <printenv@plt>
xor    %eax,%eax
call   1030 <different_type_pointer@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @printarg(i32 %6, i8** %7)
%9 = call i32 (...) @printenv()
%10 = call i32 (...) @different_type_pointer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @printarg(i32 %0, i8** %1)
%4 = tail call i32 (...) @printenv()
%5 = tail call i32 (...) @different_type_pointer()
ret i32 0
}
unsigned int bcm2835_version(void) { return 10049; }


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

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

LLVM IR (-O0):
define i32 @bcm2835_version() {
ret i32 10049
}

LLVM IR (-O2):
define i32 @bcm2835_version() {
ret i32 10049
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ bufToFile(int /*<<< orphan*/ *, char *, size_t);
int vfscanf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int vsscanf(const char *s, const char *format, va_list arg) {
  FILE str;
  bufToFile(&str, (char *)s, (size_t)-1);
  int res = vfscanf(&str, format, arg);
  return res;
}


x86 assembly (clang, -O0):
<vsscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0xffffffffffffffff,%rdx
call   1030 <bufToFile@plt>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%rdi
call   1040 <vfscanf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsscanf>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xc(%rsp),%r14
mov    %r14,%rdi
mov    $0xffffffffffffffff,%rdx
call   1030 <bufToFile@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <vfscanf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vsscanf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @bufToFile(i32* %7, i8* %9, i64 -1)
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @vfscanf(i32* %7, i8* %11, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
ret i32 %14
}

LLVM IR (-O2):
define i32 @vsscanf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @bufToFile(i32* %4, i8* %0, i64 -1)
%7 = call i32 @vfscanf(i32* %4, i8* %1, i32 %2)
ret i32 %7
}
unsigned xrop3_105_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_105_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_105_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    %eax,%ecx
xor    $0xffffff00,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_105_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_105_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, -256
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __halt();
void fn0BD4() { __halt(); }


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

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

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

LLVM IR (-O2):
define void @fn0BD4() {
%1 = tail call i32 (...) @__halt()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_write(int, int /*<<< orphan*/ *, int);
unsigned w5100_writeUIPR(uint8_t *buff) { return w5100_write(0x002A, buff, 4); }


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

x86 assembly (clang, -O2):
mov    %rdi,%rsi
mov    $0x2a,%edi
mov    $0x4,%edx
jmp    1030 <w5100_write@plt>

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

LLVM IR (-O2):
define i32 @w5100_writeUIPR(i32* %0) {
%2 = tail call i32 @w5100_write(i32 42, i32* %0, i32 4)
ret i32 %2
}
void test_builtin_creal(_Complex double d) {
  if (__builtin_creal(d) != __builtin_creal(d))
    link_failure_builtin_creal();
}


x86 assembly (clang, -O0):
<test_builtin_creal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    113d <test_builtin_creal+0x2d>
jp     113d <test_builtin_creal+0x2d>
jmp    1144 <test_builtin_creal+0x34>
mov    $0x0,%al
call   1030 <link_failure_builtin_creal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_creal>:
ucomisd %xmm0,%xmm0
jp     1117 <test_builtin_creal+0x7>
ret
xor    %eax,%eax
jmp    1030 <link_failure_builtin_creal@plt>

LLVM IR (-O0):
define void @test_builtin_creal(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%13 = load double, double* %12
%14 = fcmp une double %7, %11
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @link_failure_builtin_creal()
br label %17
17: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_creal(double %0, double %1) {
%3 = fcmp uno double %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @link_failure_builtin_creal()
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int helpme() {
  fprintf(stderr, "Usage:\n");
  fprintf(stderr, "hpe_open -c file   ;compress and obfuscate file\n");
  fprintf(stderr, "hpe_open -d file.hpe  ;deobfuscate and decompress file\n");
}


x86 assembly (clang, -O0):
<helpme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xee7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpme>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefc(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [49 x i8] c"hpe_open -c file ;compress and obfuscate file\0A\00"
@.str.2 = [56 x i8] c"hpe_open -d file.hpe ;deobfuscate and decompress file\0A\00"
define i32 @helpme() {
%1 = alloca i32
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [49 x i8] c"hpe_open -c file ;compress and obfuscate file\0A\00"
@.str.2 = [56 x i8] c"hpe_open -d file.hpe ;deobfuscate and decompress file\0A\00"
define i32 @helpme() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint8_t sancus_u8zu(size_t v) {
  assert(v <= 0xff);
  return (uint8_t)v;
}


x86 assembly (clang, -O0):
<sancus_u8zu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xff,-0x8(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_u8zu>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x100,%rbx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_u8zu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 %3, 255
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @sancus_u8zu(i64 %0) {
%2 = icmp ult i64 %0, 256
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = trunc i64 %0 to i32
ret i32 %5
}
/* Variables and functions */
void printf(char x) {}


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

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

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

LLVM IR (-O2):
define void @printf(i8 signext %0) {
ret void
}
/* Variables and functions */
int COLS;
int /*<<< orphan*/ mvaddstr(int, int, char *);
int /*<<< orphan*/ refresh();
int strlen(char *);
void centerText(int row, char *title) {
  int len, indent;
  len = strlen(title);
  indent = COLS - len;
  indent = indent / 2;
  mvaddstr(row, indent, title);
  refresh();
}


x86 assembly (clang, -O0):
<centerText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1050 <mvaddstr@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<centerText>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%ecx
sub    %eax,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
add    %ecx,%esi
sar    %esi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1050 <mvaddstr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@COLS = global i32 0
define void @centerText(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @COLS
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 2
store i32 %13, i32* %6
%14 = load i32, i32* %3
%15 = load i32, i32* %6
%16 = load i8*, i8** %4
%17 = call i32 @mvaddstr(i32 %14, i32 %15, i8* %16)
%18 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@COLS = global i32 0
define void @centerText(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = load i32, i32* @COLS
%5 = sub nsw i32 %4, %3
%6 = sdiv i32 %5, 2
%7 = tail call i32 @mvaddstr(i32 %0, i32 %6, i8* %1)
%8 = tail call i32 (...) @refresh()
ret void
}
int main(void) {
  int a = 5, b = 10;
  char *s = "hello";
  float t;
  &a;
  &b;
  &s;
  &t;
  int *aa = &a;
  int *bb = &b;
  char **ss = &s;
  char *sss = &s;
  float *tt = &t;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
lea    0xee0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca float
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca float*
store i32 0, i32* %1
store i32 5, i32* %2
store i32 10, i32* %3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
store i32* %2, i32** %6
store i32* %3, i32** %7
store i8** %4, i8*** %8
%11 = bitcast i8** %4 to i8*
store i8* %11, i8** %9
store float* %5, float** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void consume(int *dummy) {}


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

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

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

LLVM IR (-O2):
define void @consume(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int __libc_pause();
int /*<<< orphan*/ pthread_testcancel();
int pause() {
  pthread_testcancel();
  return __libc_pause();
}


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

x86 assembly (clang, -O2):
<pause>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_testcancel@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__libc_pause@plt>

LLVM IR (-O0):
define i32 @pause() {
%1 = call i32 (...) @pthread_testcancel()
%2 = call i32 (...) @__libc_pause()
ret i32 %2
}

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i32 (...) @pthread_testcancel()
%2 = tail call i32 (...) @__libc_pause()
ret i32 %2
}
/* Variables and functions */
int handle_lock_level(int, int, int);
int handle_lock(int devfd, int nodeid, char *arg) {
  return handle_lock_level(devfd, nodeid, 255);
}


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

x86 assembly (clang, -O2):
<handle_lock>:
mov    $0xff,%edx
jmp    1030 <handle_lock_level@plt>

LLVM IR (-O0):
define i32 @handle_lock(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 = call i32 @handle_lock_level(i32 %7, i32 %8, i32 255)
ret i32 %9
}

LLVM IR (-O2):
define i32 @handle_lock(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @handle_lock_level(i32 %0, i32 %1, i32 255)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x_root;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void set_XCrossingEvent_x_root(void *_p, int _v) {
  ((XCrossingEvent *)_p)->x_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XCrossingEvent_x_root>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XCrossingEvent_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
getviewport_(left, right, bottom, top) short *left, *right, *bottom, *top;
{ getviewport(left, right, bottom, top); }


x86 assembly (clang, -O0):
<getviewport_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1030 <getviewport@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getviewport_(i16* %0, i16* %1, i16* %2, i16* %3) {
%5 = tail call i32 (i16*, i16*, i16*, i16*, ...) bitcast (i32 (...)* @getviewport to i32 (i16*, i16*, i16*, i16*, ...)*)(i16* %0, i16* %1, i16* %2, i16* %3)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ puts(char *);
FILE *topdf2(void) {
  puts("Content-Type: application/pdf\n");
  return (popen("htmldoc -t pdf --webpage -", "w"));
}


x86 assembly (clang, -O0):
<topdf2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
lea    0xefc(%rip),%rsi
call   1040 <popen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<topdf2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
lea    0xeff(%rip),%rsi
pop    %rax
jmp    1040 <popen@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Content-Type: application/pdf\0A\00"
@.str.1 = [27 x i8] c"htmldoc -t pdf --webpage -\00"
@.str.2 = [2 x i8] c"w\00"
define i32* @topdf2() {
%1 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32* @popen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32* %2
}

LLVM IR (-O2):
@.str = [31 x i8] c"Content-Type: application/pdf\0A\00"
@.str.1 = [27 x i8] c"htmldoc -t pdf --webpage -\00"
@.str.2 = [2 x i8] c"w\00"
define noalias i32* @topdf2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32* @popen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32* %2
}
double convertToFahrenheit(double celsius) {
  double fahrenheit;
  fahrenheit = (9.0 / 5.0) * celsius + 32.0;
  return fahrenheit;
}


x86 assembly (clang, -O0):
<convertToFahrenheit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertToFahrenheit>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @convertToFahrenheit(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %4, double 3.200000e+01)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @convertToFahrenheit(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.800000e+00, double 3.200000e+01)
ret double %2
}
int main() {
  int a, b;
  asm("" : "=r"(a) : "0"(0));
  b = (~a | 1) & -2038094497;
  if (b >= 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
or     $0x1,%eax
and    $0x8685255f,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1144 <main+0x34>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
test   %eax,%eax
js     1119 <main+0x9>
xor    %eax,%eax
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = xor i32 %5, -1
%7 = or i32 %6, 1
%8 = and i32 %7, -2038094497
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
tail call void @abort()
unreachable
4: ; preds = %0
ret i32 0
}
/* Variables and functions */
int yaffs_rename_reldir(int /*<<< orphan*/, char const *, char const *);
int yaffs_rename(const char *oldPath, const char *newPath) {
  return yaffs_rename_reldir((0), oldPath, newPath);
}


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

x86 assembly (clang, -O2):
<yaffs_rename>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_rename_reldir@plt>

LLVM IR (-O0):
define i32 @yaffs_rename(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 @yaffs_rename_reldir(i32 0, i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @yaffs_rename(i8* %0, i8* %1) {
%3 = tail call i32 @yaffs_rename_reldir(i32 0, i8* %0, i8* %1)
ret i32 %3
}
void bootretry_reset_cmd_timeout(void) {}


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

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

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

LLVM IR (-O2):
define void @bootretry_reset_cmd_timeout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void cerror(char *file, int line) {
  printf("sg went wrong at %s (line %d)\n", file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<cerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cerror>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"sg went wrong at %s (line %d)\0A\00"
define void @cerror(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"sg went wrong at %s (line %d)\0A\00"
define void @cerror(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *, char **, char **);
void foo(void) {
  int i;
  __attribute__((aligned(65536))) char runtime_aligned_1[512];
  __attribute__((aligned(32768))) char runtime_aligned_2[1024];
  bar(&i, &runtime_aligned_1, &runtime_aligned_2);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffff0000,%rsp
sub    $0x20000,%rsp
lea    0x10000(%rsp),%rsi
lea    0x8000(%rsp),%rdx
lea    0x1ffec(%rsp),%rdi
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffff0000,%rsp
sub    $0x20000,%rsp
lea    0xfffc(%rsp),%rdi
lea    0x10000(%rsp),%rsi
lea    0x18000(%rsp),%rdx
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca [512 x i8]
%3 = alloca [1024 x i8]
%4 = bitcast [512 x i8]* %2 to i8**
%5 = bitcast [1024 x i8]* %3 to i8**
%6 = call i32 @bar(i32* %1, i8** %4, i8** %5)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca i32
%2 = alloca [512 x i8]
%3 = alloca [1024 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = bitcast [512 x i8]* %2 to i8**
%8 = bitcast [1024 x i8]* %3 to i8**
%9 = call i32 @bar(i32* %1, i8** %7, i8** %8)
ret void
}
void traitement_signal(void) {}


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

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

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

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