xunge/DecIR huggingface dataset:
int foo(int i, int j) {
  if (i == 5)
    return 0;
  return i + j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    1120 <foo+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1129 <foo+0x29>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    (%rsi,%rdi,1),%ecx
xor    %eax,%eax
cmp    $0x5,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(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, 5
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 5
%4 = add nsw i32 %1, %0
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
double media(int, int, double, char);
int /*<<< orphan*/ printf(char *, double);
main() {
  printf("A media aritmetica do aluno com as notas 8, 9 e 7.5 eh: %0.2f",
         media(8, 9, 7.5, 'A'));
  printf("A media ponderada do aluno com as notas 8, 9 e 7.5 eh: %0.2f",
         media(8, 9, 7.5, 'P'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
mov    $0x9,%esi
movsd  0xebf(%rip),%xmm0
mov    $0x41,%edx
call   1040 <media@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
mov    $0x9,%esi
movsd  0xe97(%rip),%xmm0
mov    $0x50,%edx
call   1040 <media@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0x41,%edx
call   1040 <media@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
mov    $0x9,%esi
movsd  0xea5(%rip),%xmm0
mov    $0x50,%edx
call   1040 <media@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"A media aritmetica do aluno com as notas 8, 9 e 7.5 eh: %0.2f\00"
@.str.1 = [61 x i8] c"A media ponderada do aluno com as notas 8, 9 e 7.5 eh: %0.2f\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @media(i32 8, i32 9, double 7.500000e+00, i8 signext 65)
%3 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @media(i32 8, i32 9, double 7.500000e+00, i8 signext 80)
%5 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [62 x i8] c"A media aritmetica do aluno com as notas 8, 9 e 7.5 eh: %0.2f\00"
@.str.1 = [61 x i8] c"A media ponderada do aluno com as notas 8, 9 e 7.5 eh: %0.2f\00"
define i32 @main() {
%1 = tail call double @media(i32 8, i32 9, double 7.500000e+00, i8 signext 65)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @media(i32 8, i32 9, double 7.500000e+00, i8 signext 80)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), double %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ trap(char *);
void trap_da(void) { trap("data abort"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"data abort\00"
define void @trap_da() {
%1 = call i32 @trap(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"data abort\00"
define void @trap_da() {
%1 = tail call i32 @trap(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct httpd_session_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ httpd_send_data(struct httpd_session_data *, int,
                                   void const *);
int /*<<< orphan*/ httpd_send_head(struct httpd_session_data *, int,
                                   char const *, int);
void httpd_send(struct httpd_session_data *sd, int status,
                const char *content_type, int content_len, const void *data) {
  httpd_send_head(sd, status, content_type, content_len);
  httpd_send_data(sd, content_len, data);
}


x86 assembly (clang, -O0):
<httpd_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <httpd_send_head@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1030 <httpd_send_data@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpd_send>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdi,%rbx
call   1040 <httpd_send_head@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <httpd_send_data@plt>

LLVM IR (-O0):
%struct.httpd_session_data = type { i32 }
define void @httpd_send(%struct.httpd_session_data* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca %struct.httpd_session_data*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store %struct.httpd_session_data* %0, %struct.httpd_session_data** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load %struct.httpd_session_data*, %struct.httpd_session_data** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = call i32 @httpd_send_head(%struct.httpd_session_data* %11, i32 %12, i8* %13, i32 %14)
%16 = load %struct.httpd_session_data*, %struct.httpd_session_data** %6
%17 = load i32, i32* %9
%18 = load i8*, i8** %10
%19 = call i32 @httpd_send_data(%struct.httpd_session_data* %16, i32 %17, i8* %18)
ret void
}

LLVM IR (-O2):
%struct.httpd_session_data = type { i32 }
define void @httpd_send(%struct.httpd_session_data* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @httpd_send_head(%struct.httpd_session_data* %0, i32 %1, i8* %2, i32 %3)
%7 = tail call i32 @httpd_send_data(%struct.httpd_session_data* %0, i32 %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __mingw_aligned_free(void *memblock) {
  if (memblock)
    free((*(((void **)(((uintptr_t)(memblock)) &
                       (~((uintptr_t)(sizeof(void *) - 1))))) -
            1)));
}


x86 assembly (clang, -O0):
<__mingw_aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <__mingw_aligned_free+0x28>
mov    -0x8(%rbp),%rax
and    $0xfffffffffffffff8,%rax
mov    -0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mingw_aligned_free>:
test   %rdi,%rdi
je     1122 <__mingw_aligned_free+0x12>
and    $0xfffffffffffffff8,%rdi
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @__mingw_aligned_free(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 %13
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
%8 = and i64 %7, -8
%9 = inttoptr i64 %8 to i8**
%10 = getelementptr inbounds i8*, i8** %9, i64 -1
%11 = load i8*, i8** %10
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @__mingw_aligned_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = ptrtoint i8* %0 to i64
%5 = and i64 %4, -8
%6 = inttoptr i64 %5 to i8**
%7 = getelementptr inbounds i8*, i8** %6, i64 -1
%8 = load i8*, i8** %7
%9 = tail call i32 @free(i8* %8)
br label %10
10: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void set_signals(void) {
  signal(SIGPIPE, SIG_IGN);
  signal(SIGHUP, SIG_IGN);
}


x86 assembly (clang, -O0):
<set_signals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_signals>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
define void @set_signals() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGHUP
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
define void @set_signals() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGHUP
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
int Q_isnumeric(int c) {
  if (c >= '0' && c <= '9')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<Q_isnumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <Q_isnumeric+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <Q_isnumeric+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <Q_isnumeric+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_isnumeric>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @Q_isnumeric(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @Q_isnumeric(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ GetRecord(int /*<<< orphan*/);
int /*<<< orphan*/ PutRecord(int /*<<< orphan*/);
int /*<<< orphan*/ WriteHeader(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  WriteHeader(stdout);
  while (GetRecord(stdin))
    PutRecord(stdout);
  exit(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    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <WriteHeader@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <GetRecord@plt>
cmp    $0x0,%rax
je     118f <main+0x4f>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1030 <PutRecord@plt>
jmp    1164 <main+0x24>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e8d(%rip),%r14
mov    (%r14),%edi
call   1050 <WriteHeader@plt>
mov    0x2e8e(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1040 <GetRecord@plt>
test   %rax,%rax
je     1176 <main+0x36>
mov    (%r14),%edi
call   1030 <PutRecord@plt>
jmp    1160 <main+0x20>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
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* @stdout
%7 = call i32 @WriteHeader(i32 %6)
br label %8
8: ; preds = %12, %2
%9 = load i32, i32* @stdin
%10 = call i64 @GetRecord(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* @stdout
%14 = call i32 @PutRecord(i32 %13)
br label %8
15: ; preds = %8
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @WriteHeader(i32 %3)
%5 = load i32, i32* @stdin
%6 = tail call i64 @GetRecord(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = load i32, i32* @stdout
%10 = tail call i32 @PutRecord(i32 %9)
%11 = load i32, i32* @stdin
%12 = tail call i64 @GetRecord(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %2
%15 = tail call i32 @exit(i32 0)
unreachable
}
void swap(int *a, int *b) {
  int c;
  c = *a;
  *a = *b;
  *b = c;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

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


x86 assembly (clang, -O0):
<caml_gr_draw_image>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_draw_image>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_draw_image() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_draw_image() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int SIGTERM;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sig_term(int signo) {
  if (signo == SIGTERM) {
    syslog(LOG_INFO, "program terminated.");
    closelog();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<sig_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    1170 <sig_term+0x40>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_term>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
je     113e <sig_term+0xe>
pop    %rax
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@LOG_INFO = global i32 0
@.str = [20 x i8] c"program terminated.\00"
define void @sig_term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @LOG_INFO
%8 = call i32 @syslog(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @closelog()
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@LOG_INFO = global i32 0
@.str = [20 x i8] c"program terminated.\00"
define void @sig_term(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @LOG_INFO
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @closelog()
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gcd_compute(int, int);
int main() {
  gcd_compute(0x13, 0x2143);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x13,%edi
mov    $0x2143,%esi
call   1030 <gcd_compute@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @gcd_compute(i32 19, i32 8515)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @gcd_compute(i32 19, i32 8515)
ret i32 0
}
int delUser(char *user, char *userfile) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @delUser(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void clear_array(int array[100000]) {
  int i = 0;
  for (i = 0; i < 100000; i++) {
    array[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clear_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    1140 <clear_array+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear_array+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_array>:
push   %rax
mov    $0x61a80,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_array(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100000
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clear_array(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putstr(char *);
scalar_t__ get_next_line(int, char **);
int open(char *, int /*<<< orphan*/);
int main(void) {
  int fd;
  char *line;
  int tmp;
  fd = open("test", O_RDONLY);
  while (get_next_line(fd, &line)) {
    ft_putendl(line);
  }
  ft_putstr(line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1060 <get_next_line@plt>
cmp    $0x0,%rax
je     118b <main+0x4b>
mov    -0x10(%rbp),%rdi
call   1030 <ft_putendl@plt>
jmp    1167 <main+0x27>
mov    -0x10(%rbp),%rdi
call   1050 <ft_putstr@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xeac(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
call   1060 <get_next_line@plt>
test   %rax,%rax
je     1188 <main+0x48>
mov    %rsp,%r14
nopl   (%rax)
mov    (%rsp),%rdi
call   1030 <ft_putendl@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <get_next_line@plt>
test   %rax,%rax
jne    1170 <main+0x30>
mov    (%rsp),%rdi
call   1050 <ft_putstr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %2
%9 = call i64 @get_next_line(i32 %8, i8** %3)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i32 @ft_putendl(i8* %12)
br label %7
14: ; preds = %7
%15 = load i8*, i8** %3
%16 = call i32 @ft_putstr(i8* %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i64 @get_next_line(i32 %4, i8** %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %0, %7
%8 = load i8*, i8** %1
%9 = call i32 @ft_putendl(i8* %8)
%10 = call i64 @get_next_line(i32 %4, i8** %1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %0
%13 = load i8*, i8** %1
%14 = call i32 @ft_putstr(i8* %13)
ret i32 0
}
int parallel_clauses(void) {
  int a, b[100];
#pragma acc parallel firstprivate(a, b)
  ;
}


x86 assembly (clang, -O0):
<parallel_clauses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @parallel_clauses() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @parallel_clauses() {
ret i32 undef
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int const INT64_C(int);
int32_t aeron_sub_wrap_i32(int32_t a, int32_t b) {
  const int64_t a_widened = a;
  const int64_t b_widened = b;
  const int64_t difference = a_widened - b_widened;
  return (int32_t)(difference & INT64_C(0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<aeron_sub_wrap_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <INT64_C@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
and    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_sub_wrap_i32>:
push   %rbx
mov    %edi,%ebx
sub    %esi,%ebx
mov    $0xffffffff,%edi
call   1030 <INT64_C@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @aeron_sub_wrap_i32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 @INT64_C(i32 -1)
%15 = and i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @aeron_sub_wrap_i32(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @INT64_C(i32 -1)
%5 = and i32 %4, %3
ret i32 %5
}
void teste3() {
  int num = 30;
  num++;
}


x86 assembly (clang, -O0):
<teste3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @teste3() {
%1 = alloca i32
store i32 30, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @teste3() {
ret void
}
float __rintf(float x) {
  float two23 = copysignf(0x1.0p23, x);
  float r;
  r = x + two23;
  r = r - two23;
  return copysign(r, x);
}


x86 assembly (clang, -O0):
<__rintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xf0b(%rip),%xmm1
pand   %xmm1,%xmm0
movaps 0xf10(%rip),%xmm1
por    %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movaps 0xea0(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xea5(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rintf>:
movaps 0xef9(%rip),%xmm1
andps  %xmm0,%xmm1
movaps 0xeff(%rip),%xmm2
orps   %xmm1,%xmm2
addss  %xmm2,%xmm0
subss  %xmm2,%xmm0
andps  0xefd(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__rintf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = call float @llvm.copysign.f32(float 0x4160000000000000, float %5)
store float %6, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fadd float %7, %8
store float %9, float* %4
%10 = load float, float* %4
%11 = load float, float* %3
%12 = fsub float %10, %11
store float %12, float* %4
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = call double @llvm.copysign.f64(double %14, double %16)
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
define float @__rintf(float %0) {
%2 = tail call float @llvm.copysign.f32(float 0x4160000000000000, float %0)
%3 = fadd float %2, %0
%4 = fsub float %3, %2
%5 = fpext float %4 to double
%6 = fpext float %0 to double
%7 = tail call double @llvm.copysign.f64(double %5, double %6)
%8 = fptrunc double %7 to float
ret float %8
}
unsigned long calc_load(unsigned long load, unsigned long exp,
                        unsigned long active) {
  unsigned long newload;
  newload = load * exp + active * ((1 << 11) - exp);
  if (active >= load)
    newload += (1 << 11) - 1;
  return newload / (1 << 11);
}


x86 assembly (clang, -O0):
<calc_load>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    $0x800,%edx
sub    -0x10(%rbp),%rdx
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jb     114d <calc_load+0x4d>
mov    -0x20(%rbp),%rax
add    $0x7ff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shr    $0xb,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_load>:
mov    $0x800,%eax
sub    %rsi,%rax
imul   %rdi,%rsi
imul   %rdx,%rax
lea    (%rax,%rsi,1),%rcx
cmp    %rdi,%rdx
lea    0x7ff(%rax,%rsi,1),%rax
cmovb  %rcx,%rax
shr    $0xb,%rax
ret

LLVM IR (-O0):
define i64 @calc_load(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = mul i64 %8, %9
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = sub i64 2048, %12
%14 = mul i64 %11, %13
%15 = add i64 %10, %14
store i64 %15, i64* %7
%16 = load i64, i64* %6
%17 = load i64, i64* %4
%18 = icmp uge i64 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = load i64, i64* %7
%21 = add i64 %20, 2047
store i64 %21, i64* %7
br label %22
22: ; preds = %19, %3
%23 = load i64, i64* %7
%24 = udiv i64 %23, 2048
ret i64 %24
}

LLVM IR (-O2):
define i64 @calc_load(i64 %0, i64 %1, i64 %2) {
%4 = mul i64 %1, %0
%5 = sub i64 2048, %1
%6 = mul i64 %5, %2
%7 = add i64 %6, %4
%8 = icmp ult i64 %2, %0
%9 = add i64 %7, 2047
%10 = select i1 %8, i64 %7, i64 %9
%11 = lshr i64 %10, 11
ret i64 %11
}
/* Type definitions */
struct ic_token_list {
  int dummy;
};
struct ic_decl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
struct ic_decl *ic_parse_decl_enum(struct ic_token_list *token_list) {
  if (!token_list) {
    puts("ic_parse_decl_enum: token_list was null");
    return 0;
  }
  puts("ic_parse_decl_enum: UNIMPLEMENTED");
  return 0;
}


x86 assembly (clang, -O0):
<ic_parse_decl_enum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <ic_parse_decl_enum+0x30>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,-0x8(%rbp)
jmp    1154 <ic_parse_decl_enum+0x44>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ic_decl = type { i32 }
%struct.ic_token_list = type { i32 }
@.str = [40 x i8] c"ic_parse_decl_enum: token_list was null\00"
@.str.1 = [34 x i8] c"ic_parse_decl_enum: UNIMPLEMENTED\00"
define %struct.ic_decl* @ic_parse_decl_enum(%struct.ic_token_list* %0) {
%2 = alloca %struct.ic_decl*
%3 = alloca %struct.ic_token_list*
store %struct.ic_token_list* %0, %struct.ic_token_list** %3
%4 = load %struct.ic_token_list*, %struct.ic_token_list** %3
%5 = icmp ne %struct.ic_token_list* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store %struct.ic_decl* null, %struct.ic_decl** %2
br label %10
8: ; preds = %1
%9 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store %struct.ic_decl* null, %struct.ic_decl** %2
br label %10
10: ; preds = %8, %6
%11 = load %struct.ic_decl*, %struct.ic_decl** %2
ret %struct.ic_decl* %11
}

LLVM IR (-O2):
%struct.ic_decl = type { i32 }
%struct.ic_token_list = type { i32 }
@.str = [40 x i8] c"ic_parse_decl_enum: token_list was null\00"
@.str.1 = [34 x i8] c"ic_parse_decl_enum: UNIMPLEMENTED\00"
define noalias %struct.ic_decl* @ic_parse_decl_enum(%struct.ic_token_list* readnone %0) {
%2 = icmp eq %struct.ic_token_list* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret %struct.ic_decl* null
}
/* Variables and functions */
int /*<<< orphan*/ srand48(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void reseed() { srand48(time(NULL)); }


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

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

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

LLVM IR (-O2):
define void @reseed() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand48(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int);
void uninivar_snprintf(void) {
  char *s;
  size_t n;
  char *format;
  int i;
  (void)snprintf(s, n, format, i);
}


x86 assembly (clang, -O0):
<uninivar_snprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_snprintf>:
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
define void @uninivar_snprintf() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32
%5 = load i8*, i8** %1
%6 = load i64, i64* %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %5, i64 %6, i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @uninivar_snprintf() {
%1 = tail call i32 @snprintf(i8* undef, i64 undef, i8* undef, i32 undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_getpid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t lxc_raw_getpid(void) { return (pid_t)syscall(SYS_getpid); }


x86 assembly (clang, -O0):
<lxc_raw_getpid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lxc_raw_getpid>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_getpid = global i32 0
define i32 @lxc_raw_getpid() {
%1 = load i32, i32* @SYS_getpid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_getpid = global i32 0
define i32 @lxc_raw_getpid() {
%1 = load i32, i32* @SYS_getpid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
void UserCommand(struct Robot *robot, char *text) {}


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

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

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

LLVM IR (-O2):
%struct.Robot = type opaque
define void @UserCommand(%struct.Robot* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(int level) {
  while (level--) {
    printf("   ");
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <indent+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <indent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <indent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
define void @indent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
define void @indent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/,
            int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void chaz_Test_init(void) {
  int check_val = setvbuf(stdout, NULL, _IONBF, 0);
  if (check_val != 0) {
    fprintf(stderr, "Failed when trying to unbuffer stdout\n");
  }
}


x86 assembly (clang, -O0):
<chaz_Test_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1167 <chaz_Test_init+0x47>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_Test_init>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
test   %eax,%eax
je     1156 <chaz_Test_init+0x36>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
@stderr = global i32 0
@.str = [39 x i8] c"Failed when trying to unbuffer stdout\0A\00"
define void @chaz_Test_init() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IONBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
@stderr = global i32 0
@.str = [39 x i8] c"Failed when trying to unbuffer stdout\0A\00"
define void @chaz_Test_init() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atanh(double);
int /*<<< orphan*/ atanhf(float);
int /*<<< orphan*/ atanhl(long double);
void uninitvar_atanh(void) {
  float f;
  (void)atanhf(f);
  double d;
  (void)atanh(d);
  long double ld;
  (void)atanhl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <atanhf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <atanh@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <atanhl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_atanh>:
sub    $0x18,%rsp
call   1040 <atanhf@plt>
call   1030 <atanh@plt>
call   1050 <atanhl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_atanh() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @atanhf(float %4)
%6 = load double, double* %2
%7 = call i32 @atanh(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @atanhl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_atanh() {
%1 = tail call i32 @atanhf(float undef)
%2 = tail call i32 @atanh(double undef)
%3 = tail call i32 @atanhl(x86_fp80 undef)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XCirculateRequestEvent;

/* Variables and functions */
void set_XCirculateRequestEvent_serial(void *_p, unsigned long _v) {
  ((XCirculateRequestEvent *)_p)->serial = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XCirculateRequestEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int Compare_Float(double, double, int);
int compare_height(double h1, double h2) { return Compare_Float(h1, h2, 1e-2); }


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

x86 assembly (clang, -O2):
<compare_height>:
xor    %edi,%edi
jmp    1030 <Compare_Float@plt>

LLVM IR (-O0):
define i32 @compare_height(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 i32 @Compare_Float(double %5, double %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @compare_height(double %0, double %1) {
%3 = tail call i32 @Compare_Float(double %0, double %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void volumeComputation() { printf("\n COMPUTE VOLUME OF:"); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"\0A COMPUTE VOLUME OF:\00"
define void @volumeComputation() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rb_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rand();
int /*<<< orphan*/ rb_insert(struct rb_tree *, int /*<<< orphan*/);
struct rb_tree *rb_mktree();
struct rb_tree *rand_tree(int ct) {
  int i;
  struct rb_tree *t = rb_mktree();
  for (i = 0; i < ct; i++) {
    rb_insert(t, rand());
  }
  return t;
}


x86 assembly (clang, -O0):
<rand_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rb_mktree@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1181 <rand_tree+0x51>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <rb_insert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <rand_tree+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_tree>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rb_mktree@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1166 <rand_tree+0x36>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <rand@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <rb_insert@plt>
add    $0xffffffff,%ebx
jne    1150 <rand_tree+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rb_tree = type { i32 }
define %struct.rb_tree* @rand_tree(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.rb_tree*
store i32 %0, i32* %2
%5 = call %struct.rb_tree* (...) @rb_mktree()
store %struct.rb_tree* %5, %struct.rb_tree** %4
store i32 0, i32* %3
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load %struct.rb_tree*, %struct.rb_tree** %4
%12 = call i32 (...) @rand()
%13 = call i32 @rb_insert(%struct.rb_tree* %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = load %struct.rb_tree*, %struct.rb_tree** %4
ret %struct.rb_tree* %18
}

LLVM IR (-O2):
%struct.rb_tree = type { i32 }
define %struct.rb_tree* @rand_tree(i32 %0) {
%2 = tail call %struct.rb_tree* (...) @rb_mktree()
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @rand()
%7 = tail call i32 @rb_insert(%struct.rb_tree* %2, i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret %struct.rb_tree* %2
}
/* Type definitions */
struct cnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ outputchildren(struct cnode *, unsigned int,
                                  int /*<<< orphan*/);
void root_output(struct cnode *cnode, unsigned int indent) {
  outputchildren(cnode, indent, 0);
}


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

x86 assembly (clang, -O2):
<root_output>:
xor    %edx,%edx
jmp    1030 <outputchildren@plt>

LLVM IR (-O0):
%struct.cnode = type { i32 }
define void @root_output(%struct.cnode* %0, i32 %1) {
%3 = alloca %struct.cnode*
%4 = alloca i32
store %struct.cnode* %0, %struct.cnode** %3
store i32 %1, i32* %4
%5 = load %struct.cnode*, %struct.cnode** %3
%6 = load i32, i32* %4
%7 = call i32 @outputchildren(%struct.cnode* %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.cnode = type { i32 }
define void @root_output(%struct.cnode* %0, i32 %1) {
%3 = tail call i32 @outputchildren(%struct.cnode* %0, i32 %1, i32 0)
ret void
}