xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
int /*<<< orphan*/ prg32setBank0(int);
void m240_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  chr8setBank0((val & 0xF) << 13);
  prg32setBank0((val >> 4) << 15);
}


x86 assembly (clang, -O0):
<m240_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xf,%edi
shl    $0xd,%edi
call   1040 <chr8setBank0@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
shl    $0xf,%edi
call   1030 <prg32setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m240_setParams>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
and    $0xf,%edi
shl    $0xd,%edi
call   1040 <chr8setBank0@plt>
and    $0xfffffff0,%ebx
shl    $0xb,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <prg32setBank0@plt>

LLVM IR (-O0):
define void @m240_setParams(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 15
%8 = shl i32 %7, 13
%9 = call i32 @chr8setBank0(i32 %8)
%10 = load i32, i32* %4
%11 = ashr i32 %10, 4
%12 = shl i32 %11, 15
%13 = call i32 @prg32setBank0(i32 %12)
ret void
}

LLVM IR (-O2):
define void @m240_setParams(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = and i32 %3, 122880
%5 = tail call i32 @chr8setBank0(i32 %4)
%6 = shl i32 %1, 11
%7 = and i32 %6, -32768
%8 = tail call i32 @prg32setBank0(i32 %7)
ret void
}
void mtarch_start(struct mtarch_thread *thread, void (*function)(void *data),
                  void *data) {}


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

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

LLVM IR (-O0):
%struct.mtarch_thread = type opaque
define void @mtarch_start(%struct.mtarch_thread* %0, void (i8*)* %1, i8* %2) {
%4 = alloca %struct.mtarch_thread*
%5 = alloca void (i8*)*
%6 = alloca i8*
store %struct.mtarch_thread* %0, %struct.mtarch_thread** %4
store void (i8*)* %1, void (i8*)** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.mtarch_thread = type opaque
define void @mtarch_start(%struct.mtarch_thread* nocapture %0, void (i8*)* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int f63(int *);
int f64(int *p) { return f63(p); }


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

x86 assembly (clang, -O2):
<f64>:
jmp    1030 <f63@plt>

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

LLVM IR (-O2):
define i32 @f64(i32* %0) {
%2 = tail call i32 @f63(i32* %0)
ret i32 %2
}
int digit_sum(int n) {
  int sum = 0;
  while (n > 0) {
    int rem = n % 10;
    n /= 10;
    sum += rem;
  }
  return sum;
}


x86 assembly (clang, -O0):
<digit_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1142 <digit_sum+0x42>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110e <digit_sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_sum>:
xor    %eax,%eax
test   %edi,%edi
jle    112d <digit_sum+0x2d>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <digit_sum+0x10>
ret

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

LLVM IR (-O2):
define i32 @digit_sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = urem i32 %4, 10
%7 = udiv i32 %4, 10
%8 = add nuw nsw i32 %6, %5
%9 = icmp ult i32 %4, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ khrIcdOsVendorsEnumerateOnce();
void khrIcdInitialize(void) { khrIcdOsVendorsEnumerateOnce(); }


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

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

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

LLVM IR (-O2):
define void @khrIcdInitialize() {
%1 = tail call i32 (...) @khrIcdOsVendorsEnumerateOnce()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int xml_readmore(FILE *fp, char *buf, int bufsize, int *bufpos) {
  if (!feof(fp) && fgets(buf, bufsize, fp))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<xml_readmore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
jne    116f <xml_readmore+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     116f <xml_readmore+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <xml_readmore+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_readmore>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1040 <feof@plt>
test   %eax,%eax
jne    114e <xml_readmore+0x2e>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1153 <xml_readmore+0x33>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @xml_readmore(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
%10 = load i32*, i32** %6
%11 = call i32 @feof(i32* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i32*, i32** %6
%17 = call i64 @fgets(i8* %14, i32 %15, i32* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 0, i32* %5
br label %21
20: ; preds = %13, %4
store i32 1, i32* %5
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @xml_readmore(i32* nocapture %0, i8* %1, i32 %2, i32* nocapture readnone %3) {
%5 = tail call i32 @feof(i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i64 @fgets(i8* %1, i32 %2, i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %4
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ 1, %10 ], [ 0, %7 ]
ret i32 %12
}
/* Type definitions */
typedef long clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
long clock();
void delay(int milliseconds) {
  long pause;
  clock_t now, then;
  pause = milliseconds * (CLOCKS_PER_SEC / 1000);
  now = then = clock();
  while ((now - then) < pause)
    now = clock();
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
imul   %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1171 <delay+0x61>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
jmp    114f <delay+0x3f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %r15
push   %r14
push   %rbx
mov    0x2ecc(%rip),%rax
movslq (%rax),%rax
imul   $0x10624dd3,%rax,%r14
mov    %r14,%rax
shr    $0x3f,%rax
sar    $0x26,%r14
add    %eax,%r14d
imul   %edi,%r14d
xor    %eax,%eax
call   1030 <clock@plt>
test   %r14d,%r14d
jle    115f <delay+0x4f>
mov    %rax,%r15
movslq %r14d,%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
sub    %r15,%rax
cmp    %rbx,%rax
jl     1150 <delay+0x40>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* @CLOCKS_PER_SEC
%8 = sdiv i32 %7, 1000
%9 = mul nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = call i64 (...) @clock()
store i64 %11, i64* %5
store i64 %11, i64* %4
br label %12
12: ; preds = %18, %1
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = sub nsw i64 %13, %14
%16 = load i64, i64* %3
%17 = icmp slt i64 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i64 (...) @clock()
store i64 %19, i64* %4
br label %12
20: ; preds = %12
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 1000
%4 = mul nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = tail call i64 (...) @clock()
%7 = icmp sgt i32 %4, 0
br i1 %7, label %8, label %12
8: ; preds = %1, %8
%9 = tail call i64 (...) @clock()
%10 = sub nsw i64 %9, %6
%11 = icmp slt i64 %10, %5
br i1 %11, label %8, label %12
12: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_BIO_strings();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void *init() {
  SSL_load_error_strings();
  SSL_library_init();
  ERR_load_BIO_strings();
  OpenSSL_add_all_algorithms();
  return NULL;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1060 <ERR_load_BIO_strings@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1060 <ERR_load_BIO_strings@plt>
xor    %eax,%eax
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @init() {
%1 = call i32 (...) @SSL_load_error_strings()
%2 = call i32 (...) @SSL_library_init()
%3 = call i32 (...) @ERR_load_BIO_strings()
%4 = call i32 (...) @OpenSSL_add_all_algorithms()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @init() {
%1 = tail call i32 (...) @SSL_load_error_strings()
%2 = tail call i32 (...) @SSL_library_init()
%3 = tail call i32 (...) @ERR_load_BIO_strings()
%4 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret i8* null
}
void vec2_lerp(float *dst, float *b, float t) {
  float ax = dst[0], ay = dst[1];
  dst[0] = ax + t * (b[0] - ax);
  dst[1] = ay + t * (b[1] - ay);
}


x86 assembly (clang, -O0):
<vec2_lerp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
subss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm2
subss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_lerp>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
movss  (%rsi),%xmm3
subss  %xmm1,%xmm3
mulss  %xmm0,%xmm3
addss  %xmm1,%xmm3
movss  %xmm3,(%rdi)
movss  0x4(%rsi),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @vec2_lerp(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
store float %11, float* %7
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
store float %14, float* %8
%15 = load float, float* %7
%16 = load float, float* %6
%17 = load float*, float** %5
%18 = getelementptr inbounds float, float* %17, i64 0
%19 = load float, float* %18
%20 = load float, float* %7
%21 = fsub float %19, %20
%22 = call float @llvm.fmuladd.f32(float %16, float %21, float %15)
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 0
store float %22, float* %24
%25 = load float, float* %8
%26 = load float, float* %6
%27 = load float*, float** %5
%28 = getelementptr inbounds float, float* %27, i64 1
%29 = load float, float* %28
%30 = load float, float* %8
%31 = fsub float %29, %30
%32 = call float @llvm.fmuladd.f32(float %26, float %31, float %25)
%33 = load float*, float** %4
%34 = getelementptr inbounds float, float* %33, i64 1
store float %32, float* %34
ret void
}

LLVM IR (-O2):
define void @vec2_lerp(float* nocapture %0, float* nocapture %1, float %2) {
%4 = load float, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = load float, float* %1
%8 = fsub float %7, %4
%9 = tail call float @llvm.fmuladd.f32(float %2, float %8, float %4)
store float %9, float* %0
%10 = getelementptr inbounds float, float* %1, i64 1
%11 = load float, float* %10
%12 = fsub float %11, %6
%13 = tail call float @llvm.fmuladd.f32(float %2, float %12, float %6)
store float %13, float* %5
ret void
}
/* Variables and functions */
float ss2qca();
float ss2qca_() { return ss2qca(); }


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

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

LLVM IR (-O0):
define float @ss2qca_() {
%1 = call float (...) @ss2qca()
ret float %1
}

LLVM IR (-O2):
define float @ss2qca_() {
%1 = tail call float (...) @ss2qca()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ xor_encode(unsigned char *, unsigned char const *, size_t,
                              unsigned char *, int);
void caesar_encode(unsigned char *enc, const unsigned char *dec, size_t len,
                   unsigned char key) {
  xor_encode(enc, dec, len, &key, 1);
}


x86 assembly (clang, -O0):
<caesar_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x19(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <xor_encode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caesar_encode>:
push   %rax
mov    %cl,0x7(%rsp)
lea    0x7(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <xor_encode@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @caesar_encode(i8* %0, i8* %1, i64 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8 %3, i8* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @xor_encode(i8* %9, i8* %10, i64 %11, i8* %8, i32 1)
ret void
}

LLVM IR (-O2):
define void @caesar_encode(i8* %0, i8* %1, i64 %2, i8 zeroext %3) {
%5 = alloca i8
store i8 %3, i8* %5
%6 = call i32 @xor_encode(i8* %0, i8* %1, i64 %2, i8* %5, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer2;
typedef int /*<<< orphan*/ buffer1;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
void function(int a, int b, int c) {
  char buffer1[5];
  char buffer2[10];
  memset(buffer1, 'a', sizeof(buffer1));
  memset(buffer2, 'b', sizeof(buffer2));
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x11(%rbp),%rdi
mov    $0x61,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
lea    -0x1b(%rbp),%rdi
mov    $0x62,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
sub    $0x18,%rsp
lea    0x9(%rsp),%rdi
mov    $0x61,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
lea    0xe(%rsp),%rdi
mov    $0x62,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @function(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i8]
%8 = alloca [10 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i8 signext 97, i32 5)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%12 = call i32 @memset(i8* %11, i8 signext 98, i32 10)
ret void
}

LLVM IR (-O2):
define void @function(i32 %0, i32 %1, i32 %2) {
%4 = alloca [5 x i8]
%5 = alloca [10 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%8 = call i32 @memset(i8* %6, i8 signext 97, i32 5)
%9 = call i32 @memset(i8* %7, i8 signext 98, i32 10)
ret void
}
int leaps_thru_end_of_nonneg(int y) { return y / 4 - y / 100 + y / 400; }


x86 assembly (clang, -O0):
<leaps_thru_end_of_nonneg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leaps_thru_end_of_nonneg>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
movslq %edi,%rcx
imul   $0xffffffffae147ae1,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
add    %eax,%edx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @leaps_thru_end_of_nonneg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 4
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 100
%7 = sub nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 400
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @leaps_thru_end_of_nonneg(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = sdiv i32 %0, -100
%4 = add nsw i32 %3, %2
%5 = sdiv i32 %0, 400
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned long xatoull_range_sfx(char const *, unsigned long, unsigned long,
                                struct suffix_mult const *);
unsigned long xatoul_range_sfx(const char *str, unsigned long l,
                               unsigned long u, const struct suffix_mult *sfx) {
  return xatoull_range_sfx(str, l, u, sfx);
}


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

x86 assembly (clang, -O2):
<xatoul_range_sfx>:
jmp    1030 <xatoull_range_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_range_sfx(i8* %0, i64 %1, i64 %2, %struct.suffix_mult* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca %struct.suffix_mult*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store %struct.suffix_mult* %3, %struct.suffix_mult** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load %struct.suffix_mult*, %struct.suffix_mult** %8
%13 = call i64 @xatoull_range_sfx(i8* %9, i64 %10, i64 %11, %struct.suffix_mult* %12)
ret i64 %13
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_range_sfx(i8* %0, i64 %1, i64 %2, %struct.suffix_mult* %3) {
%5 = tail call i64 @xatoull_range_sfx(i8* %0, i64 %1, i64 %2, %struct.suffix_mult* %3)
ret i64 %5
}
/* Type definitions */
struct nc_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ncb_put(struct nc_buff *);
int netchannel_send_raw(struct nc_buff *);
int transmit_data(struct nc_buff *ncb) {
  int err;
  err = netchannel_send_raw(ncb);
  if (err)
    return err;
  ncb_put(ncb);
  return 0;
}


x86 assembly (clang, -O0):
<transmit_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <netchannel_send_raw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114d <transmit_data+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <transmit_data+0x3d>
mov    -0x10(%rbp),%rdi
call   1030 <ncb_put@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transmit_data>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <netchannel_send_raw@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1139 <transmit_data+0x19>
mov    %rbx,%rdi
call   1030 <ncb_put@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.nc_buff = type { i32 }
define i32 @transmit_data(%struct.nc_buff* %0) {
%2 = alloca i32
%3 = alloca %struct.nc_buff*
%4 = alloca i32
store %struct.nc_buff* %0, %struct.nc_buff** %3
%5 = load %struct.nc_buff*, %struct.nc_buff** %3
%6 = call i32 @netchannel_send_raw(%struct.nc_buff* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load %struct.nc_buff*, %struct.nc_buff** %3
%13 = call i32 @ncb_put(%struct.nc_buff* %12)
store i32 0, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.nc_buff = type { i32 }
define i32 @transmit_data(%struct.nc_buff* %0) {
%2 = tail call i32 @netchannel_send_raw(%struct.nc_buff* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @ncb_put(%struct.nc_buff* %0)
br label %6
6: ; preds = %1, %4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ info(char *);
void gdb_break() { info("GDB BREAK!"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"GDB BREAK!\00"
define void @gdb_break() {
%1 = call i32 @info(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"GDB BREAK!\00"
define void @gdb_break() {
%1 = tail call i32 @info(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((always_)) void out_log_discard(const char *file, int line,
                                              const char *func, int level,
                                              const char *fmt, ...) {
  (void)file;
  (void)line;
  (void)func;
  (void)level;
  (void)fmt;
}


x86 assembly (clang, -O0):
<out_log_discard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @out_log_discard(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, ...) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
ret void
}

LLVM IR (-O2):
define void @out_log_discard(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3, i8* nocapture %4, ...) {
ret void
}
int row_byte_normal(int row) { return 0x21 + row; }


x86 assembly (clang, -O0):
<row_byte_normal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x21,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_byte_normal>:
lea    0x21(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @row_byte_normal(i32 %0) {
%2 = add nsw i32 %0, 33
ret i32 %2
}
void bar(const char *x, int y, const char *z) {}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bar(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_quaddobl_create(int k) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(609, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syspool_quaddobl_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x261,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syspool_quaddobl_create>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x261,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syspool_quaddobl_create(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 609, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syspool_quaddobl_create(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 609, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("sl -- A reliable process terminator\n"
         "Usage: sl [-s SECS] PID\n\n"
         "Options:\n\n"
         "-w SECS    Wait SECS seconds for the process to end\n"
         "           (Default: 15 seconds)\n"
         "-e         Waits until the process has terminated "
         "and does not time out.\n");
}


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

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

LLVM IR (-O0):
@.str = [230 x i8] c"sl -- A reliable process terminator\0AUsage: sl [-s SECS] PID\0A\0AOptions:\0A\0A-w SECS Wait SECS seconds for the process to end\0A (Default: 15 seconds)\0A-e Waits until the process has terminated and does not time out.\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [229 x i8] c"sl -- A reliable process terminator\0AUsage: sl [-s SECS] PID\0A\0AOptions:\0A\0A-w SECS Wait SECS seconds for the process to end\0A (Default: 15 seconds)\0A-e Waits until the process has terminated and does not time out.\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([229 x i8], [229 x i8]* @str, i64 0, i64 0))
ret void
}
long f2() { return "asdf"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"asdf\00"
define i64 @f2() {
ret i64 ptrtoint ([5 x i8]* @.str to i64)
}

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
define i64 @f2() {
ret i64 ptrtoint ([5 x i8]* @.str to i64)
}
int fahr2celcius(int f) { return ((5 * (f - 32)) / 9); }


x86 assembly (clang, -O0):
<fahr2celcius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr2celcius>:
lea    (%rdi,%rdi,4),%eax
add    $0xffffff60,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fahr2celcius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = mul nsw i32 5, %4
%6 = sdiv i32 %5, 9
ret i32 %6
}

LLVM IR (-O2):
define i32 @fahr2celcius(i32 %0) {
%2 = mul i32 %0, 5
%3 = add i32 %2, -160
%4 = sdiv i32 %3, 9
ret i32 %4
}
char *_fcvt(value, ndigit, decpt, sign)
double value;
int ndigit, *decpt, *sign;
{ return cvt(value, ndigit, decpt, sign, 0); }


x86 assembly (clang, -O0):
<_fcvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fcvt>:
push   %rax
xor    %ecx,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @_fcvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %9, i32 %10, i32* %11, i32* %12, i32 0)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @_fcvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %0, i32 %1, i32* %2, i32* %3, i32 0)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void FinalizeFiles(void) {}


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

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

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

LLVM IR (-O2):
define void @FinalizeFiles() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Vdp2DrawBackScreen();
void VIDSoftVdp2DrawStart(void) { Vdp2DrawBackScreen(); }


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

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

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

LLVM IR (-O2):
define void @VIDSoftVdp2DrawStart() {
%1 = tail call i32 (...) @Vdp2DrawBackScreen()
ret void
}
/* Variables and functions */
int DoWorkVec(int);
int main() {
  int err = 0;
  for (int W = 1; W <= 16; W <<= 1)
    err |= DoWorkVec(W);
  return err;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jg     1153 <main+0x43>
mov    -0xc(%rbp),%edi
call   1030 <DoWorkVec@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%edi
call   1030 <DoWorkVec@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <DoWorkVec@plt>
mov    %eax,%ebp
or     %ebx,%ebp
mov    $0x4,%edi
call   1030 <DoWorkVec@plt>
mov    %eax,%r14d
mov    $0x8,%edi
call   1030 <DoWorkVec@plt>
mov    %eax,%ebx
or     %r14d,%ebx
or     %ebp,%ebx
mov    $0x10,%edi
call   1030 <DoWorkVec@plt>
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @DoWorkVec(i32 1)
%2 = tail call i32 @DoWorkVec(i32 2)
%3 = or i32 %2, %1
%4 = tail call i32 @DoWorkVec(i32 4)
%5 = or i32 %4, %3
%6 = tail call i32 @DoWorkVec(i32 8)
%7 = or i32 %6, %5
%8 = tail call i32 @DoWorkVec(i32 16)
%9 = or i32 %8, %7
ret i32 %9
}
unsigned long rotateR_fun_ulong(unsigned long x, int i) {
  if ((i %= 40) == 0)
    return x;
  return (x << (40 - i)) | (x >> i);
}


x86 assembly (clang, -O0):
<rotateR_fun_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x28,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmp    $0x0,%edx
jne    112f <rotateR_fun_ulong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <rotateR_fun_ulong+0x54>
mov    -0x10(%rbp),%rax
mov    $0x28,%ecx
sub    -0x14(%rbp),%ecx
mov    %ecx,%ecx
shl    %cl,%rax
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_ulong>:
movslq %esi,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
shl    $0x3,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
mov    $0x28,%cl
sub    %dl,%cl
mov    %rdi,%rsi
shl    %cl,%rsi
mov    %rdi,%rax
mov    %edx,%ecx
shr    %cl,%rax
or     %rsi,%rax
test   %edx,%edx
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @rotateR_fun_ulong(i64 %0, i32 %1) {
%3 = srem i32 %1, 40
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 40, %3
%6 = zext i32 %5 to i64
%7 = shl i64 %0, %6
%8 = zext i32 %3 to i64
%9 = lshr i64 %0, %8
%10 = or i64 %7, %9
%11 = select i1 %4, i64 %0, i64 %10
ret i64 %11
}
void glDepthRangex(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDepthRangex() {
ret void
}
/* Variables and functions */
int fifo_byte_length();
int fifo_byte_available() { return 32768 - 1 - fifo_byte_length(); }


x86 assembly (clang, -O0):
<fifo_byte_available>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fifo_byte_length@plt>
mov    %eax,%ecx
mov    $0x7fff,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_byte_available>:
push   %rax
xor    %eax,%eax
call   1030 <fifo_byte_length@plt>
mov    $0x7fff,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fifo_byte_available() {
%1 = call i32 (...) @fifo_byte_length()
%2 = sub nsw i32 32767, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @fifo_byte_available() {
%1 = tail call i32 (...) @fifo_byte_length()
%2 = sub nsw i32 32767, %1
ret i32 %2
}
void invert_str(char *in) {
  char t;
  while (t = *in) {
    *in++ = ~t;
  }
}


x86 assembly (clang, -O0):
<invert_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1138 <invert_str+0x38>
movsbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1108 <invert_str+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert_str>:
mov    (%rdi),%al
test   %al,%al
je     1120 <invert_str+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
not    %al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <invert_str+0x10>
ret

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

LLVM IR (-O2):
define void @invert_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = xor i8 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %7, i8* %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int j;
  char *buf;
  for (j = 0;; j++) {
    if (j % 100 == 0)
      printf("%d ", j);
    buf = malloc((1024 * 1024));
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1159 <main+0x39>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
xor    %ebp,%ebp
jmp    1136 <main+0x26>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0xffffffff,%ebx
mov    %ebp,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
add    %ebx,%eax
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %7, %0
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = urem i32 %2, 100
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 1
br label %1
}
int get_cval(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_cval() {
ret i32 0
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
char _get_digit(uint64_t *fr, int *digit_count) {
  int rval;
  if (*digit_count > 0) {
    *digit_count -= 1;
    *fr = *fr * 10U;
    rval = ((*fr >> 60) & 0xF) + '0';
    *fr &= 0x0FFFFFFFFFFFFFFFull;
  } else {
    rval = '0';
  }
  return (char)(rval);
}


x86 assembly (clang, -O0):
<_get_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1161 <_get_digit+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
imul   $0xa,(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x3c,%ecx
shr    %cl,%eax
and    $0xf,%eax
add    $0x30,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
movabs $0xfffffffffffffff,%rdx
ff ff 0f
and    %rdx,%rcx
mov    %ecx,(%rax)
jmp    1168 <_get_digit+0x68>
movl   $0x30,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_digit>:
mov    (%rsi),%eax
test   %eax,%eax
jle    1114 <_get_digit+0x14>
add    $0xffffffff,%eax
mov    %eax,(%rsi)
mov    (%rdi),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,(%rdi)
mov    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @_get_digit(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %27
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = mul i32 %14, 10
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = lshr i32 %18, 60
%20 = and i32 %19, 15
%21 = add i32 %20, 48
store i32 %21, i32* %5
%22 = load i32*, i32** %3
%23 = load i32, i32* %22
%24 = zext i32 %23 to i64
%25 = and i64 %24, 1152921504606846975
%26 = trunc i64 %25 to i32
store i32 %26, i32* %22
br label %28
27: ; preds = %2
store i32 48, i32* %5
br label %28
28: ; preds = %27, %9
%29 = load i32, i32* %5
%30 = trunc i32 %29 to i8
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @_get_digit(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = add nsw i32 %3, -1
store i32 %6, i32* %1
%7 = load i32, i32* %0
%8 = mul i32 %7, 10
store i32 %8, i32* %0
br label %9
9: ; preds = %2, %5
ret i8 48
}
/* Variables and functions */
int /*<<< orphan*/ doztodec(char *);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int dec(char *p, int places, char expnot) {
  if (expnot == 1)
    printf("%.*e\n", places, doztodec(p));
  else
    printf("%.*f\n", places, doztodec(p));
  return 0;
}


x86 assembly (clang, -O0):
<dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x1,%eax
jne    1166 <dec+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <doztodec@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
jmp    1186 <dec+0x66>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <doztodec@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <doztodec@plt>
cmp    $0x1,%bl
lea    0xeca(%rip),%rcx
lea    0xec9(%rip),%rdi
cmove  %rcx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.*e\0A\00"
@.str.1 = [6 x i8] c"%.*f\0A\00"
define i32 @dec(i8* %0, i32 %1, i8 signext %2) {
%4 = icmp eq i8 %2, 1
%5 = tail call i32 @doztodec(i8* %0)
%6 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %1, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_div(void) {
  gen_pop();
  gen_call("_div");
}


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

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

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

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