xunge/DecIR huggingface dataset:
int f(int sum) {
  _Bool c = sum != 0;
  int d = c;
  g(d);
  if (d != 0)
    return 0 + g(0);
  if (c != 0)
    link_error();
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1030 <g@plt>
cmpl   $0x0,-0x10(%rbp)
je     116a <f+0x4a>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <g@plt>
add    $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <f+0x69>
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     1182 <f+0x62>
mov    $0x0,%al
call   1040 <link_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
xor    %eax,%eax
call   1030 <g@plt>
test   %ebx,%ebx
je     1130 <f+0x20>
xor    %edi,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <g@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @g to i32 (i32, ...)*)(i32 %3)
br i1 %2, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @g to i32 (i32, ...)*)(i32 0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write_break();
int /*<<< orphan*/ write_line(char *);
void ipf_para(void) {
  write_break();
  write_line(":p.");
}


x86 assembly (clang, -O0):
<ipf_para>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <write_break@plt>
lea    0xece(%rip),%rdi
call   1040 <write_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipf_para>:
push   %rax
xor    %eax,%eax
call   1030 <write_break@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <write_line@plt>

LLVM IR (-O0):
@.str = [4 x i8] c":p.\00"
define void @ipf_para() {
%1 = call i32 (...) @write_break()
%2 = call i32 @write_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c":p.\00"
define void @ipf_para() {
%1 = tail call i32 (...) @write_break()
%2 = tail call i32 @write_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
float dot3(const int *g, const float x, const float y, const float z) {
  return g[0] * x + g[1] * y + g[2] * z;
}


x86 assembly (clang, -O0):
<dot3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
movss  -0xc(%rbp),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm0
mulss  -0x10(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x8(%rax),%xmm0
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot3>:
cvtsi2ssl (%rdi),%xmm3
cvtsi2ssl 0x4(%rdi),%xmm4
mulss  %xmm1,%xmm4
xorps  %xmm1,%xmm1
cvtsi2ssl 0x8(%rdi),%xmm1
mulss  %xmm3,%xmm0
addss  %xmm4,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @dot3(i32* nocapture %0, float %1, float %2, float %3) {
%5 = load i32, i32* %0
%6 = sitofp i32 %5 to float
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to float
%10 = fmul float %9, %2
%11 = tail call float @llvm.fmuladd.f32(float %6, float %1, float %10)
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to float
%15 = tail call float @llvm.fmuladd.f32(float %14, float %3, float %11)
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void baz(float a, float b) {
  if (a == b)
    foo();
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    113e <baz+0x2e>
jp     113e <baz+0x2e>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
ucomiss %xmm1,%xmm0
jne    111e <baz+0xe>
jp     111e <baz+0xe>
xor    %eax,%eax
jmp    1030 <foo@plt>
ret

LLVM IR (-O0):
define void @baz(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @foo()
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @baz(float %0, float %1) {
%3 = fcmp oeq float %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_length_quaddobl_solution_string(int k, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(420, &k, n, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_length_quaddobl_solution_string>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1a4,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @solcon_length_quaddobl_solution_string(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 420, i32* %3, i32* %1, double* undef)
ret i32 %4
}
void vfs_clearmntopt(struct vfs *vfs, const char *s) {}


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

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

LLVM IR (-O0):
%struct.vfs = type opaque
define void @vfs_clearmntopt(%struct.vfs* %0, i8* %1) {
%3 = alloca %struct.vfs*
%4 = alloca i8*
store %struct.vfs* %0, %struct.vfs** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.vfs = type opaque
define void @vfs_clearmntopt(%struct.vfs* nocapture %0, i8* nocapture %1) {
ret void
}
double calc_swst(unsigned short swst_dn, double pri) {
  return ((double)swst_dn * 210.94e-09 + 9.0 * pri - 6.6E-6);
}


x86 assembly (clang, -O0):
<calc_swst>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movsd  %xmm0,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xef0(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xedb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_swst>:
cvtsi2sd %edi,%xmm1
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calc_swst(i16 zeroext %0, double %1) {
%3 = alloca i16
%4 = alloca double
store i16 %0, i16* %3
store double %1, double* %4
%5 = load i16, i16* %3
%6 = uitofp i16 %5 to double
%7 = load double, double* %4
%8 = fmul double 9.000000e+00, %7
%9 = call double @llvm.fmuladd.f64(double %6, double 2.109400e-07, double %8)
%10 = fsub double %9, 6.600000e-06
ret double %10
}

LLVM IR (-O2):
define double @calc_swst(i16 zeroext %0, double %1) {
%3 = uitofp i16 %0 to double
%4 = fmul double %1, 9.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %3, double 2.109400e-07, double %4)
%6 = fadd double %5, -6.600000e-06
ret double %6
}
int main(void) {
  int x = 5;
  *(char *)(&x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 5, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ atan(float);
float sdATan(float s) { return (float)atan(s) * (180.0 / 3.1415926535f); }


x86 assembly (clang, -O0):
<sdATan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atan@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdATan>:
push   %rax
call   1030 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sdATan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @atan(float %3)
%5 = sitofp i64 %4 to float
%6 = fpext float %5 to double
%7 = fmul double %6, 0x404CA5DC0D03CF26
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sdATan(float %0) {
%2 = tail call i64 @atan(float %0)
%3 = sitofp i64 %2 to float
%4 = fpext float %3 to double
%5 = fmul double %4, 0x404CA5DC0D03CF26
%6 = fptrunc double %5 to float
ret float %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
bool get_bit(uint8_t hex, uint8_t pos) {
  if ((pos < 0) || (pos > 7)) {
    printf("Bad position.\n");
    return 0;
  }
  return (hex & (1 << pos));
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1132 <get_bit+0x22>
cmpl   $0x7,-0xc(%rbp)
jle    114a <get_bit+0x3a>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    115e <get_bit+0x4e>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
cmp    $0x8,%esi
jb     1129 <get_bit+0x19>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
mov    %esi,%ecx
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Bad position.\0A\00"
define i32 @get_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 7
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
13: ; preds = %8
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = shl i32 1, %15
%17 = and i32 %14, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [14 x i8] c"Bad position.\00"
define i32 @get_bit(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 7
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = shl nuw nsw i32 1, %1
%8 = and i32 %7, %0
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %4 ], [ %8, %6 ]
ret i32 %10
}
/* Variables and functions */
char *PICA_id_to_base64(unsigned char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int accept_cb(const unsigned char *id) {
  printf("accept_cb: %s\n", PICA_id_to_base64(id, NULL));
  return 1;
}


x86 assembly (clang, -O0):
<accept_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <PICA_id_to_base64@plt>
mov    %rax,%rsi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_cb>:
push   %rax
xor    %esi,%esi
call   1030 <PICA_id_to_base64@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"accept_cb: %s\0A\00"
define i32 @accept_cb(i8* %0) {
%2 = tail call i8* @PICA_id_to_base64(i8* %0, i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 1
}
/* Type definitions */
struct message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ log_add(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ message_get_byte(struct message *);
int /*<<< orphan*/ on_recv_message(void *, struct message *);
void on_recv_first_message(void *handle, struct message *msg) {
  log_add("INFO", "on_recv_first message: protocol id = %02X",
          message_get_byte(msg));
  on_recv_message(handle, msg);
}


x86 assembly (clang, -O0):
<on_recv_first_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <message_get_byte@plt>
mov    %eax,%edx
lea    0xeae(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1030 <log_add@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <on_recv_message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_recv_first_message>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <message_get_byte@plt>
lea    0xeb7(%rip),%rdi
lea    0xeb5(%rip),%rsi
mov    %eax,%edx
call   1030 <log_add@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <on_recv_message@plt>

LLVM IR (-O0):
%struct.message = type { i32 }
@.str = [5 x i8] c"INFO\00"
@.str.1 = [42 x i8] c"on_recv_first message: protocol id = %02X\00"
define void @on_recv_first_message(i8* %0, %struct.message* %1) {
%3 = alloca i8*
%4 = alloca %struct.message*
store i8* %0, i8** %3
store %struct.message* %1, %struct.message** %4
%5 = load %struct.message*, %struct.message** %4
%6 = call i32 @message_get_byte(%struct.message* %5)
%7 = call i32 @log_add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = load %struct.message*, %struct.message** %4
%10 = call i32 @on_recv_message(i8* %8, %struct.message* %9)
ret void
}

LLVM IR (-O2):
%struct.message = type { i32 }
@.str = [5 x i8] c"INFO\00"
@.str.1 = [42 x i8] c"on_recv_first message: protocol id = %02X\00"
define void @on_recv_first_message(i8* %0, %struct.message* %1) {
%3 = tail call i32 @message_get_byte(%struct.message* %1)
%4 = tail call i32 @log_add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @on_recv_message(i8* %0, %struct.message* %1)
ret void
}
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
scalar_t__ memcmp(struct in6_addr const *, unsigned char *, int);
int linklocal(const struct in6_addr *addr) {
  unsigned char ll[8] = {0xfe, 0x80, 0, 0, 0, 0, 0, 0};
  return (memcmp(addr, ll, 8) == 0);
}


x86 assembly (clang, -O0):
<linklocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linklocal>:
push   %rax
movq   $0x80fe,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
@__const.linklocal.ll = [8 x i8] c"\FE\80\00\00\00\00\00\00"
define i32 @linklocal(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
%3 = alloca [8 x i8]
store %struct.in6_addr* %0, %struct.in6_addr** %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = load %struct.in6_addr*, %struct.in6_addr** %2
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = call i64 @memcmp(%struct.in6_addr* %5, i8* %6, i32 8)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @linklocal(%struct.in6_addr* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 33022, i64* %2
%4 = call i64 @memcmp(%struct.in6_addr* %0, i8* %3, i32 8)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *);
void serv_join_chat(int exchange, char *name) {
  char buf[2048 * 2];
  snprintf(buf, sizeof(buf) / 2, "toc_chat_join %d \"%s\"", exchange, name);
  sflap_send(buf, -1, 2);
}


x86 assembly (clang, -O0):
<serv_join_chat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x800,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x1010(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_join_chat>:
push   %rbx
sub    $0x1000,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x800,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"toc_chat_join %d \22%s\22\00"
define void @serv_join_chat(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [4096 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 2048, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%11 = call i32 @sflap_send(i8* %10, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"toc_chat_join %d \22%s\22\00"
define void @serv_join_chat(i32 %0, i8* %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 2048, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = call i32 @sflap_send(i8* %4, i32 -1, i32 2)
ret void
}
/* Variables and functions */
int GLUT_DOWN;
int /*<<< orphan*/ onMouse(int, int);
void onMouseClick(int btn, int state, int x, int y) {
  if (state == GLUT_DOWN)
    onMouse(x, y);
}


x86 assembly (clang, -O0):
<onMouseClick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%eax
jne    1141 <onMouseClick+0x31>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <onMouse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onMouseClick>:
mov    0x2ed1(%rip),%rax
cmp    %esi,(%rax)
jne    1124 <onMouseClick+0x14>
mov    %edx,%edi
mov    %ecx,%esi
jmp    1030 <onMouse@plt>
ret

LLVM IR (-O0):
@GLUT_DOWN = global i32 0
define void @onMouseClick(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* @GLUT_DOWN
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @onMouse(i32 %13, i32 %14)
br label %16
16: ; preds = %12, %4
ret void
}

LLVM IR (-O2):
@GLUT_DOWN = global i32 0
define void @onMouseClick(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @GLUT_DOWN
%6 = icmp eq i32 %5, %1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @onMouse(i32 %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scrputs(char *);
void csrhide(void) { scrputs("\033[?25l"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @csrhide() {
%1 = call i32 @scrputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @csrhide() {
%1 = tail call i32 @scrputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _asn1_check_infinite_end(unsigned char const **, long);
int ASN1_const_check_infinite_end(const unsigned char **p, long len) {
  return _asn1_check_infinite_end(p, len);
}


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

x86 assembly (clang, -O2):
<ASN1_const_check_infinite_end>:
jmp    1030 <_asn1_check_infinite_end@plt>

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

LLVM IR (-O2):
define i32 @ASN1_const_check_infinite_end(i8** %0, i64 %1) {
%3 = tail call i32 @_asn1_check_infinite_end(i8** %0, i64 %1)
ret i32 %3
}
void hal_enable_preemption() {}


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

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

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

LLVM IR (-O2):
define void @hal_enable_preemption() {
ret void
}
/* Variables and functions */
int mspace_mallopt(int, int);
int pt3mallopt(int p, int v) {
  int result;
  result = mspace_mallopt(p, v);
  return result;
}


x86 assembly (clang, -O0):
<pt3mallopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mspace_mallopt@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt3mallopt>:
jmp    1030 <mspace_mallopt@plt>

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

LLVM IR (-O2):
define i32 @pt3mallopt(i32 %0, i32 %1) {
%3 = tail call i32 @mspace_mallopt(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: test_regions "
                        " {r,w} <offset> <nbytes> <path>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: test_regions {r,w} <offset> <nbytes> <path>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: test_regions {r,w} <offset> <nbytes> <path>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned long div15(unsigned long const);
unsigned long int mod15(unsigned long int const i) {
  unsigned long int const division = div15(i);
  return i - ((division << 4) - division);
}


x86 assembly (clang, -O0):
<mod15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <div15@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
sub    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod15>:
push   %rbx
mov    %rdi,%rbx
call   1030 <div15@plt>
mov    %rax,%rcx
shl    $0x4,%rcx
sub    %rcx,%rax
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @mod15(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @div15(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = shl i64 %7, 4
%9 = load i64, i64* %3
%10 = sub i64 %8, %9
%11 = sub i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @mod15(i64 %0) {
%2 = tail call i64 @div15(i64 %0)
%3 = mul i64 %2, -15
%4 = add i64 %3, %0
ret i64 %4
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
char *get(struct page *, size_t);
void *memcpy(char *, void const *, size_t);
void *mdup(struct page *page, const void *src, size_t len) {
  char *dst = get(page, len);
  return (dst) ? memcpy(dst, src, len) : 0;
}


x86 assembly (clang, -O0):
<mdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <get@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116a <mdup+0x4a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    %rax,-0x28(%rbp)
jmp    1175 <mdup+0x55>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1175 <mdup+0x55>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdx,%rsi
call   1040 <get@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <mdup+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.page = type { i32 }
define i8* @mdup(%struct.page* %0, i8* %1, i64 %2) {
%4 = alloca %struct.page*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.page* %0, %struct.page** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.page*, %struct.page** %4
%9 = load i64, i64* %6
%10 = call i8* @get(%struct.page* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i8*, i8** %7
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i8* @memcpy(i8* %14, i8* %15, i64 %16)
br label %19
18: ; preds = %3
br label %19
19: ; preds = %18, %13
%20 = phi i8* [ %17, %13 ], [ null, %18 ]
ret i8* %20
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i8* @mdup(%struct.page* %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @get(%struct.page* %0, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %1, i64 %2, i1 false)
br label %7
7: ; preds = %3, %6
ret i8* %4
}
/* Variables and functions */
double atan2(double, double);
double qATan2(double y, double x) { return atan2(y, x); }


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

x86 assembly (clang, -O2):
<qATan2>:
jmp    1030 <atan2@plt>

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

LLVM IR (-O2):
define double @qATan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdin;
void get_input(char *buf, const char *prompt) {
  memset(buf, 0, 0x400);
  printf("%s: ", prompt);
  fgets(buf, 0x400, stdin);
}


x86 assembly (clang, -O0):
<get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    0xeb3(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fgets@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@stdin = global i32 0
define void @get_input(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 = call i32 @memset(i8* %5, i32 0, i32 1024)
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 1024, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@stdin = global i32 0
define void @get_input(i8* %0, i8* %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 1024)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = load i32, i32* @stdin
%6 = tail call i32 @fgets(i8* %0, i32 1024, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void start_new_sequence(__u32 *start, int *len, __u32 new) {
  *start = new;
  *len = 1;
}


x86 assembly (clang, -O0):
<start_new_sequence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_new_sequence>:
mov    %edx,(%rdi)
movl   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @start_new_sequence(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2) {
store i32 %2, i32* %0
store i32 1, i32* %1
ret void
}
void fun(char a[]) {
  char *p, *q = a;
  for (p = a; *p; p++, p++)
    if (*p % 2 != 0)
      *q = *p;
  *q = 0;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <fun+0x6b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1149 <fun+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    114e <fun+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <fun+0x18>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    (%rdi),%al
test   %al,%al
je     1123 <fun+0x23>
lea    0x2(%rdi),%rcx
jmp    111b <fun+0x1b>
nopl   0x0(%rax)
movzbl (%rcx),%eax
add    $0x2,%rcx
test   %al,%al
je     1123 <fun+0x23>
test   $0x1,%al
je     1110 <fun+0x10>
mov    %al,(%rdi)
jmp    1110 <fun+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @fun(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = and i8 %5, 1
%8 = icmp eq i8 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %4
store i8 %5, i8* %0
br label %10
10: ; preds = %4, %9
%11 = getelementptr inbounds i8, i8* %6, i64 2
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %10, %1
store i8 0, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SPI3_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @SPI3_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @SPI3_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int readAndTokenizeRNAs(char **);
int /*<<< orphan*/ readEvenOdd();
int /*<<< orphan*/ tokenizeNames(int);
int getInput(char **strArray1) {
  int numOfRNA = readAndTokenizeRNAs(strArray1);
  tokenizeNames(numOfRNA);
  readEvenOdd();
  return numOfRNA;
}


x86 assembly (clang, -O0):
<getInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <readAndTokenizeRNAs@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <tokenizeNames@plt>
mov    $0x0,%al
call   1050 <readEvenOdd@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInput>:
push   %rbx
call   1040 <readAndTokenizeRNAs@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <tokenizeNames@plt>
xor    %eax,%eax
call   1050 <readEvenOdd@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getInput(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i32 @readAndTokenizeRNAs(i8** %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @tokenizeNames(i32 %6)
%8 = call i32 (...) @readEvenOdd()
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @getInput(i8** %0) {
%2 = tail call i32 @readAndTokenizeRNAs(i8** %0)
%3 = tail call i32 @tokenizeNames(i32 %2)
%4 = tail call i32 (...) @readEvenOdd()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200];
  scanf("%99s", word);
  printf("%ld", hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%99s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @hash(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%99s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "find_levent [-full] [-def] <dumpfile.bin> <base address>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"find_levent [-full] [-def] <dumpfile.bin> <base address>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"find_levent [-full] [-def] <dumpfile.bin> <base address>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dungeon_run(int);
int /*<<< orphan*/ init();
void main(void) {
  init();
  while (1) {
    dungeon_run(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x1,%edi
call   1030 <dungeon_run@plt>
jmp    112b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <dungeon_run@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @init()
br label %2
2: ; preds = %0, %2
%3 = call i32 @dungeon_run(i32 1)
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @dungeon_run(i32 1)
br label %2
}
void end_resp_from_server(void) {}


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

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

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

LLVM IR (-O2):
define void @end_resp_from_server() {
ret void
}
OP(fd, f3) { op_f3(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_f3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_f3()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
unsigned about() {
  puts("SASM (Simplex Assembler)"
       " [ "
       "v0.1"
       " ] by InternetBowser\n");
  return (1 << 1);
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"SASM (Simplex Assembler) [ v0.1 ] by InternetBowser\0A\00"
define i32 @about() {
%1 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@.str = [53 x i8] c"SASM (Simplex Assembler) [ v0.1 ] by InternetBowser\0A\00"
define i32 @about() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int getchar();
int leerTexto(char string[]) {
  int c, i = 0;
  while ((c = getchar()) != '\n')
    string[i++] = c;
  string[i] = 0;
  return i;
}


x86 assembly (clang, -O0):
<leerTexto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1155 <leerTexto+0x45>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1123 <leerTexto+0x13>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leerTexto>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1144 <leerTexto+0x34>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
jne    1130 <leerTexto+0x20>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @leerTexto(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ %2, %1 ]
%7 = trunc i32 %6 to i8
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %7, i8* %9
%10 = tail call i32 (...) @getchar()
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = trunc i64 %8 to i32
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ 0, %1 ], [ %13, %12 ]
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i32 %15
}
void *brick_init(void *xl, struct gf_brick_spec *brick) { return brick; }


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

x86 assembly (clang, -O2):
<brick_init>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
%struct.gf_brick_spec = type opaque
define i8* @brick_init(i8* %0, %struct.gf_brick_spec* %1) {
%3 = alloca i8*
%4 = alloca %struct.gf_brick_spec*
store i8* %0, i8** %3
store %struct.gf_brick_spec* %1, %struct.gf_brick_spec** %4
%5 = load %struct.gf_brick_spec*, %struct.gf_brick_spec** %4
%6 = bitcast %struct.gf_brick_spec* %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
%struct.gf_brick_spec = type opaque
define i8* @brick_init(i8* nocapture readnone %0, %struct.gf_brick_spec* readnone %1) {
%3 = bitcast %struct.gf_brick_spec* %1 to i8*
ret i8* %3
}