xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  int i, j = 8;
#pragma omp parallel
  {
    puts("foo");
    for (i = 1; i < j - 1; i++)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0xc(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    115d <main+0x4d>
jmp    114f <main+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x29>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 8, i32* %3
%4 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_h24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h24_10_sse4() {
ret void
}
void gtk_widget_render_icon() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_render_icon() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isr_seek_input_sync_offset(int);
int FS460_seek_master_sync_offset(int offset) {
  isr_seek_input_sync_offset(offset);
  return 0;
}


x86 assembly (clang, -O0):
<FS460_seek_master_sync_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isr_seek_input_sync_offset@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @FS460_seek_master_sync_offset(i32 %0) {
%2 = tail call i32 @isr_seek_input_sync_offset(i32 %0)
ret i32 0
}
int _isxdigit(char c) {
  return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
          (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<_isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <_isxdigit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <_isxdigit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <_isxdigit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <_isxdigit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <_isxdigit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_isxdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @_isxdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
float *test_func_00(float *p, float *x) {
  float r = 0;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  (%rax),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
xorps  %xmm0,%xmm0
addss  (%rdi),%xmm0
lea    0x4(%rdi),%rax
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define float* @test_func_00(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
store float 0.000000e+00, float* %5
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i32 1
store float* %7, float** %3
%8 = load float, float* %6
%9 = load float, float* %5
%10 = fadd float %9, %8
store float %10, float* %5
%11 = load float, float* %5
%12 = load float*, float** %4
store float %11, float* %12
%13 = load float*, float** %3
ret float* %13
}

LLVM IR (-O2):
define float* @test_func_00(float* %0, float* nocapture writeonly %1) {
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %0
%5 = fadd float %4, 0.000000e+00
store float %5, float* %1
ret float* %3
}
/* Type definitions */
struct oscap_stringlist_iterator {
  int dummy;
};
struct oscap_stringlist {
  int dummy;
};
struct oscap_iterator {
  int dummy;
};

/* Variables and functions */
struct oscap_stringlist *oscap_iterator_next(struct oscap_iterator *);
struct oscap_stringlist *
oscap_stringlist_iterator_next(struct oscap_stringlist_iterator *it) {
  return oscap_iterator_next(((struct oscap_iterator *)(it)));
}


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

x86 assembly (clang, -O2):
<oscap_stringlist_iterator_next>:
jmp    1030 <oscap_iterator_next@plt>

LLVM IR (-O0):
%struct.oscap_stringlist = type { i32 }
%struct.oscap_stringlist_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define %struct.oscap_stringlist* @oscap_stringlist_iterator_next(%struct.oscap_stringlist_iterator* %0) {
%2 = alloca %struct.oscap_stringlist_iterator*
store %struct.oscap_stringlist_iterator* %0, %struct.oscap_stringlist_iterator** %2
%3 = load %struct.oscap_stringlist_iterator*, %struct.oscap_stringlist_iterator** %2
%4 = bitcast %struct.oscap_stringlist_iterator* %3 to %struct.oscap_iterator*
%5 = call %struct.oscap_stringlist* @oscap_iterator_next(%struct.oscap_iterator* %4)
ret %struct.oscap_stringlist* %5
}

LLVM IR (-O2):
%struct.oscap_stringlist = type { i32 }
%struct.oscap_stringlist_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define %struct.oscap_stringlist* @oscap_stringlist_iterator_next(%struct.oscap_stringlist_iterator* %0) {
%2 = bitcast %struct.oscap_stringlist_iterator* %0 to %struct.oscap_iterator*
%3 = tail call %struct.oscap_stringlist* @oscap_iterator_next(%struct.oscap_iterator* %2)
ret %struct.oscap_stringlist* %3
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int internal_gethostbyname2_r(char const *, int, struct hostent *, char *,
                              size_t, int *, int *);
enum nss_status _nss_sss_gethostbyname2_r(const char *name, int af,
                                          struct hostent *result, char *buffer,
                                          size_t buflen, int *errnop,
                                          int *h_errnop) {
  return internal_gethostbyname2_r(name, af, result, buffer, buflen, errnop,
                                   h_errnop);
}


x86 assembly (clang, -O0):
<_nss_sss_gethostbyname2_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <internal_gethostbyname2_r@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_sss_gethostbyname2_r>:
jmp    1030 <internal_gethostbyname2_r@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
define i32 @_nss_sss_gethostbyname2_r(i8* %0, i32 %1, %struct.hostent* %2, i8* %3, i64 %4, i32* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca %struct.hostent*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32*
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store %struct.hostent* %2, %struct.hostent** %10
store i8* %3, i8** %11
store i64 %4, i64* %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load %struct.hostent*, %struct.hostent** %10
%18 = load i8*, i8** %11
%19 = load i64, i64* %12
%20 = load i32*, i32** %13
%21 = load i32*, i32** %14
%22 = call i32 @internal_gethostbyname2_r(i8* %15, i32 %16, %struct.hostent* %17, i8* %18, i64 %19, i32* %20, i32* %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @_nss_sss_gethostbyname2_r(i8* %0, i32 %1, %struct.hostent* %2, i8* %3, i64 %4, i32* %5, i32* %6) {
%8 = tail call i32 @internal_gethostbyname2_r(i8* %0, i32 %1, %struct.hostent* %2, i8* %3, i64 %4, i32* %5, i32* %6)
ret i32 %8
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > y) {
    y = y + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114d <main+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %6
13: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void mcxFail(void) {
  while (1)
    sleep(1000);
}


x86 assembly (clang, -O0):
<mcxFail>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <mcxFail+0x9>
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    1119 <mcxFail+0x9>

x86 assembly (clang, -O2):
<mcxFail>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    1120 <mcxFail+0x10>

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

LLVM IR (-O2):
define void @mcxFail() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1000)
br label %1
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_edge(struct graph *, int, int);
void add_edge4(struct graph *g, int a, int b, int c, int d) {
  add_edge(g, a, b);
  add_edge(g, b, c);
  add_edge(g, c, d);
}


x86 assembly (clang, -O0):
<add_edge4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <add_edge@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <add_edge@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <add_edge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_edge4>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rdi,%rbp
call   1030 <add_edge@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   1030 <add_edge@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <add_edge@plt>

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

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @add_edge4(%struct.graph* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @add_edge(%struct.graph* %0, i32 %1, i32 %2)
%7 = tail call i32 @add_edge(%struct.graph* %0, i32 %2, i32 %3)
%8 = tail call i32 @add_edge(%struct.graph* %0, i32 %3, i32 %4)
ret void
}
unsigned short ShortSwap(unsigned short v) {
  unsigned char c1, c2;
  c1 = v & 0xff;
  c2 = (v >> 8) & 0xff;
  return (c1 << 8) + c2;
}


x86 assembly (clang, -O0):
<ShortSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
shl    $0x8,%eax
movzbl -0x4(%rbp),%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShortSwap>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @ShortSwap(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
%4 = alloca i8
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
store i8 %13, i8* %4
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = add nsw i32 %16, %18
%20 = trunc i32 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @ShortSwap(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
float lerp(float v0, float v1, float t) { return v0 * (1 - t) + v1 * t; }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void ndisasm_verror(int severity, const char *fmt, va_list va) {
  vfprintf(stderr, fmt, va);
  if (severity & 0x00000002)
    exit(1);
}


x86 assembly (clang, -O0):
<ndisasm_verror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfprintf@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1160 <ndisasm_verror+0x40>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndisasm_verror>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <vfprintf@plt>
test   $0x2,%bl
jne    1138 <ndisasm_verror+0x18>
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @ndisasm_verror(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @ndisasm_verror(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @vfprintf(i32 %4, i8* %1, i32 %2)
%6 = and i32 %0, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void setArrayS(int16_t *arr, int idx, int16_t v) { arr[idx] = v; }


x86 assembly (clang, -O0):
<setArrayS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setArrayS>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @setArrayS(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *result = malloc(size);
  assert(result != NULL);
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}
unsigned int isleap(unsigned int year) {
  return ((!(year % 4)) && (year % 100)) || (!(year % 400));
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1130 <isleap+0x30>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1147 <isleap+0x47>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
test   $0x3,%dil
jne    1122 <isleap+0x22>
mov    %edi,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     1122 <isleap+0x22>
ret
imul   $0xc28f5c29,%edi,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isleap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = urem i32 %3, 4
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = urem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = urem i32 %11, 400
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ true, %6 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = urem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = urem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
unsigned long long tsToMicrosec(struct timespec *time_spec) {
  unsigned long long retval;
  retval = time_spec->tv_sec * 1000000;
  retval += time_spec->tv_nsec / 1000;
  return retval;
}


x86 assembly (clang, -O0):
<tsToMicrosec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsToMicrosec>:
movslq (%rdi),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @tsToMicrosec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca i64
store %struct.timespec* %0, %struct.timespec** %2
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load %struct.timespec*, %struct.timespec** %2
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = sext i32 %12 to i64
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i64 @tsToMicrosec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %5
ret i64 %10
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int mbstrncasecmp(const char *s1, const char *s2, size_t n) {
  return strncasecmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<mbstrncasecmp>:
jmp    1030 <strncasecmp@plt>

LLVM IR (-O0):
define i32 @mbstrncasecmp(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 = call i32 @strncasecmp(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mbstrncasecmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i rol_epi32(__m128i v, int s) {
  __m128i v1 = _mm_slli_epi32(v, s);
  __m128i v2 = _mm_srli_epi32(v, 32 - s);
  return _mm_xor_si128(v1, v2);
}


x86 assembly (clang, -O0):
<rol_epi32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
sub    -0x8(%rbp),%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol_epi32>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <_mm_slli_epi32@plt>
mov    %eax,%r14d
mov    $0x20,%esi
sub    %ebx,%esi
mov    %ebp,%edi
call   1050 <_mm_srli_epi32@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_mm_xor_si128@plt>

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

LLVM IR (-O2):
define i32 @rol_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_slli_epi32(i32 %0, i32 %1)
%4 = sub nsw i32 32, %1
%5 = tail call i32 @_mm_srli_epi32(i32 %0, i32 %4)
%6 = tail call i32 @_mm_xor_si128(i32 %3, i32 %5)
ret i32 %6
}
void safe_copy_chr(char src, char buff[], char **bufp, int max) {
  char *tp;
  tp = *bufp;
  if ((tp - buff) < max) {
    *tp++ = src;
    *bufp = tp;
    *tp = '\0';
  } else {
    buff[max] = '\0';
  }
}


x86 assembly (clang, -O0):
<safe_copy_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
jge    1163 <safe_copy_chr+0x63>
mov    -0x1(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
jmp    116f <safe_copy_chr+0x6f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_copy_chr>:
mov    (%rdx),%r8
mov    %r8,%rax
sub    %rsi,%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
jge    1120 <safe_copy_chr+0x20>
mov    %dil,(%r8)
add    $0x1,%r8
mov    %r8,(%rdx)
movb   $0x0,(%r8)
ret
add    %rcx,%rsi
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @safe_copy_chr(i8 signext %0, i8* %1, i8** nocapture %2, i32 %3) {
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = ptrtoint i8* %1 to i64
%8 = sub i64 %6, %7
%9 = sext i32 %3 to i64
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %0, i8* %5
store i8* %12, i8** %2
br label %15
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %1, i64 %9
br label %15
15: ; preds = %13, %11
%16 = phi i8* [ %14, %13 ], [ %12, %11 ]
store i8 0, i8* %16
ret void
}
/* Variables and functions */
int zsock_socket(int, int, int);
int socket(int family, int type, int proto) {
  return zsock_socket(family, type, proto);
}


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

x86 assembly (clang, -O2):
<socket>:
jmp    1030 <zsock_socket@plt>

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

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @zsock_socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char *mktemp(char *);
void test2() { char *x = mktemp("/tmp/zxcv"); }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <mktemp@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"/tmp/zxcv\00"
define void @test2() {
%1 = alloca i8*
%2 = call i8* @mktemp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/tmp/zxcv\00"
define void @test2() {
%1 = tail call i8* @mktemp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int str_util_cmp(char *, char *);
int /*<<< orphan*/ str_util_cpy(char *, char *);
int main() {
  char to[1024];
  char *from = NULL;
  str_util_cpy(to, from);
  printf("this is a string %d\n", str_util_cmp(to, from));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rsi
call   1030 <str_util_cpy@plt>
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rsi
call   1050 <str_util_cmp@plt>
mov    %eax,%esi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <str_util_cpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <str_util_cmp@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"this is a string %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %3
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = load i8*, i8** %3
%6 = call i32 @str_util_cpy(i8* %4, i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @str_util_cmp(i8* %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"this is a string %d\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @str_util_cpy(i8* %2, i8* null)
%4 = call i32 @str_util_cmp(i8* %2, i8* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int /*<<< orphan*/ stdout;
int c_scrld(int n) {
  char c[6];
  snprintf(c, 6, "%c[%dT", 0x1b, n);
  return fputs(c, stdout);
}


x86 assembly (clang, -O0):
<c_scrld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x4(%rbp),%r8d
mov    $0x6,%esi
lea    0xec1(%rip),%rdx
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
lea    -0xa(%rbp),%rdi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_scrld>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r8d
lea    0xed1(%rip),%rdx
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dT\00"
@stdout = global i32 0
define i32 @c_scrld(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* %3, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errorNotLvalue(void) { error("lvalue expected\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"lvalue expected\0A\00"
define void @errorNotLvalue() {
%1 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"lvalue expected\0A\00"
define void @errorNotLvalue() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
float BerechneKugelVolumen(float radius) {
  float volumen;
  volumen = 1.333 * 3.141 * radius * radius * radius;
  return volumen;
}


x86 assembly (clang, -O0):
<BerechneKugelVolumen>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BerechneKugelVolumen>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @BerechneKugelVolumen(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double 0x4010BF709B738E6D, %5
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fmul double %9, %11
%13 = fptrunc double %12 to float
store float %13, float* %3
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @BerechneKugelVolumen(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x4010BF709B738E6D
%4 = fmul double %3, %2
%5 = fmul double %4, %2
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
void *mem_alloc(size_t, void *, char *, int);
void *aug_alloc_loc(size_t size, void *parent, char *file, int line) {
  void *alloc;
  ;
  ;
  alloc = mem_alloc(size, parent, file, line);
  ;
  return alloc;
}


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

x86 assembly (clang, -O2):
<aug_alloc_loc>:
jmp    1030 <mem_alloc@plt>

LLVM IR (-O0):
define i8* @aug_alloc_loc(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i64, i64* %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i8* @mem_alloc(i64 %10, i8* %11, i8* %12, i32 %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
ret i8* %15
}

LLVM IR (-O2):
define i8* @aug_alloc_loc(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @mem_alloc(i64 %0, i8* %1, i8* %2, i32 %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ i86_gdt_initialize();
int /*<<< orphan*/ i86_idt_initialize(int);
int i86_cpu_initialize() {
  i86_gdt_initialize();
  i86_idt_initialize(0x8);
  return 0;
}


x86 assembly (clang, -O0):
<i86_cpu_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <i86_gdt_initialize@plt>
mov    $0x8,%edi
call   1040 <i86_idt_initialize@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i86_cpu_initialize>:
push   %rax
xor    %eax,%eax
call   1030 <i86_gdt_initialize@plt>
mov    $0x8,%edi
call   1040 <i86_idt_initialize@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i86_cpu_initialize() {
%1 = call i32 (...) @i86_gdt_initialize()
%2 = call i32 @i86_idt_initialize(i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @i86_cpu_initialize() {
%1 = tail call i32 (...) @i86_gdt_initialize()
%2 = tail call i32 @i86_idt_initialize(i32 8)
ret i32 0
}
__attribute__((no)) void f(int i) {
  if (i != 0x87654321)
    abort();
  asm("");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x87654321,-0x4(%rbp)
je     112d <f+0x1d>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x87654321,%edi
jne    1119 <f+0x9>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -2023406815
br i1 %4, label %5, label %6
5: ; preds = %1
unreachable
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = icmp eq i32 %0, -2023406815
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void html_disp_header(struct list *lst) {}


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

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

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

LLVM IR (-O2):
%struct.list = type opaque
define void @html_disp_header(%struct.list* nocapture %0) {
ret void
}
int pointerSize() {
  double *ptrArray[10];
  double **ptrPtr1;
  double **ptrPtr2;
  ptrPtr1 = ptrArray;
  ptrPtr2 = ptrPtr1 + 1;
  return (char *)ptrPtr2 - (char *)ptrPtr1;
}


x86 assembly (clang, -O0):
<pointerSize>:
push   %rbp
mov    %rsp,%rbp
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pointerSize() {
%1 = alloca [10 x double*]
%2 = alloca double**
%3 = alloca double**
%4 = getelementptr inbounds [10 x double*], [10 x double*]* %1, i64 0, i64 0
store double** %4, double*** %2
%5 = load double**, double*** %2
%6 = getelementptr inbounds double*, double** %5, i64 1
store double** %6, double*** %3
%7 = load double**, double*** %3
%8 = bitcast double** %7 to i8*
%9 = load double**, double*** %2
%10 = bitcast double** %9 to i8*
%11 = ptrtoint i8* %8 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @pointerSize() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void svctcp_rendezvous_abort(void) { abort(); }


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

x86 assembly (clang, -O2):
<svctcp_rendezvous_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @svctcp_rendezvous_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @svctcp_rendezvous_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ clip_y(long);
long get_chr_top(long y, long dy) {
  if (!clip_y(y))
    return (20 * 4);
  return (y - (dy / 2));
}


x86 assembly (clang, -O0):
<get_chr_top>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <clip_y@plt>
cmp    $0x0,%eax
jne    113f <get_chr_top+0x2f>
movq   $0x50,-0x8(%rbp)
jmp    1163 <get_chr_top+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_chr_top>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <clip_y@plt>
test   %eax,%eax
je     1135 <get_chr_top+0x25>
mov    %r14,%rax
shr    $0x3f,%rax
add    %r14,%rax
sar    %rax
sub    %rax,%rbx
jmp    113a <get_chr_top+0x2a>
mov    $0x50,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @get_chr_top(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = call i32 @clip_y(i64 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i64 80, i64* %3
br label %15
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = sdiv i64 %12, 2
%14 = sub nsw i64 %11, %13
store i64 %14, i64* %3
br label %15
15: ; preds = %10, %9
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @get_chr_top(i64 %0, i64 %1) {
%3 = tail call i32 @clip_y(i64 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = sdiv i64 %1, -2
%7 = add i64 %6, %0
br label %8
8: ; preds = %2, %5
%9 = phi i64 [ %7, %5 ], [ 80, %2 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ log_write(int, char *);
int /*<<< orphan*/ uart_init();
void log_init() {
  uart_init();
  log_write(0x04, "LOG: Logging has been initialized.");
}


x86 assembly (clang, -O0):
<log_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart_init@plt>
mov    $0x4,%edi
lea    0xec9(%rip),%rsi
call   1040 <log_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_init>:
push   %rax
xor    %eax,%eax
call   1030 <uart_init@plt>
lea    0xed1(%rip),%rsi
mov    $0x4,%edi
pop    %rax
jmp    1040 <log_write@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"LOG: Logging has been initialized.\00"
define void @log_init() {
%1 = call i32 (...) @uart_init()
%2 = call i32 @log_write(i32 4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"LOG: Logging has been initialized.\00"
define void @log_init() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 @log_write(i32 4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}