xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
char lastCharOf(char *s) {
  if (s == NULL || strlen(s) == 0) {
    return '\0';
  } else {
    return s[strlen(s) - 1];
  }
}


x86 assembly (clang, -O0):
<lastCharOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <lastCharOf+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    1142 <lastCharOf+0x32>
movb   $0x0,-0x1(%rbp)
jmp    1165 <lastCharOf+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastCharOf>:
push   %rbx
test   %rdi,%rdi
je     1132 <lastCharOf+0x22>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1132 <lastCharOf+0x22>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
mov    -0x1(%rax,%rbx,1),%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @lastCharOf(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
br label %12
12: ; preds = %1, %3, %6
%13 = phi i8 [ %11, %6 ], [ 0, %3 ], [ 0, %1 ]
ret i8 %13
}
void __SIG_IGN(int sig) {}


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

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

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

LLVM IR (-O2):
define void @__SIG_IGN(i32 %0) {
ret void
}
int val1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @val1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @val1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ init_matrix(int, int, int **);
int /*<<< orphan*/ process_smith_waterman(int, int, int **, char *, char *);
int *smith_waterman(int c_size, int r_size, int values[255][255],
                    char *secuence1, char *secuence2) {
  init_matrix(c_size, r_size, values);
  process_smith_waterman(c_size, r_size, values, secuence1, secuence2);
}


x86 assembly (clang, -O0):
<smith_waterman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <init_matrix@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <process_smith_waterman@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smith_waterman>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <init_matrix@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <process_smith_waterman@plt>

LLVM IR (-O0):
define i32* @smith_waterman(i32 %0, i32 %1, [255 x i32]* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [255 x i32]*
%10 = alloca i8*
%11 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store [255 x i32]* %2, [255 x i32]** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load [255 x i32]*, [255 x i32]** %9
%15 = bitcast [255 x i32]* %14 to i32**
%16 = call i32 @init_matrix(i32 %12, i32 %13, i32** %15)
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = load [255 x i32]*, [255 x i32]** %9
%20 = bitcast [255 x i32]* %19 to i32**
%21 = load i8*, i8** %10
%22 = load i8*, i8** %11
%23 = call i32 @process_smith_waterman(i32 %17, i32 %18, i32** %20, i8* %21, i8* %22)
%24 = load i32*, i32** %6
ret i32* %24
}

LLVM IR (-O2):
define noalias i32* @smith_waterman(i32 %0, i32 %1, [255 x i32]* %2, i8* %3, i8* %4) {
%6 = bitcast [255 x i32]* %2 to i32**
%7 = tail call i32 @init_matrix(i32 %0, i32 %1, i32** %6)
%8 = tail call i32 @process_smith_waterman(i32 %0, i32 %1, i32** %6, i8* %3, i8* %4)
ret i32* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fputs(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void put_string(FILE *f, const char *s) {
  if (fputs(s, f) == EOF) {
    perror("Error writing to file");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
jne    1177 <put_string+0x47>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <fputs@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     114d <put_string+0x1d>
pop    %rax
ret
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [22 x i8] c"Error writing to file\00"
@EXIT_FAILURE = global i32 0
define void @put_string(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = call i64 @fputs(i8* %5, i32* %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [22 x i8] c"Error writing to file\00"
@EXIT_FAILURE = global i32 0
define void @put_string(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @fputs(i8* %1, i32* %0)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void setMatrix(void) {
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
}


x86 assembly (clang, -O0):
<setMatrix>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
movsd  0xeaf(%rip),%xmm4
movsd  0xeaf(%rip),%xmm5
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
call   1040 <glOrtho@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMatrix>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movsd  0xeb2(%rip),%xmm0
movsd  0xeb2(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
movaps %xmm0,%xmm4
movaps %xmm1,%xmm5
call   1040 <glOrtho@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glLoadIdentity@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @setMatrix() {
%1 = load i32, i32* @GL_PROJECTION
%2 = call i32 @glMatrixMode(i32 %1)
%3 = call i32 (...) @glLoadIdentity()
%4 = call i32 @glOrtho(double -2.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.000000e+00)
%5 = load i32, i32* @GL_MODELVIEW
%6 = call i32 @glMatrixMode(i32 %5)
%7 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @setMatrix() {
%1 = load i32, i32* @GL_PROJECTION
%2 = tail call i32 @glMatrixMode(i32 %1)
%3 = tail call i32 (...) @glLoadIdentity()
%4 = tail call i32 @glOrtho(double -2.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.000000e+00)
%5 = load i32, i32* @GL_MODELVIEW
%6 = tail call i32 @glMatrixMode(i32 %5)
%7 = tail call i32 (...) @glLoadIdentity()
ret void
}
/* Type definitions */
struct completion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct completion *);
void au_wkq_comp_free(struct completion *comp) { kfree(comp); }


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

x86 assembly (clang, -O2):
<au_wkq_comp_free>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.completion = type { i32 }
define void @au_wkq_comp_free(%struct.completion* %0) {
%2 = tail call i32 @kfree(%struct.completion* %0)
ret void
}
void gtk_text_buffer_get_selection_bound() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_selection_bound() {
ret void
}
/* Variables and functions */
int cheap_strlen(char *);
char *next_str(char *str) { return str + cheap_strlen(str) + 1; }


x86 assembly (clang, -O0):
<next_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cheap_strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <cheap_strlen@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @next_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @cheap_strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
ret i8* %8
}

LLVM IR (-O2):
define i8* @next_str(i8* %0) {
%2 = tail call i32 @cheap_strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}
int conditional(int x, int y, int z) {
  int flag = !!x;
  int ymask = ~flag + 1;
  int zmask = ~ymask;
  return (y & ymask) | (z & zmask);
}


x86 assembly (clang, -O0):
<conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    -0x18(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = xor i32 %15, -1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = xor i32 %18, -1
store i32 %19, i32* %9
%20 = load i32, i32* %5
%21 = load i32, i32* %8
%22 = and i32 %20, %21
%23 = load i32, i32* %6
%24 = load i32, i32* %9
%25 = and i32 %23, %24
%26 = or i32 %22, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
long int simple_l(long int *xp, long int y) {
  long int t = *xp + y;
  *xp = t;
  return t;
}


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

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

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

LLVM IR (-O2):
define i64 @simple_l(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = add nsw i64 %3, %1
store i64 %4, i64* %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/
test_fail_string_common(char *, int /*<<< orphan*/ *, int /*<<< orphan*/,
                        int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *, char const *, char const *,
                        size_t, char const *, size_t);
void test_output_string(const char *name, const char *m, size_t l) {
  test_fail_string_common("string", NULL, 0, NULL, NULL, NULL, name, m, l, m,
                          l);
}


x86 assembly (clang, -O0):
<test_output_string>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%r14
mov    -0x20(%rbp),%rbx
mov    -0x28(%rbp),%r11
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
lea    0xebe(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%r9d
xor    %edx,%edx
mov    %r9,%rsi
mov    %r9,%rcx
mov    %r9,%r8
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <test_fail_string_common@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_output_string>:
push   %rax
mov    %rdx,%rax
mov    %rsi,%r10
mov    %rdi,%r11
sub    $0x8,%rsp
lea    0xedb(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   %r10
push   %rax
push   %r10
push   %r11
call   1030 <test_fail_string_common@plt>
add    $0x30,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"string\00"
define void @test_output_string(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @test_fail_string_common(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* null, i32 0, i32* null, i32* null, i32* null, i8* %7, i8* %8, i64 %9, i8* %10, i64 %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"string\00"
define void @test_output_string(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @test_fail_string_common(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* null, i32 0, i32* null, i32* null, i32* null, i8* %0, i8* %1, i64 %2, i8* %1, i64 %2)
ret void
}
const char *GetDigitsLut() {
  static const char cDigitsLut[200] = {
      '0', '0', '0', '1', '0', '2', '0', '3', '0', '4', '0', '5', '0', '6', '0',
      '7', '0', '8', '0', '9', '1', '0', '1', '1', '1', '2', '1', '3', '1', '4',
      '1', '5', '1', '6', '1', '7', '1', '8', '1', '9', '2', '0', '2', '1', '2',
      '2', '2', '3', '2', '4', '2', '5', '2', '6', '2', '7', '2', '8', '2', '9',
      '3', '0', '3', '1', '3', '2', '3', '3', '3', '4', '3', '5', '3', '6', '3',
      '7', '3', '8', '3', '9', '4', '0', '4', '1', '4', '2', '4', '3', '4', '4',
      '4', '5', '4', '6', '4', '7', '4', '8', '4', '9', '5', '0', '5', '1', '5',
      '2', '5', '3', '5', '4', '5', '5', '5', '6', '5', '7', '5', '8', '5', '9',
      '6', '0', '6', '1', '6', '2', '6', '3', '6', '4', '6', '5', '6', '6', '6',
      '7', '6', '8', '6', '9', '7', '0', '7', '1', '7', '2', '7', '3', '7', '4',
      '7', '5', '7', '6', '7', '7', '7', '8', '7', '9', '8', '0', '8', '1', '8',
      '2', '8', '3', '8', '4', '8', '5', '8', '6', '8', '7', '8', '8', '8', '9',
      '9', '0', '9', '1', '9', '2', '9', '3', '9', '4', '9', '5', '9', '6', '9',
      '7', '9', '8', '9', '9'};
  return cDigitsLut;
}


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

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

LLVM IR (-O0):
@GetDigitsLut.cDigitsLut = internal constant [200 x i8] c"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
define i8* @GetDigitsLut() {
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @GetDigitsLut.cDigitsLut, i64 0, i64 0)
}

LLVM IR (-O2):
@GetDigitsLut.cDigitsLut = internal constant [200 x i8] c"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
define i8* @GetDigitsLut() {
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @GetDigitsLut.cDigitsLut, i64 0, i64 0)
}
void SPI1_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI1_RestoreConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("cd /mnt/user/code/Camera/bin && /mnt/user/jvm/java Main");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"cd /mnt/user/code/Camera/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [56 x i8] c"cd /mnt/user/code/Camera/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int phi(int x, int y) { return ((x - 1) * (y - 1)); }


x86 assembly (clang, -O0):
<phi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi>:
lea    -0x1(%rdi),%ecx
lea    -0x1(%rsi),%eax
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @phi(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = add nsw i32 %1, -1
%5 = mul nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sleep(long);
void my_sleep(long millisecs) { sleep(millisecs / 1000); }


x86 assembly (clang, -O0):
<my_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sleep>:
mov    %rdi,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x7,%rdx
add    %rdx,%rdi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @my_sleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, 1000
%5 = call i32 @sleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @my_sleep(i64 %0) {
%2 = sdiv i64 %0, 1000
%3 = tail call i32 @sleep(i64 %2)
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *);
int wifidir_use_fixed_ie_indices() {
  char *ret = getenv("WIFIDIR_USE_FIXED_IE_INDICES");
  if (ret != NULL && *ret == '1') {
    printf("Using fixed ie indices 0 and 1 for P2P and WPS IEs");
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<wifidir_use_fixed_ie_indices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <wifidir_use_fixed_ie_indices+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    116b <wifidir_use_fixed_ie_indices+0x4b>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1172 <wifidir_use_fixed_ie_indices+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wifidir_use_fixed_ie_indices>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     114d <wifidir_use_fixed_ie_indices+0x2d>
cmpb   $0x31,(%rcx)
jne    114d <wifidir_use_fixed_ie_indices+0x2d>
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"WIFIDIR_USE_FIXED_IE_INDICES\00"
@.str.1 = [51 x i8] c"Using fixed ie indices 0 and 1 for P2P and WPS IEs\00"
define i32 @wifidir_use_fixed_ie_indices() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 49
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %14
13: ; preds = %6, %0
store i32 0, i32* %1
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [29 x i8] c"WIFIDIR_USE_FIXED_IE_INDICES\00"
@.str.1 = [51 x i8] c"Using fixed ie indices 0 and 1 for P2P and WPS IEs\00"
define i32 @wifidir_use_fixed_ie_indices() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 49
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ], [ 0, %0 ]
ret i32 %9
}
void createSolverDebugOstream() {}


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

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

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

LLVM IR (-O2):
define void @createSolverDebugOstream() {
ret void
}
int(_rl_uppercase_p)(c) int c;
{ return (((unsigned char)(c) == (c)) && (1 && isupper(c))); }


x86 assembly (clang, -O0):
<_rl_uppercase_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jne    1140 <_rl_uppercase_p+0x30>
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rl_uppercase_p>:
xor    %eax,%eax
cmp    $0xff,%edi
ja     112d <_rl_uppercase_p+0x1d>
push   %rax
call   1030 <isupper@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @_rl_uppercase_p(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @isupper(i32 %9)
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %1
%13 = phi i1 [ false, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @_rl_uppercase_p(i32 %0) {
%2 = icmp ult i32 %0, 256
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @isupper(i32 %0)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ FATAL(char *, char const *);
void overflo(const char *s) {
  FATAL("regular expression too big: %.30s...", s);
}


x86 assembly (clang, -O0):
<overflo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <FATAL@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<overflo>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <FATAL@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"regular expression too big: %.30s...\00"
define void @overflo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FATAL(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"regular expression too big: %.30s...\00"
define void @overflo(i8* %0) {
%2 = tail call i32 @FATAL(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_sub(void) {
  gen_pop();
  gen_call("_sub");
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"_sub\00"
define void @gen_sub() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_sub\00"
define void @gen_sub() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double day(double);
double day_from_year(int /*<<< orphan*/);
int /*<<< orphan*/ year_from_time(double);
double day_within_year(double t) {
  return day(t) - day_from_year(year_from_time(t));
}


x86 assembly (clang, -O0):
<day_within_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <day@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <year_from_time@plt>
mov    %eax,%edi
call   1030 <day_from_year@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<day_within_year>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <day@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <year_from_time@plt>
mov    %eax,%edi
call   1030 <day_from_year@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @day_within_year(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @day(double %3)
%5 = load double, double* %2
%6 = call i32 @year_from_time(double %5)
%7 = call double @day_from_year(i32 %6)
%8 = fsub double %4, %7
ret double %8
}

LLVM IR (-O2):
define double @day_within_year(double %0) {
%2 = tail call double @day(double %0)
%3 = tail call i32 @year_from_time(double %0)
%4 = tail call double @day_from_year(i32 %3)
%5 = fsub double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int wiek, year;
  printf("Enter Your Age \n");
  scanf("%d", &year);
  wiek = (year * 365);
  printf("Your Age in Days is %d \n", wiek);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x16d,-0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
imul   $0x16d,0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter Your Age \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Your Age in Days is %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%10 = load i32, i32* %7
%11 = mul nsw i32 %10, 365
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Your Age in Days is %d \0A\00"
@str = [16 x i8] c"Enter Your Age \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 365
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
void ZSTD_copy8(void *dst, const void *src) {
  __builtin_memcpy((dst), (src), (8));
}


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

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

LLVM IR (-O0):
define void @ZSTD_copy8(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @ZSTD_copy8(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %3
store i64 %5, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int arr[], int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("%i ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char const *, char const *);
char *concat(const char *str1, const char *str2) {
  char *res;
  asprintf(&res, "%s%s", str1, str2);
  return res;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <asprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @concat(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** %4
%8 = call i32 @asprintf(i8** %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = load i8*, i8** %3
ret i8* %6
}
void mult(double *r, double s, const double *v) {
  r[0] = s * v[0];
  r[1] = s * v[1];
  r[2] = s * v[2];
}


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

x86 assembly (clang, -O2):
<mult>:
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
mulsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @mult(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double, double* %5
%8 = load double*, double** %6
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fmul double %7, %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double, double* %5
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %14, %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 1
store double %18, double* %20
%21 = load double, double* %5
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fmul double %21, %24
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
ret void
}

LLVM IR (-O2):
define void @mult(double* nocapture writeonly %0, double %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = fmul double %4, %1
store double %5, double* %0
%6 = getelementptr inbounds double, double* %2, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %1
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %2, i64 2
%11 = load double, double* %10
%12 = fmul double %11, %1
%13 = getelementptr inbounds double, double* %0, i64 2
store double %12, double* %13
ret void
}
/* Variables and functions */
int getbc(int);
int getbc0(int, int);
int getnum_s8() {
  int s;
  s = getbc(8);
  while (getbc(1) == 0)
    s = getbc0(8, s);
  return s;
}


x86 assembly (clang, -O0):
<getnum_s8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <getbc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <getbc@plt>
cmp    $0x0,%eax
jne    115d <getnum_s8+0x3d>
mov    -0x4(%rbp),%esi
mov    $0x8,%edi
call   1030 <getbc0@plt>
mov    %eax,-0x4(%rbp)
jmp    1135 <getnum_s8+0x15>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum_s8>:
push   %rbx
mov    $0x8,%edi
call   1040 <getbc@plt>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
mov    $0x1,%edi
call   1040 <getbc@plt>
test   %eax,%eax
jne    114e <getnum_s8+0x2e>
mov    $0x8,%edi
mov    %ebx,%esi
call   1030 <getbc0@plt>
jmp    1130 <getnum_s8+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getnum_s8() {
%1 = alloca i32
%2 = call i32 @getbc(i32 8)
store i32 %2, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 @getbc(i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @getbc0(i32 8, i32 %7)
store i32 %8, i32* %1
br label %3
9: ; preds = %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @getnum_s8() {
%1 = tail call i32 @getbc(i32 8)
%2 = tail call i32 @getbc(i32 1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = phi i32 [ %6, %4 ], [ %1, %0 ]
%6 = tail call i32 @getbc0(i32 8, i32 %5)
%7 = tail call i32 @getbc(i32 1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
%10 = phi i32 [ %1, %0 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc22(int status, void *arg) {
  printf("Executing exitfunc"
         "22"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


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

x86 assembly (clang, -O2):
<exitfunc22>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Executing exitfunc22 (status=%d, arg=%lu)\0A\00"
define void @exitfunc22(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Executing exitfunc22 (status=%d, arg=%lu)\0A\00"
define void @exitfunc22(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void wait_for_work() { usleep(50 * 1000); }


x86 assembly (clang, -O0):
<wait_for_work>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc350,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_work>:
mov    $0xc350,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @wait_for_work() {
%1 = call i32 @usleep(i32 50000)
ret void
}

LLVM IR (-O2):
define void @wait_for_work() {
%1 = tail call i32 @usleep(i32 50000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ siftup(int *, int);
void insert(int *head, int *head_len, int innode) {
  int temp_len = *head_len;
  if (temp_len >= 1000) {
    return;
  }
  head[++temp_len] = innode;
  *head_len = temp_len;
  siftup(head, *head_len);
}


x86 assembly (clang, -O0):
<insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x3e8,-0x18(%rbp)
jl     113e <insert+0x2e>
jmp    116c <insert+0x5c>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <siftup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert>:
movslq (%rsi),%rax
cmp    $0x3e7,%rax
jle    111c <insert+0xc>
ret
mov    %edx,0x4(%rdi,%rax,4)
add    $0x1,%rax
mov    %eax,(%rsi)
mov    %eax,%esi
jmp    1030 <siftup@plt>

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

LLVM IR (-O2):
define void @insert(i32* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 999
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = add nsw i32 %4, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %2, i32* %9
store i32 %7, i32* %1
%10 = tail call i32 @siftup(i32* %0, i32 %7)
br label %11
11: ; preds = %3, %6
ret void
}