xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gmx_angle(int, char **);
int main(int argc, char *argv[]) {
  gmx_angle(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_angle(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
struct j_state {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ i_instr_ri(struct j_state *, int /*<<< orphan*/, int, int,
                              int /*<<< orphan*/);
void i_cmp_id(struct j_state *s, int reg, int32_t imm) {
  i_instr_ri(s, 0, 7, reg, imm);
}


x86 assembly (clang, -O0):
<i_cmp_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <i_instr_ri@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_cmp_id>:
mov    %edx,%r8d
mov    %esi,%ecx
xor    %esi,%esi
mov    $0x7,%edx
jmp    1030 <i_instr_ri@plt>

LLVM IR (-O0):
%struct.j_state = type { i32 }
define void @i_cmp_id(%struct.j_state* %0, i32 %1, i32 %2) {
%4 = alloca %struct.j_state*
%5 = alloca i32
%6 = alloca i32
store %struct.j_state* %0, %struct.j_state** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.j_state*, %struct.j_state** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @i_instr_ri(%struct.j_state* %7, i32 0, i32 7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.j_state = type { i32 }
define void @i_cmp_id(%struct.j_state* %0, i32 %1, i32 %2) {
%4 = tail call i32 @i_instr_ri(%struct.j_state* %0, i32 0, i32 7, i32 %1, i32 %2)
ret void
}
int is_big_endian(void) {
  static const int n = 1;
  return ((const char *)&n)[0] == 0;
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xef5(%rip),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@is_big_endian.n = internal constant i32 1
define i32 @is_big_endian() {
%1 = load i8, i8* bitcast (i32* @is_big_endian.n to i8*)
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int /*<<< orphan*/ d();
int /*<<< orphan*/ e();
int /*<<< orphan*/ f();
int /*<<< orphan*/ inc();
int main(void) {
  a();
  b();
  c();
  d();
  e();
  f();
  inc();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <a@plt>
mov    $0x0,%al
call   1040 <b@plt>
mov    $0x0,%al
call   1070 <c@plt>
mov    $0x0,%al
call   1030 <d@plt>
mov    $0x0,%al
call   1060 <e@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1090 <inc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <a@plt>
xor    %eax,%eax
call   1040 <b@plt>
xor    %eax,%eax
call   1070 <c@plt>
xor    %eax,%eax
call   1030 <d@plt>
xor    %eax,%eax
call   1060 <e@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1090 <inc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a()
%3 = call i32 (...) @b()
%4 = call i32 (...) @c()
%5 = call i32 (...) @d()
%6 = call i32 (...) @e()
%7 = call i32 (...) @f()
%8 = call i32 (...) @inc()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @b()
%3 = tail call i32 (...) @c()
%4 = tail call i32 (...) @d()
%5 = tail call i32 (...) @e()
%6 = tail call i32 (...) @f()
%7 = tail call i32 (...) @inc()
ret i32 0
}
/* Variables and functions */
double rsqrt(double);
int main() {
  double a = 3.0093288174342917e-36;
  double rsqrt_a = rsqrt(a);
  return rsqrt_a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <rsqrt@plt>
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <rsqrt@plt>
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0x389000160CB46D26, double* %2
%4 = load double, double* %2
%5 = call double @rsqrt(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @rsqrt(double 0x389000160CB46D26)
%2 = fptosi double %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void help() {
  const char *str = "tcp server/client 192.168.1.1 5060";
  printf("%s\n", str);
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [35 x i8] c"tcp server/client 192.168.1.1 5060\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"tcp server/client 192.168.1.1 5060\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_DAuint32_reg(unsigned int val) {
  return ((val) & (0xDA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DAuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xda,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DAuint32_reg(i32 %0) {
%2 = and i32 %0, 218
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FLASH_defaultmode_2xclock();
void flp_init() { FLASH_defaultmode_2xclock(); }


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

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

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

LLVM IR (-O2):
define void @flp_init() {
%1 = tail call i32 (...) @FLASH_defaultmode_2xclock()
ret void
}
/* Type definitions */
struct object {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
struct node *createNode(struct object *);
struct object *createObject(int, char *);
struct node *createTestNode(int jobid) {
  struct object *job = createObject(jobid, "cmd args");
  struct node *node = createNode(job);
  return node;
}


x86 assembly (clang, -O0):
<createTestNode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <createObject@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <createNode@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createTestNode>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <createObject@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <createNode@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.object = type { i32 }
@.str = [9 x i8] c"cmd args\00"
define %struct.node* @createTestNode(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.object*
%4 = alloca %struct.node*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call %struct.object* @createObject(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store %struct.object* %6, %struct.object** %3
%7 = load %struct.object*, %struct.object** %3
%8 = call %struct.node* @createNode(%struct.object* %7)
store %struct.node* %8, %struct.node** %4
%9 = load %struct.node*, %struct.node** %4
ret %struct.node* %9
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.object = type { i32 }
@.str = [9 x i8] c"cmd args\00"
define %struct.node* @createTestNode(i32 %0) {
%2 = tail call %struct.object* @createObject(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call %struct.node* @createNode(%struct.object* %2)
ret %struct.node* %3
}
int throw(int amount, int *stack, int curr, int n) {
  stack[curr + 1] = (stack[curr] + (10001 * n) + amount) % n;
  return curr + 1;
}


x86 assembly (clang, -O0):
<throw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
imul   $0x2711,-0x18(%rbp),%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<throw>:
movslq %edx,%r8
imul   $0x2711,%ecx,%eax
add    %edi,%eax
add    (%rsi,%r8,4),%eax
cltd
idiv   %ecx
lea    0x1(%r8),%eax
mov    %edx,0x4(%rsi,%r8,4)
ret

LLVM IR (-O0):
define i32 @throw(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* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %8
%15 = mul nsw i32 10001, %14
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %8
%20 = srem i32 %18, %19
%21 = load i32*, i32** %6
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
store i32 %20, i32* %25
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
ret i32 %27
}

LLVM IR (-O2):
define i32 @throw(i32 %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = mul nsw i32 %3, 10001
%9 = add i32 %8, %0
%10 = add i32 %9, %7
%11 = srem i32 %10, %3
%12 = add nsw i32 %2, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %1, i64 %13
store i32 %11, i32* %14
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void Print(char *Message) { fprintf(stdout, "%s\n", Message); }


x86 assembly (clang, -O0):
<Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @Print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float quartic_in(float, float, float);
float quartic_f_in(float step, float max_steps, float max_val) {
  return quartic_in(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<quartic_f_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <quartic_in@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quartic_f_in>:
jmp    1030 <quartic_in@plt>

LLVM IR (-O0):
define float @quartic_f_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @quartic_in(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @quartic_f_in(float %0, float %1, float %2) {
%4 = tail call float @quartic_in(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int _w_error(char *message, int ret) {
  fputs("w"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_w_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_w_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"w: \00"
@stderr = global i32 0
define i32 @_w_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"w: \00"
@stderr = global i32 0
define i32 @_w_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ _Exit(int /*<<< orphan*/);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void abort(void) {
  raise(SIGABRT);
  _Exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <_Exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <_Exit@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@EXIT_FAILURE = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @_Exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@EXIT_FAILURE = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @_Exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ d86f_common_format(int, int, int, int /*<<< orphan*/,
                                      int /*<<< orphan*/);
void d86f_format(int drive, int side, int rate, uint8_t fill) {
  d86f_common_format(drive, side, rate, fill, 0);
}


x86 assembly (clang, -O0):
<d86f_format>:
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    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <d86f_common_format@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d86f_format>:
xor    %r8d,%r8d
jmp    1030 <d86f_common_format@plt>

LLVM IR (-O0):
define void @d86f_format(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* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @d86f_common_format(i32 %9, i32 %10, i32 %11, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
define void @d86f_format(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @d86f_common_format(i32 %0, i32 %1, i32 %2, i32 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((__always___)) void chpl_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<chpl_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @chpl_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
unsigned int serial_setbaud_(unsigned char volatile *, unsigned int);
unsigned int serial_setbaud(int channel, unsigned int baudrate) {
  if (channel == 0)
    return serial_setbaud_(((volatile unsigned char *)0xE000C000), baudrate);
  if (channel == 1)
    return serial_setbaud_(((volatile unsigned char *)0xE0010000), baudrate);
  return 0;
}


x86 assembly (clang, -O0):
<serial_setbaud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113d <serial_setbaud+0x2d>
mov    -0xc(%rbp),%esi
mov    $0xe000c000,%edi
call   1030 <serial_setbaud_@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <serial_setbaud+0x53>
cmpl   $0x1,-0x8(%rbp)
jne    115c <serial_setbaud+0x4c>
mov    -0xc(%rbp),%esi
mov    $0xe0010000,%edi
call   1030 <serial_setbaud_@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <serial_setbaud+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_setbaud>:
mov    %edi,%eax
mov    $0xe000c000,%edi
test   %eax,%eax
je     1127 <serial_setbaud+0x17>
cmp    $0x1,%eax
jne    112c <serial_setbaud+0x1c>
add    $0x4000,%rdi
jmp    1030 <serial_setbaud_@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @serial_setbaud(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i32 @serial_setbaud_(i8* inttoptr (i64 3758145536 to i8*), i32 %9)
store i32 %10, i32* %3
br label %18
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %5
%16 = call i32 @serial_setbaud_(i8* inttoptr (i64 3758161920 to i8*), i32 %15)
store i32 %16, i32* %3
br label %18
17: ; preds = %11
store i32 0, i32* %3
br label %18
18: ; preds = %17, %14, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @serial_setbaud(i32 %0, i32 %1) {
switch i32 %0, label %7 [
i32 0, label %4
i32 1, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %2, %3
%5 = phi i8* [ inttoptr (i64 3758161920 to i8*), %3 ], [ inttoptr (i64 3758145536 to i8*), %2 ]
%6 = tail call i32 @serial_setbaud_(i8* %5, i32 %1)
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ 0, %2 ], [ %6, %4 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ unlink(char *);
void sighandler(int num) {
  printf("get signal %d, exit..\n", num);
  unlink("/tmp/sock.listen");
  exit(0);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <unlink@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <unlink@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"get signal %d, exit..\0A\00"
@.str.1 = [17 x i8] c"/tmp/sock.listen\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"get signal %d, exit..\0A\00"
@.str.1 = [17 x i8] c"/tmp/sock.listen\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void flush_to_eol(int c) {
  if (((c) == '\n'))
    return;
  while (!((c) == '\n')) {
    c = fgetc(stdin);
  }
}


x86 assembly (clang, -O0):
<flush_to_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112a <flush_to_eol+0x1a>
jmp    115b <flush_to_eol+0x4b>
jmp    112f <flush_to_eol+0x1f>
cmpl   $0xa,-0x4(%rbp)
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <flush_to_eol+0x35>
jmp    115b <flush_to_eol+0x4b>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,-0x4(%rbp)
jmp    112f <flush_to_eol+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_to_eol>:
push   %rbx
cmp    $0xa,%edi
je     112c <flush_to_eol+0x1c>
mov    0x2ecb(%rip),%rbx
nopl   (%rax)
mov    (%rbx),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
jne    1120 <flush_to_eol+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define void @flush_to_eol(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgetc(i32 %4)
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
void element2BSR() {}


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

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

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

LLVM IR (-O2):
define void @element2BSR() {
ret void
}
void MSP430ClockM$MSP430ClockInit$initClocks(void) {
  MSP430ClockM$MSP430ClockInit$default$initClocks();
}


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

x86 assembly (clang, -O2):
<MSP430ClockM$MSP430ClockInit$initClocks>:
xor    %eax,%eax
jmp    1030 <MSP430ClockM$MSP430ClockInit$default$initClocks@plt>

LLVM IR (-O0):
define void @"MSP430ClockM$MSP430ClockInit$initClocks"() {
%1 = call i32 (...) @"MSP430ClockM$MSP430ClockInit$default$initClocks"()
ret void
}

LLVM IR (-O2):
define void @"MSP430ClockM$MSP430ClockInit$initClocks"() {
%1 = tail call i32 (...) @"MSP430ClockM$MSP430ClockInit$default$initClocks"()
ret void
}
char *strcpy(char *dst, const char *src) {
  while ((*dst++ = *src++))
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcpy+0x3b>
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %8
}
void counter$output$init(void) {
  int_to_leds_m$input$init();
  int_to_rfm_m$input$init();
}


x86 assembly (clang, -O0):
<counter$output$init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <int_to_leds_m$input$init@plt>
mov    $0x0,%al
call   1030 <int_to_rfm_m$input$init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter$output$init>:
push   %rax
xor    %eax,%eax
call   1040 <int_to_leds_m$input$init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <int_to_rfm_m$input$init@plt>

LLVM IR (-O0):
define void @"counter$output$init"() {
%1 = call i32 (...) @"int_to_leds_m$input$init"()
%2 = call i32 (...) @"int_to_rfm_m$input$init"()
ret void
}

LLVM IR (-O2):
define void @"counter$output$init"() {
%1 = tail call i32 (...) @"int_to_leds_m$input$init"()
%2 = tail call i32 (...) @"int_to_rfm_m$input$init"()
ret void
}
/* Variables and functions */
char *_strdup(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strdupa(char *s) {
  if (s)
    fprintf(stderr, "TODO:Leaking string '%s'\n", s);
  return _strdup(s);
}


x86 assembly (clang, -O0):
<strdupa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <strdupa+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupa>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1141 <strdupa+0x21>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <_strdup@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"TODO:Leaking string '%s'\0A\00"
define i8* @strdupa(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = load i8*, i8** %2
%11 = call i8* @_strdup(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"TODO:Leaking string '%s'\0A\00"
define i8* @strdupa(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i8* @_strdup(i8* %0)
ret i8* %7
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, int);
char *get_audit_database_filename(void) {
  static char audit_database_filename[128];
  sprintf(audit_database_filename, "/tmp/csvdump_fork_audit_database_%d",
          getpid());
  return audit_database_filename;
}


x86 assembly (clang, -O0):
<get_audit_database_filename>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edx
lea    0x2f0c(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ef9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_audit_database_filename>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_audit_database_filename.audit_database_filename = internal global [128 x i8] zeroinitializer
@.str = [36 x i8] c"/tmp/csvdump_fork_audit_database_%d\00"
define i8* @get_audit_database_filename() {
%1 = call i32 (...) @getpid()
%2 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_audit_database_filename.audit_database_filename, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_audit_database_filename.audit_database_filename, i64 0, i64 0)
}

LLVM IR (-O2):
@get_audit_database_filename.audit_database_filename = internal global [128 x i8] zeroinitializer
@.str = [36 x i8] c"/tmp/csvdump_fork_audit_database_%d\00"
define i8* @get_audit_database_filename() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @get_audit_database_filename.audit_database_filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_audit_database_filename.audit_database_filename, i64 0, i64 0)
}
void omap_vout_release_vrfb(struct omap_vout_device *vout) {}


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

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

LLVM IR (-O0):
%struct.omap_vout_device = type opaque
define void @omap_vout_release_vrfb(%struct.omap_vout_device* %0) {
%2 = alloca %struct.omap_vout_device*
store %struct.omap_vout_device* %0, %struct.omap_vout_device** %2
ret void
}

LLVM IR (-O2):
%struct.omap_vout_device = type opaque
define void @omap_vout_release_vrfb(%struct.omap_vout_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ baz(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void bar(jmp_buf buf) {
  printf("Inside bar\n");
  baz(buf);
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
@str = [11 x i8] c"Inside bar\00"
define void @bar(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @baz(i32 %0)
ret void
}
int raise(int signum) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
ret i32 0
}
void swap(char *a, char *b) {
  char temp = *a;
  *a = *b;
  *b = temp;
}


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

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

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(long);
void set_alarm(long seconds) { alarm(seconds); }


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

x86 assembly (clang, -O2):
<set_alarm>:
jmp    1030 <alarm@plt>

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

LLVM IR (-O2):
define void @set_alarm(i64 %0) {
%2 = tail call i32 @alarm(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RGB2XYZ(int, int, int, int *, int *, int *);
int /*<<< orphan*/ XYZ2Lab(int, int, int, int *, int *, int *);
void RGB2Lab(int B, int G, int R, int *L, int *a, int *b) {
  int X, Y, Z;
  RGB2XYZ(B, G, R, &X, &Y, &Z);
  XYZ2Lab(X, Y, Z, L, a, b);
}


x86 assembly (clang, -O0):
<RGB2Lab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x2c(%rbp),%rcx
lea    -0x30(%rbp),%r8
lea    -0x34(%rbp),%r9
call   1040 <RGB2XYZ@plt>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <XYZ2Lab@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB2Lab>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
call   1040 <RGB2XYZ@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1030 <XYZ2Lab@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @RGB2Lab(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = call i32 @RGB2XYZ(i32 %16, i32 %17, i32 %18, i32* %13, i32* %14, i32* %15)
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = load i32, i32* %15
%23 = load i32*, i32** %10
%24 = load i32*, i32** %11
%25 = load i32*, i32** %12
%26 = call i32 @XYZ2Lab(i32 %20, i32 %21, i32 %22, i32* %23, i32* %24, i32* %25)
ret void
}

LLVM IR (-O2):
define void @RGB2Lab(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = bitcast i32* %7 to i8*
%11 = bitcast i32* %8 to i8*
%12 = bitcast i32* %9 to i8*
%13 = call i32 @RGB2XYZ(i32 %0, i32 %1, i32 %2, i32* %7, i32* %8, i32* %9)
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = call i32 @XYZ2Lab(i32 %14, i32 %15, i32 %16, i32* %3, i32* %4, i32* %5)
ret void
}
int console_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LIB_EventQueue_Run();
void APP_Main(void) {
  while (1) {
    LIB_EventQueue_Run();
  }
}


x86 assembly (clang, -O0):
<APP_Main>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <APP_Main+0x9>
mov    $0x0,%al
call   1030 <LIB_EventQueue_Run@plt>
jmp    1119 <APP_Main+0x9>

x86 assembly (clang, -O2):
<APP_Main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <LIB_EventQueue_Run@plt>
jmp    1120 <APP_Main+0x10>

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

LLVM IR (-O2):
define void @APP_Main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @LIB_EventQueue_Run()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void my_putstr(char *str) {
  int i;
  i = 0;
  while (*(str + i) != '\0') {
    my_putchar(*(str + i));
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <my_putstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <my_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <my_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <my_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @my_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ is_digit(char const);
int __digit_len(const char *s) {
  int l;
  for (l = 0; is_digit(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__digit_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_digit@plt>
cmp    $0x0,%rax
je     1153 <__digit_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__digit_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__digit_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_digit@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__digit_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_digit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__digit_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__digit_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_digit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_digit(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
char *hash_plugin_detailed(void) {
  return ("lastpass - LastPass keychain plugin\n"
          "------------------------\n"
          "Use this module to crack LastPass master passwords\n"
          "Input should be in form: \'lastpass:email:1|loginhash\' \n"
          "You can use the lastpass2hashkill tool to scan for keychains \n"
          "Known software that uses this password hashing method:\n"
          "LastPass Password Manager\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [356 x i8] c"lastpass - LastPass keychain plugin\0A------------------------\0AUse this module to crack LastPass master passwords\0AInput should be in form: 'lastpass:email:1|loginhash' \0AYou can use the lastpass2hashkill tool to scan for keychains \0AKnown software that uses this password hashing method:\0ALastPass Password Manager\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([356 x i8], [356 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [356 x i8] c"lastpass - LastPass keychain plugin\0A------------------------\0AUse this module to crack LastPass master passwords\0AInput should be in form: 'lastpass:email:1|loginhash' \0AYou can use the lastpass2hashkill tool to scan for keychains \0AKnown software that uses this password hashing method:\0ALastPass Password Manager\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([356 x i8], [356 x i8]* @.str, i64 0, i64 0)
}
unsigned sumOfNPairsNaturalNumbers(unsigned number) {
  unsigned result = 0;
  int i = 2, counter = 0;
  while (counter < number) {
    if (i % 2 == 0) {
      result += i;
      counter++;
    }
    i++;
  }
  return result;
}


x86 assembly (clang, -O0):
<sumOfNPairsNaturalNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    115c <sumOfNPairsNaturalNumbers+0x5c>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114e <sumOfNPairsNaturalNumbers+0x4e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <sumOfNPairsNaturalNumbers+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOfNPairsNaturalNumbers>:
test   %edi,%edi
je     112e <sumOfNPairsNaturalNumbers+0x2e>
mov    $0x2,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
xchg   %ax,%ax
mov    %ecx,%esi
and    $0x1,%esi
mov    $0x0,%edx
cmove  %ecx,%edx
add    %edx,%eax
xor    $0x1,%esi
add    %esi,%r8d
add    $0x1,%ecx
cmp    %edi,%r8d
jb     1110 <sumOfNPairsNaturalNumbers+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sumOfNPairsNaturalNumbers(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 2, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %4
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = add i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %20
20: ; preds = %14, %10
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @sumOfNPairsNaturalNumbers(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %12, %3 ], [ 0, %1 ]
%5 = phi i32 [ %13, %3 ], [ 2, %1 ]
%6 = phi i32 [ %10, %3 ], [ 0, %1 ]
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 %5, i32 0
%10 = add i32 %9, %6
%11 = xor i32 %7, 1
%12 = add nuw nsw i32 %11, %4
%13 = add nuw nsw i32 %5, 1
%14 = icmp ult i32 %12, %0
br i1 %14, label %3, label %15
15: ; preds = %3, %1
%16 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %16
}