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

/* Variables and functions */
uint32_t rust_dbg_extern_identity_u32(uint32_t u) { return u; }


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

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

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

LLVM IR (-O2):
define i32 @rust_dbg_extern_identity_u32(i32 returned %0) {
ret i32 %0
}
int is_bad_src_ratio(double ratio) {
  return (ratio < (1.0 / 256) || ratio > (1.0 * 256));
}


x86 assembly (clang, -O0):
<is_bad_src_ratio>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%al
movsd  0xeed(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
ja     1138 <is_bad_src_ratio+0x38>
movsd  -0x8(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bad_src_ratio>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
ucomisd 0xef1(%rip),%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_bad_src_ratio(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 3.906250e-03
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp ogt double %6, 2.560000e+02
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_bad_src_ratio(double %0) {
%2 = fcmp olt double %0, 3.906250e-03
%3 = fcmp ogt double %0, 2.560000e+02
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cp15_dcache_invalidate();
int /*<<< orphan*/ l2cc_cache_sync();
int /*<<< orphan*/ l2cc_invalidate_way(int);
scalar_t__ l2cc_is_enabled();
void l2cc_invalidate(void) {
  if (l2cc_is_enabled()) {
    l2cc_invalidate_way(0xFF);
    l2cc_cache_sync();
  }
  cp15_dcache_invalidate();
}


x86 assembly (clang, -O0):
<l2cc_invalidate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <l2cc_is_enabled@plt>
cmp    $0x0,%rax
je     1166 <l2cc_invalidate+0x26>
mov    $0xff,%edi
call   1030 <l2cc_invalidate_way@plt>
mov    $0x0,%al
call   1050 <l2cc_cache_sync@plt>
mov    $0x0,%al
call   1040 <cp15_dcache_invalidate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2cc_invalidate>:
push   %rax
xor    %eax,%eax
call   1060 <l2cc_is_enabled@plt>
test   %rax,%rax
je     115e <l2cc_invalidate+0x1e>
mov    $0xff,%edi
call   1030 <l2cc_invalidate_way@plt>
xor    %eax,%eax
call   1050 <l2cc_cache_sync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cp15_dcache_invalidate@plt>

LLVM IR (-O0):
define void @l2cc_invalidate() {
%1 = call i64 (...) @l2cc_is_enabled()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @l2cc_invalidate_way(i32 255)
%5 = call i32 (...) @l2cc_cache_sync()
br label %6
6: ; preds = %3, %0
%7 = call i32 (...) @cp15_dcache_invalidate()
ret void
}

LLVM IR (-O2):
define void @l2cc_invalidate() {
%1 = tail call i64 (...) @l2cc_is_enabled()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @l2cc_invalidate_way(i32 255)
%5 = tail call i32 (...) @l2cc_cache_sync()
br label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @cp15_dcache_invalidate()
ret void
}
void f1() {
  float f1 = 1.0, f2 = 2.0, f3 = 3.0;
  int i[2] = {1, 2, 3};
  float f[2] = {f1, f2, f3};
  int x[2] = {};
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  0xee8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    -0x24(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.f1.i = [2 x i32] [i32 1, i32 2]
define void @f1() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca [2 x i32]
%5 = alloca [2 x float]
%6 = alloca [2 x i32]
store float 1.000000e+00, float* %1
store float 2.000000e+00, float* %2
store float 3.000000e+00, float* %3
%7 = bitcast [2 x i32]* %4 to i8*
%8 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%9 = load float, float* %1
store float %9, float* %8
%10 = getelementptr inbounds float, float* %8, i64 1
%11 = load float, float* %2
store float %11, float* %10
%12 = bitcast [2 x i32]* %6 to i8*
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
/* Variables and functions */
int ssds_get_gen_num(int, char *, char *, char *);
int ssds_get_num_class_fields(int pcfd, char *class_def) {
  return ssds_get_gen_num(pcfd, class_def, "gc", "num_fields");
}


x86 assembly (clang, -O0):
<ssds_get_num_class_fields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <ssds_get_gen_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_num_class_fields>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <ssds_get_gen_num@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gc\00"
@.str.1 = [11 x i8] c"num_fields\00"
define i32 @ssds_get_num_class_fields(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 = load i8*, i8** %4
%7 = call i32 @ssds_get_gen_num(i32 %5, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"gc\00"
@.str.1 = [11 x i8] c"num_fields\00"
define i32 @ssds_get_num_class_fields(i32 %0, i8* %1) {
%3 = tail call i32 @ssds_get_gen_num(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
void glPolygonOffset(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ignoreReturnValue(int /*<<< orphan*/);
int fread_short(FILE *fp) {
  int16_t ret;
  ignoreReturnValue(fread(&ret, 2, 1, fp));
  return ret;
}


x86 assembly (clang, -O0):
<fread_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %eax,%edi
call   1030 <ignoreReturnValue@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread_short>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %eax,%edi
call   1030 <ignoreReturnValue@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fread_short(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 2, i32 1, i32* %0)
%5 = tail call i32 @ignoreReturnValue(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void handle_comment(char c) { putchar(c); }


x86 assembly (clang, -O0):
<handle_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_comment>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @handle_comment(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  uint16_t TestNumber = 0xFF00;
  if (*((uint8_t *)&TestNumber) == 0x00) {
    printf("Little endian\n");
  } else {
    printf("Big endian\n");
  }
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Little endian\0A\00"
@.str.1 = [12 x i8] c"Big endian\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 65280, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Big endian\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int disable_interrupts(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @disable_interrupts() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_dl_defaults(double *);
void umf4def_(double Control[20]) { umfpack_dl_defaults(Control); }


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

x86 assembly (clang, -O2):
<umf4def_>:
jmp    1030 <umfpack_dl_defaults@plt>

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

LLVM IR (-O2):
define void @umf4def_(double* %0) {
%2 = tail call i32 @umfpack_dl_defaults(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ ngen(char *, char *, int);
void cgscale2by(int v) {
  gen("pushq\t%rax");
  ngen("%s\t$%d,%%rax", "movq", v);
  gen("mulq\t%rcx,%rax");
  gen("movq\t%rax,%rcx");
  gen("popq\t%rax");
}


x86 assembly (clang, -O0):
<cgscale2by>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <gen@plt>
mov    -0x4(%rbp),%edx
lea    0xeca(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <ngen@plt>
lea    0xec9(%rip),%rdi
call   1040 <gen@plt>
lea    0xecc(%rip),%rdi
call   1040 <gen@plt>
lea    0xecf(%rip),%rdi
call   1040 <gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgscale2by>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <gen@plt>
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    %ebx,%edx
call   1030 <ngen@plt>
lea    0xed2(%rip),%rdi
call   1040 <gen@plt>
lea    0xed5(%rip),%rdi
call   1040 <gen@plt>
lea    0xed8(%rip),%rdi
pop    %rbx
jmp    1040 <gen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"pushq\09%rax\00"
@.str.1 = [13 x i8] c"%s\09$%d,%%rax\00"
@.str.2 = [5 x i8] c"movq\00"
@.str.3 = [15 x i8] c"mulq\09%rcx,%rax\00"
@.str.4 = [15 x i8] c"movq\09%rax,%rcx\00"
@.str.5 = [10 x i8] c"popq\09%rax\00"
define void @cgscale2by(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"pushq\09%rax\00"
@.str.1 = [13 x i8] c"%s\09$%d,%%rax\00"
@.str.2 = [5 x i8] c"movq\00"
@.str.3 = [15 x i8] c"mulq\09%rcx,%rax\00"
@.str.4 = [15 x i8] c"movq\09%rax,%rcx\00"
@.str.5 = [10 x i8] c"popq\09%rax\00"
define void @cgscale2by(i32 %0) {
%2 = tail call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%4 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
ret void
}
void gtk_selection_data_set_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_data_set_text() {
ret void
}
int test_imm_5Cint8_reg(signed char val) {
  return ((val) & (0x5C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Cint8_reg(i8 signext %0) {
%2 = and i8 %0, 92
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <0|1>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [17 x i8] c"Usage: %s <0|1>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [17 x i8] c"Usage: %s <0|1>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
struct bwb_line *bwb_CLOAD(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  return bwb_LOAD(l);
}


x86 assembly (clang, -O0):
<bwb_CLOAD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <bwb_LOAD@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_CLOAD>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <bwb_LOAD@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_CLOAD = [10 x i8] c"bwb_CLOAD\00"
define %struct.bwb_line* @bwb_CLOAD(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.bwb_CLOAD, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_LOAD to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.bwb_line*
ret %struct.bwb_line* %7
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_CLOAD = [10 x i8] c"bwb_CLOAD\00"
define %struct.bwb_line* @bwb_CLOAD(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.bwb_CLOAD, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_LOAD to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.bwb_line*
ret %struct.bwb_line* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void internal_error(char *reason) {
  char *title = "500 Internal Error";
  (void)printf(
      "Status: %s\nContent-type: "
      "text/html\n\n<HTML><HEAD><TITLE>%s</TITLE></HEAD>\n<BODY><H2>%s</"
      "H2>\nSomething unusual went wrong during a redirection "
      "request:\n<BLOCKQUOTE>\n%s\n</BLOCKQUOTE>\n</BODY></HTML>\n",
      title, title, title, reason);
}


x86 assembly (clang, -O0):
<internal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_error>:
mov    %rdi,%r8
lea    0xef9(%rip),%rdi
lea    0xedf(%rip),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"500 Internal Error\00"
@.str.1 = [196 x i8] c"Status: %s\0AContent-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0ASomething unusual went wrong during a redirection request:\0A<BLOCKQUOTE>\0A%s\0A</BLOCKQUOTE>\0A</BODY></HTML>\0A\00"
define void @internal_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"500 Internal Error\00"
@.str.1 = [196 x i8] c"Status: %s\0AContent-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0ASomething unusual went wrong during a redirection request:\0A<BLOCKQUOTE>\0A%s\0A</BLOCKQUOTE>\0A</BODY></HTML>\0A\00"
define void @internal_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CONSOLE_ClearAll();
int /*<<< orphan*/ sscanf(char *, char *, int *);
void console_ESC_J(char *esc_param) {
  int p[1];
  sscanf(esc_param, "%d", &p[0]);
  if (p[0] == 2) {
    CONSOLE_ClearAll();
  }
}


x86 assembly (clang, -O0):
<console_ESC_J>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1030 <sscanf@plt>
cmpl   $0x2,-0xc(%rbp)
jne    1151 <console_ESC_J+0x31>
mov    $0x0,%al
call   1040 <CONSOLE_ClearAll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_ESC_J>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
cmpl   $0x2,0x4(%rsp)
jne    1140 <console_ESC_J+0x20>
xor    %eax,%eax
call   1040 <CONSOLE_ClearAll@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @console_ESC_J(i8* nocapture %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @CONSOLE_ClearAll()
br label %10
10: ; preds = %8, %1
ret void
}
char *strcsrch(s1, s2) const char *s1;
const char *s2;
{
  int ls1;
  ls1 = strlen((char *)s1);
  return (strncsrch(s1, s2, ls1));
}


x86 assembly (clang, -O0):
<strcsrch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <strncsrch@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcsrch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <strncsrch@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcsrch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strncsrch to i32 (i8*, i8*, i32, ...)*)(i8* %9, i8* %10, i32 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @strcsrch(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strncsrch to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void input_stringa(char parola[]) {
  printf("Inserisci parola: ");
  scanf("%s", parola);
}


x86 assembly (clang, -O0):
<input_stringa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed0(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_stringa>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Inserisci parola: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @input_stringa(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *SSL_CTX_new(int /*<<< orphan*/);
int /*<<< orphan*/ TLSv1_2_client_method();
void *dv_openssl_ctx_client_new(void) {
  return SSL_CTX_new(TLSv1_2_client_method());
}


x86 assembly (clang, -O0):
<dv_openssl_ctx_client_new>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <TLSv1_2_client_method@plt>
mov    %eax,%edi
call   1030 <SSL_CTX_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv_openssl_ctx_client_new>:
push   %rax
xor    %eax,%eax
call   1040 <TLSv1_2_client_method@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <SSL_CTX_new@plt>

LLVM IR (-O0):
define i8* @dv_openssl_ctx_client_new() {
%1 = call i32 (...) @TLSv1_2_client_method()
%2 = call i8* @SSL_CTX_new(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @dv_openssl_ctx_client_new() {
%1 = tail call i32 (...) @TLSv1_2_client_method()
%2 = tail call i8* @SSL_CTX_new(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init_random_seed() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<init_random_seed>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_random_seed>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @init_random_seed() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @init_random_seed() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void establishProgramPrivileges(char **parameters, int stayPrivileged) {}


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

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

LLVM IR (-O0):
define void @establishProgramPrivileges(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 @establishProgramPrivileges(i8** nocapture %0, i32 %1) {
ret void
}
void sgx_thread_set_untrusted_event_ocall() {}


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

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

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

LLVM IR (-O2):
define void @sgx_thread_set_untrusted_event_ocall() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ backchar(int);
int inchar();
scalar_t__ utf32_isspace(int);
int skipspace(void) {
  int c;
  while (utf32_isspace(c = inchar()))
    ;
  backchar(c);
  return c;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <inchar@plt>
mov    %eax,%edi
mov    %edi,-0x4(%rbp)
call   1050 <utf32_isspace@plt>
cmp    $0x0,%rax
je     1158 <skipspace+0x28>
jmp    1138 <skipspace+0x8>
mov    -0x4(%rbp),%edi
call   1030 <backchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <inchar@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <utf32_isspace@plt>
test   %rax,%rax
jne    1140 <skipspace+0x10>
mov    %ebx,%edi
call   1030 <backchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @skipspace() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @inchar()
store i32 %3, i32* %1
%4 = call i64 @utf32_isspace(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @backchar(i32 %8)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @skipspace() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @inchar()
%3 = tail call i64 @utf32_isspace(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call i32 @backchar(i32 %2)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(int argc, char *argv[]) { printf("YOLO lol\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [9 x i8] c"YOLO lol\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void h_u16_to_be(uint8_t *buf, int val) {
  buf[0] = (uint8_t)(val >> 8);
  buf[1] = (uint8_t)(val >> 0);
}


x86 assembly (clang, -O0):
<h_u16_to_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_u16_to_be>:
movslq %esi,%rax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,(%rdi)
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @h_u16_to_be(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
store i64 %7, i64* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 0
%12 = sext i32 %11 to i64
%13 = load i64*, i64** %3
%14 = getelementptr inbounds i64, i64* %13, i64 1
store i64 %12, i64* %14
ret void
}

LLVM IR (-O2):
define void @h_u16_to_be(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = sext i32 %3 to i64
store i64 %4, i64* %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void imginf_help(void) {
  printf("\n"
         "imginf usage:\n"
         "   imginf [-v] [file1] [file2] ...\n"
         "\n"
         "   With no files given, imginf scans the current directory\n"
         "   Files given cannot be wildcards or directories\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"\0Aimginf usage:\0A imginf [-v] [file1] [file2] ...\0A\0A With no files given, imginf scans the current directory\0A Files given cannot be wildcards or directories\0A\0A\00"
define void @imginf_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [161 x i8] c"\0Aimginf usage:\0A imginf [-v] [file1] [file2] ...\0A\0A With no files given, imginf scans the current directory\0A Files given cannot be wildcards or directories\0A\00"
define void @imginf_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([161 x i8], [161 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ region_write(int, int, int, int);
void i2c_ack_toggle(int x) { region_write((0xE1800000), 0x1, 7, x); }


x86 assembly (clang, -O0):
<i2c_ack_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xe1800000,%edi
mov    $0x1,%esi
mov    $0x7,%edx
call   1030 <region_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_ack_toggle>:
mov    %edi,%ecx
mov    $0xe1800000,%edi
mov    $0x1,%esi
mov    $0x7,%edx
jmp    1030 <region_write@plt>

LLVM IR (-O0):
define void @i2c_ack_toggle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @region_write(i32 -511705088, i32 1, i32 7, i32 %3)
ret void
}

LLVM IR (-O2):
define void @i2c_ack_toggle(i32 %0) {
%2 = tail call i32 @region_write(i32 -511705088, i32 1, i32 7, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_prebuf_force() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_prebuf_force"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblockq_prebuf_force>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_memblockq_prebuf_force\0A\00"
define i32 @pa_memblockq_prebuf_force() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_memblockq_prebuf_force\00"
define i32 @pa_memblockq_prebuf_force() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void g_flags_get_value_by_nick() {}


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

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

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

LLVM IR (-O2):
define void @g_flags_get_value_by_nick() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello from link1\n");
  func1();
  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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <func1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"hello from link1\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @func1()
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"hello from link1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @func1()
ret i32 0
}
int test_imm_39int8_reg(signed char val) {
  return ((val) & (0x39 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_39int8_reg(i8 signext %0) {
%2 = and i8 %0, 57
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_font_button_set_show_style() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_button_set_show_style() {
ret void
}
int pipe(int fds[2]) {
  int r;
  __asm__ __volatile__("\tint $0x80\n"
                       : "=a"(r)
                       : "a"(42), "b"(fds)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x2a,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <set_errno@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2a,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i32 @pipe(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 42, i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pipe(i32* %0) {
%2 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 42, i32* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
void null_handler(void) { return; }


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

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

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

LLVM IR (-O2):
define void @null_handler() {
ret void
}
/* Variables and functions */
int link(char const *, char const *);
int octave_link_wrapper(const char *nm1, const char *nm2) {
  return link(nm1, nm2);
}


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

x86 assembly (clang, -O2):
<octave_link_wrapper>:
jmp    1030 <link@plt>

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

LLVM IR (-O2):
define i32 @octave_link_wrapper(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
struct t_config_file {
  int dummy;
};

/* Variables and functions */
int config_file_read_internal(struct t_config_file *, int /*<<< orphan*/);
int config_file_read(struct t_config_file *config_file) {
  return config_file_read_internal(config_file, 0);
}


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

x86 assembly (clang, -O2):
<config_file_read>:
xor    %esi,%esi
jmp    1030 <config_file_read_internal@plt>

LLVM IR (-O0):
%struct.t_config_file = type { i32 }
define i32 @config_file_read(%struct.t_config_file* %0) {
%2 = alloca %struct.t_config_file*
store %struct.t_config_file* %0, %struct.t_config_file** %2
%3 = load %struct.t_config_file*, %struct.t_config_file** %2
%4 = call i32 @config_file_read_internal(%struct.t_config_file* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.t_config_file = type { i32 }
define i32 @config_file_read(%struct.t_config_file* %0) {
%2 = tail call i32 @config_file_read_internal(%struct.t_config_file* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void generate_confirmation_file() {
  FILE *output = fopen("map2check_checked_error", "w");
  fprintf(output, "END OF TIME\n");
  fclose(output);
}


x86 assembly (clang, -O0):
<generate_confirmation_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_confirmation_file>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xecc(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"map2check_checked_error\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"END OF TIME\0A\00"
define void @generate_confirmation_file() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"map2check_checked_error\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"END OF TIME\0A\00"
define void @generate_confirmation_file() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
int gs1_compliant(int symbology) {
  int result = 0;
  switch (symbology) {
  case 16:
  case 31:
  case 81:
  case 130:
  case 131:
  case 132:
  case 133:
  case 134:
  case 135:
  case 136:
  case 137:
  case 138:
  case 139:
  case 23:
  case 92:
  case 71:
  case 141:
  case 24:
  case 58:
    result = 1;
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<gs1_compliant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffff0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7d,%eax
ja     113e <gs1_compliant+0x3e>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs1_compliant>:
xor    %eax,%eax
add    $0xfffffff0,%edi
cmp    $0x7d,%edi
ja     111f <gs1_compliant+0x1f>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @gs1_compliant(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 16, label %5
i32 31, label %5
i32 81, label %5
i32 130, label %5
i32 131, label %5
i32 132, label %5
i32 133, label %5
i32 134, label %5
i32 135, label %5
i32 136, label %5
i32 137, label %5
i32 138, label %5
i32 139, label %5
i32 23, label %5
i32 92, label %5
i32 71, label %5
i32 141, label %5
i32 24, label %5
i32 58, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %6
6: ; preds = %1, %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @gs1_compliant(i32 %0) {
switch i32 %0, label %3 [
i32 16, label %2
i32 31, label %2
i32 81, label %2
i32 130, label %2
i32 131, label %2
i32 132, label %2
i32 133, label %2
i32 134, label %2
i32 135, label %2
i32 136, label %2
i32 137, label %2
i32 138, label %2
i32 139, label %2
i32 23, label %2
i32 92, label %2
i32 71, label %2
i32 141, label %2
i32 24, label %2
i32 58, label %2
]
2: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 0, %1 ], [ 1, %2 ]
ret i32 %4
}
/* Variables and functions */
bool is_pow2(size_t n) { return (n & (n - 1)) == 0; }


x86 assembly (clang, -O0):
<is_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pow2>:
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_pow2(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = icmp ult i64 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}