xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char rand();
void rand_buffer(unsigned char *buf, long buffer_size) {
  long i;
  for (i = 0; i < buffer_size; i++)
    buf[i] = rand();
}


x86 assembly (clang, -O0):
<rand_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    115b <rand_buffer+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <rand_buffer+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_buffer>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1144 <rand_buffer+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <rand_buffer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @rand_buffer(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call zeroext i8 (...) @rand()
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 %11, i8* %14
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add nsw i64 %16, 1
store i64 %17, i64* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @rand_buffer(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call zeroext i8 (...) @rand()
%7 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %6, i8* %7
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int bar(float, double);
int foo(int a) { return bar(3.0f, 2.0) + a + 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm1
call   1030 <bar@plt>
add    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
movss  0xee5(%rip),%xmm0
movsd  0xee5(%rip),%xmm1
call   1030 <bar@plt>
add    %ebx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @bar(float 3.000000e+00, double 2.000000e+00)
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @bar(float 3.000000e+00, double 2.000000e+00)
%3 = add i32 %0, 1
%4 = add i32 %3, %2
ret i32 %4
}
void lll_prof_enter_ull_low(void) {}


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

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

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

LLVM IR (-O2):
define void @lll_prof_enter_ull_low() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
int get_XCreateWindowEvent_height(void *_p) {
  return (int)((XCreateWindowEvent *)_p)->height;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XCreateWindowEvent_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t getpagesize();
size_t Page_Size(void) { return getpagesize(); }


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

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

LLVM IR (-O0):
define i64 @Page_Size() {
%1 = call i64 (...) @getpagesize()
ret i64 %1
}

LLVM IR (-O2):
define i64 @Page_Size() {
%1 = tail call i64 (...) @getpagesize()
ret i64 %1
}
/* Variables and functions */
int __simc(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/);
int simc_close(int fd) { return __simc(6, fd, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<simc_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <__simc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simc_close>:
mov    %edi,%esi
mov    $0x6,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <__simc@plt>

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

LLVM IR (-O2):
define i32 @simc_close(i32 %0) {
%2 = tail call i32 @__simc(i32 6, i32 %0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}
void genbgtzl_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbgtzl_idle() {
ret void
}
__attribute__((always_)) int __test_and_set_bit(int nr,
                                                volatile unsigned long *addr) {
  int oldbit;
  __asm__("btsl %2,%1\n\tsbbl %0,%0"
          : "=r"(oldbit), "=m"((*(volatile long *)addr))
          : "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_set_bit>:
bts    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void dump_sha1_key(uint8_t *sha1) {}


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

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

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

LLVM IR (-O2):
define void @dump_sha1_key(i32* nocapture %0) {
ret void
}
double hammersley(int index, int base) {
  int N, sum;
  for (N = 1, sum = 0; index > 0;) {
    int digit;
    digit = index % base;
    sum = sum * base + digit;
    N *= base;
    index = (int)(index / base);
  }
  return ((double)sum / N);
}


x86 assembly (clang, -O0):
<hammersley>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1152 <hammersley+0x52>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1118 <hammersley+0x18>
cvtsi2sdl -0x10(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammersley>:
test   %edi,%edi
jle    1132 <hammersley+0x32>
mov    %edi,%eax
mov    $0x1,%r8d
xor    %ecx,%ecx
xchg   %ax,%ax
cltd
idiv   %esi
mov    %ecx,%edi
imul   %esi,%edi
mov    %edx,%ecx
add    %edi,%ecx
imul   %esi,%r8d
test   %eax,%eax
jg     1110 <hammersley+0x10>
cvtsi2sd %ecx,%xmm0
cvtsi2sd %r8d,%xmm1
divsd  %xmm1,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @hammersley(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 1, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = srem i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %7
%19 = add nsw i32 %17, %18
store i32 %19, i32* %6
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = mul nsw i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = sdiv i32 %23, %24
store i32 %25, i32* %3
br label %8
26: ; preds = %8
%27 = load i32, i32* %6
%28 = sitofp i32 %27 to double
%29 = load i32, i32* %5
%30 = sitofp i32 %29 to double
%31 = fdiv double %28, %30
ret double %31
}

LLVM IR (-O2):
define double @hammersley(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %18
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = phi i32 [ %11, %4 ], [ 1, %2 ]
%8 = srem i32 %5, %1
%9 = mul nsw i32 %6, %1
%10 = add nsw i32 %8, %9
%11 = mul nsw i32 %7, %1
%12 = sdiv i32 %5, %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %4
%15 = sitofp i32 %10 to double
%16 = sitofp i32 %11 to double
%17 = fdiv double %15, %16
br label %18
18: ; preds = %14, %2
%19 = phi double [ %17, %14 ], [ 0.000000e+00, %2 ]
ret double %19
}
float cal_area(float a, float b) {
  float area = (2 * a * b * 3.14159);
  return (area);
}


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

x86 assembly (clang, -O2):
<cal_area>:
addss  %xmm0,%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @cal_area(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fmul float 2.000000e+00, %6
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fmul double %10, 3.141590e+00
%12 = fptrunc double %11 to float
store float %12, float* %5
%13 = load float, float* %5
ret float %13
}

LLVM IR (-O2):
define float @cal_area(float %0, float %1) {
%3 = fmul float %0, 2.000000e+00
%4 = fmul float %3, %1
%5 = fpext float %4 to double
%6 = fmul double %5, 3.141590e+00
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ strchr(char *, int);
int getbf() {
  int a;
next:
  a = getchar();
  if (a == -1)
    return -1;
  if (!strchr(",.[]+-<>!", a))
    goto next;
  return a;
}


x86 assembly (clang, -O0):
<getbf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1148 <getbf+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <getbf+0x4b>
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    1165 <getbf+0x45>
jmp    1128 <getbf+0x8>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbf>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     114c <getbf+0x2c>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %eax,%eax
je     1130 <getbf+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c",.[]+-<>!\00"
define i32 @getbf() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %3
store i32 -1, i32* %1
br label %15
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @strchr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
br label %3
13: ; preds = %8
%14 = load i32, i32* %2
store i32 %14, i32* %1
br label %15
15: ; preds = %13, %7
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c",.[]+-<>!\00"
define i32 @getbf() {
br label %1
1: ; preds = %4, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, -1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @strchr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %1, label %7
7: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x50() {
  Assert_real((ispunct(80) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              405, ("ispunct should be 0 for P"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x50>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x195,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x50>:
push   %rax
mov    $0x50,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x195,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for P\00"
define void @t_ispunct_0x50() {
%1 = call i64 @ispunct(i32 80)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for P\00"
define void @t_ispunct_0x50() {
%1 = tail call i64 @ispunct(i32 80)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
void glTexParameterf(GLenum target, GLenum pname, GLfloat param) {}


x86 assembly (clang, -O0):
<glTexParameterf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glTexParameterf(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
ret void
}

LLVM IR (-O2):
define void @glTexParameterf(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void sig_child03(int signo) {
  pid_t pid;
  int state;
  while ((pid = waitpid(-1, &state, WNOHANG)) > 0)
    printf("child pid[%d] terminated.\n", pid);
}


x86 assembly (clang, -O0):
<sig_child03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <sig_child03+0x42>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <sig_child03+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_child03>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117e <sig_child03+0x5e>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <sig_child03+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [27 x i8] c"child pid[%d] terminated.\0A\00"
define void @sig_child03(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [27 x i8] c"child pid[%d] terminated.\0A\00"
define void @sig_child03(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ escape(void *);
void *malloc(int);
__attribute__((no)) void *leakFoo() {
  void *ptr = malloc(3);
  escape(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<leakFoo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <escape@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leakFoo>:
push   %rbx
mov    $0x3,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <escape@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @leakFoo() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 3)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @escape(i8* %3)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @leakFoo() {
%1 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
%2 = tail call i32 @escape(i8* %1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ spiAssertCs();
int /*<<< orphan*/ spiTransfer(int);
void WriteSpiData(volatile unsigned int data) {
  spiAssertCs();
  spiTransfer(0x0100 | data);
  spiAssertCs();
}


x86 assembly (clang, -O0):
<WriteSpiData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <spiAssertCs@plt>
mov    -0x4(%rbp),%edi
or     $0x100,%edi
call   1030 <spiTransfer@plt>
mov    $0x0,%al
call   1040 <spiAssertCs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteSpiData>:
push   %rax
mov    %edi,0x4(%rsp)
xor    %eax,%eax
call   1040 <spiAssertCs@plt>
mov    $0x100,%edi
or     0x4(%rsp),%edi
call   1030 <spiTransfer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <spiAssertCs@plt>

LLVM IR (-O0):
define void @WriteSpiData(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = call i32 (...) @spiAssertCs()
%4 = load volatile i32, i32* %2
%5 = or i32 256, %4
%6 = call i32 @spiTransfer(i32 %5)
%7 = call i32 (...) @spiAssertCs()
ret void
}

LLVM IR (-O2):
define void @WriteSpiData(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = tail call i32 (...) @spiAssertCs()
%4 = load volatile i32, i32* %2
%5 = or i32 %4, 256
%6 = tail call i32 @spiTransfer(i32 %5)
%7 = tail call i32 (...) @spiAssertCs()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_be32(const uint8_t *p) {
  return (((uint32_t)p[0]) << 24) | (((uint32_t)p[1]) << 16) |
         (((uint32_t)p[2]) << 8) | p[3];
}


x86 assembly (clang, -O0):
<get_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_be32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_be32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_be32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void __inotify_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<__inotify_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @__inotify_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_label_name(char *);
int /*<<< orphan*/ output_with_tab(char *);
void gen_call(char *sname) {
  output_with_tab("call ");
  output_label_name(sname);
  newline();
}


x86 assembly (clang, -O0):
<gen_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x8(%rbp),%rdi
call   1040 <output_label_name@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_call>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    %rbx,%rdi
call   1040 <output_label_name@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"call \00"
define void @gen_call(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @output_label_name(i8* %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"call \00"
define void @gen_call(i8* %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_label_name(i8* %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int hiperfatorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("\nDigite um numero: ");
  scanf("%d", &n);
  printf("\nO hiperfatorial desse numero eh: %d", hiperfatorial(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <hiperfatorial@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <hiperfatorial@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0ADigite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0AO hiperfatorial desse numero eh: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @hiperfatorial(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0ADigite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0AO hiperfatorial desse numero eh: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @hiperfatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
DECLARE_INTERFACE_(IXvidDecoder, IUnknown) {}


x86 assembly (clang, -O0):
<DECLARE_INTERFACE_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @DECLARE_INTERFACE_(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ const uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
size_t FindSym(const uint8_t *d, uint8_t s, size_t shift, size_t len) {
  size_t i;
  for (i = shift; i < len; i++)
    if (d[i] == s)
      return i;
  exit(2);
}


x86 assembly (clang, -O0):
<FindSym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1174 <FindSym+0x64>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x10(%rbp),%rax
jne    115e <FindSym+0x4e>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret
jmp    1163 <FindSym+0x53>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1130 <FindSym+0x20>
mov    $0x2,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<FindSym>:
push   %rax
cmp    %rcx,%rdx
jae    112f <FindSym+0x1f>
cs nopw 0x0(%rax,%rax,1)
cmp    %rsi,(%rdi,%rdx,8)
je     1139 <FindSym+0x29>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1120 <FindSym+0x10>
mov    $0x2,%edi
call   1030 <exit@plt>
mov    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @FindSym(i64* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64* %0, i64** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %7
store i64 %10, i64* %9
br label %11
11: ; preds = %25, %4
%12 = load i64, i64* %9
%13 = load i64, i64* %8
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load i64*, i64** %5
%17 = load i64, i64* %9
%18 = getelementptr inbounds i64, i64* %16, i64 %17
%19 = load i64, i64* %18
%20 = load i64, i64* %6
%21 = icmp eq i64 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %15
%23 = load i64, i64* %9
ret i64 %23
24: ; preds = %15
br label %25
25: ; preds = %24
%26 = load i64, i64* %9
%27 = add i64 %26, 1
store i64 %27, i64* %9
br label %11
28: ; preds = %11
%29 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define i64 @FindSym(i64* nocapture %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %2, %3
br i1 %5, label %6, label %15
6: ; preds = %4, %12
%7 = phi i64 [ %13, %12 ], [ %2, %4 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %12
11: ; preds = %6
ret i64 %7
12: ; preds = %6
%13 = add i64 %7, 1
%14 = icmp eq i64 %13, %3
br i1 %14, label %15, label %6
15: ; preds = %12, %4
%16 = tail call i32 @exit(i32 2)
unreachable
}
long long bit01() { return 0x0000000000000002LL; }


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

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

LLVM IR (-O0):
define i64 @bit01() {
ret i64 2
}

LLVM IR (-O2):
define i64 @bit01() {
ret i64 2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i = 0, N = 10;
  do {
    printf("%d \n", i);
    i++;
  } while (i >= N);
  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)
movl   $0x0,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%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
store i32 0, i32* %6
store i32 10, i32* %7
br label %8
8: ; preds = %13, %2
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
br label %13
13: ; preds = %8
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp sge i32 %14, %15
br i1 %16, label %8, label %17
17: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ inbuf;

/* Variables and functions */
int /*<<< orphan*/ test(char *, char *, int, int);
void test_tscii(void) {
  char inbuf[1] = {0x82};
  test("TSCII", inbuf, sizeof(inbuf), 3);
  test("TSCII", inbuf, sizeof(inbuf), 6);
  test("TSCII", inbuf, sizeof(inbuf), 9);
}


x86 assembly (clang, -O0):
<test_tscii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <test@plt>
lea    -0x1(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x1,%edx
mov    $0x6,%ecx
call   1030 <test@plt>
lea    -0x1(%rbp),%rsi
lea    0xea1(%rip),%rdi
mov    $0x1,%edx
mov    $0x9,%ecx
call   1030 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tscii>:
push   %r14
push   %rbx
push   %rax
movb   $0x82,0x7(%rsp)
lea    0xee0(%rip),%rbx
lea    0x7(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x6,%ecx
call   1030 <test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x9,%ecx
call   1030 <test@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_tscii.inbuf = [1 x i8] c"\82"
@.str = [6 x i8] c"TSCII\00"
define void @test_tscii() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i32 1, i32 3)
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%6 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i32 1, i32 6)
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%8 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"TSCII\00"
define void @test_tscii() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 -126, i8* %2
%3 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1, i32 3)
%4 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1, i32 6)
%5 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1, i32 9)
ret void
}
void debug_printf(const char *format, ...) { format = format; }


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

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

LLVM IR (-O0):
define void @debug_printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8* %3, i8** %2
ret void
}

LLVM IR (-O2):
define void @debug_printf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR99_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR99_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR99_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void init_mpi(int argc, char **argv) {}


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

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

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

LLVM IR (-O2):
define void @init_mpi(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_Array(int *array, int lastInd) {
  for (int i = 0; i <= lastInd; i++) {
    printf("%d", array[i]);
  }
}


x86 assembly (clang, -O0):
<print_Array>:
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
jg     1157 <print_Array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_Array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_Array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
js     1145 <print_Array+0x35>
mov    %esi,%r12d
mov    %rdi,%r14
add    $0x1,%r12d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_Array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @print_Array(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 sle 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 @printf(i8* getelementptr inbounds ([3 x i8], [3 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
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_Array(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *bin) {
  printf("Usage: %s [-a <n>] [-k 0xHHHHHHHH] [-o <outfile>] [-sx <width>] [-sy "
         "<height>] [-hf] [-vf] [-r <D>] [-res <x>:<y>] [-w <n>] [-dst ...] "
         "<s0_in> <s1_in>\n",
         bin);
}


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

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

LLVM IR (-O0):
@.str = [152 x i8] c"Usage: %s [-a <n>] [-k 0xHHHHHHHH] [-o <outfile>] [-sx <width>] [-sy <height>] [-hf] [-vf] [-r <D>] [-res <x>:<y>] [-w <n>] [-dst ...] <s0_in> <s1_in>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [152 x i8] c"Usage: %s [-a <n>] [-k 0xHHHHHHHH] [-o <outfile>] [-sx <width>] [-sy <height>] [-hf] [-vf] [-r <D>] [-res <x>:<y>] [-w <n>] [-dst ...] <s0_in> <s1_in>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int listen_socket(const char *name) {}


x86 assembly (clang, -O0):
<listen_socket>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @listen_socket(i8* nocapture readnone %0) {
ret i32 undef
}
float LerpAngle(float a2, float a1, float frac) {
  if (a1 - a2 > 180)
    a1 -= 360;
  else if (a1 - a2 < -180)
    a1 += 360;
  return a2 + frac * (a1 - a2);
}


x86 assembly (clang, -O0):
<LerpAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xedb(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1149 <LerpAngle+0x49>
movss  -0x8(%rbp),%xmm0
movss  0xecd(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117b <LerpAngle+0x7b>
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
movss  0xea9(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1176 <LerpAngle+0x76>
movss  0xe9c(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117b <LerpAngle+0x7b>
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LerpAngle>:
movaps %xmm1,%xmm3
subss  %xmm0,%xmm3
ucomiss 0xef2(%rip),%xmm3
jbe    111a <LerpAngle+0x1a>
addss  0xef4(%rip),%xmm1
jmp    112f <LerpAngle+0x2f>
movss  0xee2(%rip),%xmm4
ucomiss %xmm3,%xmm4
jbe    112f <LerpAngle+0x2f>
addss  0xed9(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm1,%xmm2
addss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @LerpAngle(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* %5
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = fcmp ogt float %9, 1.800000e+02
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load float, float* %5
%13 = fsub float %12, 3.600000e+02
store float %13, float* %5
br label %23
14: ; preds = %3
%15 = load float, float* %5
%16 = load float, float* %4
%17 = fsub float %15, %16
%18 = fcmp olt float %17, -1.800000e+02
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load float, float* %5
%21 = fadd float %20, 3.600000e+02
store float %21, float* %5
br label %22
22: ; preds = %19, %14
br label %23
23: ; preds = %22, %11
%24 = load float, float* %4
%25 = load float, float* %6
%26 = load float, float* %5
%27 = load float, float* %4
%28 = fsub float %26, %27
%29 = call float @llvm.fmuladd.f32(float %25, float %28, float %24)
ret float %29
}

LLVM IR (-O2):
define float @LerpAngle(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = fcmp ogt float %4, 1.800000e+02
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = fadd float %1, -3.600000e+02
br label %12
8: ; preds = %3
%9 = fcmp olt float %4, -1.800000e+02
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = fadd float %1, 3.600000e+02
br label %12
12: ; preds = %8, %10, %6
%13 = phi float [ %7, %6 ], [ %11, %10 ], [ %1, %8 ]
%14 = fsub float %13, %0
%15 = tail call float @llvm.fmuladd.f32(float %2, float %14, float %0)
ret float %15
}
/* Variables and functions */
int log10f(float const);
float coeff_to_db(const float coeff) {
  if (coeff < .0001)
    return -80;
  return 20 * log10f(coeff);
}


x86 assembly (clang, -O0):
<coeff_to_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <coeff_to_db+0x3a>
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1160 <coeff_to_db+0x50>
movss  -0x8(%rbp),%xmm0
call   1030 <log10f@plt>
imul   $0x14,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coeff_to_db>:
push   %rax
cvtss2sd %xmm0,%xmm1
movsd  0xeeb(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    112d <coeff_to_db+0x1d>
movss  0xed5(%rip),%xmm0
pop    %rax
ret
call   1030 <log10f@plt>
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @coeff_to_db(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 1.000000e-04
br i1 %6, label %7, label %8
7: ; preds = %1
store float -8.000000e+01, float* %2
br label %13
8: ; preds = %1
%9 = load float, float* %3
%10 = call i32 @log10f(float %9)
%11 = mul nsw i32 20, %10
%12 = sitofp i32 %11 to float
store float %12, float* %2
br label %13
13: ; preds = %8, %7
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @coeff_to_db(float %0) {
%2 = fpext float %0 to double
%3 = fcmp olt double %2, 1.000000e-04
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @log10f(float %0)
%6 = mul nsw i32 %5, 20
%7 = sitofp i32 %6 to float
br label %8
8: ; preds = %1, %4
%9 = phi float [ %7, %4 ], [ -8.000000e+01, %1 ]
ret float %9
}
int __attribute__((__no__)) foo(unsigned int x) {
  if (!(x == 4 || x == 6) || (x == 2 || x == 6))
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     111b <foo+0x1b>
cmpl   $0x6,-0x8(%rbp)
jne    112f <foo+0x2f>
cmpl   $0x2,-0x8(%rbp)
je     112f <foo+0x2f>
cmpl   $0x6,-0x8(%rbp)
jne    113b <foo+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <foo+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
and    $0xfffffffd,%eax
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
and    $0xfffffffb,%edi
cmp    $0x2,%edi
lea    -0x1(%rcx,%rcx,1),%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = and i32 %0, -3
%3 = icmp ne i32 %2, 4
%4 = and i32 %0, -5
%5 = icmp eq i32 %4, 2
%6 = or i1 %5, %3
%7 = select i1 %6, i32 1, i32 -1
ret i32 %7
}