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

/* Variables and functions */
int SSL_RECEIVED_SHUTDOWN;
int SSL_get_shutdown(int /*<<< orphan*/ *);
dtls_isAlive(SSL *ssl) {
  return !(SSL_get_shutdown(ssl) & SSL_RECEIVED_SHUTDOWN);
}


x86 assembly (clang, -O0):
<dtls_isAlive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SSL_get_shutdown@plt>
mov    0x2eb4(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls_isAlive>:
push   %rax
call   1030 <SSL_get_shutdown@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SSL_RECEIVED_SHUTDOWN = global i32 0
define i32 @dtls_isAlive(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @SSL_get_shutdown(i32* %3)
%5 = load i32, i32* @SSL_RECEIVED_SHUTDOWN
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@SSL_RECEIVED_SHUTDOWN = global i32 0
define i32 @dtls_isAlive(i32* %0) {
%2 = tail call i32 @SSL_get_shutdown(i32* %0)
%3 = load i32, i32* @SSL_RECEIVED_SHUTDOWN
%4 = and i32 %3, %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ decode_rle_sample24(void *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, void *,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
void exported_decode_rle_sample24(void *sampleBuffer, uint32_t sampleBufferSize,
                                  uint32_t isKeyFrame, void *frameBuffer,
                                  uint32_t frameBufferWidth,
                                  uint32_t frameBufferHeight) {
  decode_rle_sample24(sampleBuffer, sampleBufferSize, isKeyFrame, frameBuffer,
                      frameBufferWidth, frameBufferHeight);
}


x86 assembly (clang, -O0):
<exported_decode_rle_sample24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <decode_rle_sample24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exported_decode_rle_sample24>:
jmp    1030 <decode_rle_sample24@plt>

LLVM IR (-O0):
define void @exported_decode_rle_sample24(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @decode_rle_sample24(i8* %13, i32 %14, i32 %15, i8* %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @exported_decode_rle_sample24(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = tail call i32 @decode_rle_sample24(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ apply_bios_map();
int /*<<< orphan*/ mark_kernel_memory_used();
int /*<<< orphan*/ mark_page_tables_used();
int /*<<< orphan*/ pmmap_init();
void mem_init() {
  pmmap_init();
  apply_bios_map();
  mark_kernel_memory_used();
  mark_page_tables_used();
}


x86 assembly (clang, -O0):
<mem_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <pmmap_init@plt>
mov    $0x0,%al
call   1030 <apply_bios_map@plt>
mov    $0x0,%al
call   1060 <mark_kernel_memory_used@plt>
mov    $0x0,%al
call   1040 <mark_page_tables_used@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_init>:
push   %rax
xor    %eax,%eax
call   1050 <pmmap_init@plt>
xor    %eax,%eax
call   1030 <apply_bios_map@plt>
xor    %eax,%eax
call   1060 <mark_kernel_memory_used@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <mark_page_tables_used@plt>

LLVM IR (-O0):
define void @mem_init() {
%1 = call i32 (...) @pmmap_init()
%2 = call i32 (...) @apply_bios_map()
%3 = call i32 (...) @mark_kernel_memory_used()
%4 = call i32 (...) @mark_page_tables_used()
ret void
}

LLVM IR (-O2):
define void @mem_init() {
%1 = tail call i32 (...) @pmmap_init()
%2 = tail call i32 (...) @apply_bios_map()
%3 = tail call i32 (...) @mark_kernel_memory_used()
%4 = tail call i32 (...) @mark_page_tables_used()
ret void
}
int D(int i) { return (i); }


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

x86 assembly (clang, -O2):
<D>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @D(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_set_dobldobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 1;
  ptos[1] = 1;
  fail = _ada_use_c2phc(618, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_set_dobldobl_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26a,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_set_dobldobl_target>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26a,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_set_dobldobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 618, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_set_dobldobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 618, i32* %6, i32* %3, double* %1)
ret i32 %8
}
/* Variables and functions */
unsigned int Log2(unsigned int value) {
  int x = 0;
  value >>= 1;
  while (value) {
    value >>= 1;
    x++;
  }
  return (x ? x : 1);
}


x86 assembly (clang, -O0):
<Log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <Log2+0x38>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <Log2+0x17>
cmpl   $0x0,-0x8(%rbp)
je     114d <Log2+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115a <Log2+0x5a>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <Log2+0x5a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     111c <Log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
xchg   %ax,%ax
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <Log2+0x10>
ret

LLVM IR (-O0):
define i32 @Log2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
store i32 %5, i32* %2
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
%11 = lshr i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %6
14: ; preds = %6
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = load i32, i32* %3
br label %20
19: ; preds = %14
br label %20
20: ; preds = %19, %17
%21 = phi i32 [ %18, %17 ], [ 1, %19 ]
ret i32 %21
}

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


x86 assembly (clang, -O0):
<EnableSound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
mov    $0x2,%esi
call   1030 <calltrap@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnableSound>:
mov    $0x6,%edi
mov    $0x2,%esi
jmp    1030 <calltrap@plt>

LLVM IR (-O0):
define i32 @EnableSound() {
%1 = alloca i32
%2 = call i32 @calltrap(i32 6, i32 2)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @EnableSound() {
%1 = tail call i32 @calltrap(i32 6, i32 2)
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rol8(uint32_t x) { return (x << 8) | (x >> 24); }


x86 assembly (clang, -O0):
<rol8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol8>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 24
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rol8(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 24
%4 = or i32 %2, %3
ret i32 %4
}
void bwrite(unsigned char *p, unsigned long val) {
  p[3] = val;
  val >>= 8;
  p[2] = val;
  val >>= 8;
  p[1] = val;
  val >>= 8;
  p[0] = val;
}


x86 assembly (clang, -O0):
<bwrite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwrite>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @bwrite(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initTables();
int /*<<< orphan*/ testAnimals();
int main() {
  initTables();
  testAnimals();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initTables@plt>
mov    $0x0,%al
call   1030 <testAnimals@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initTables()
%3 = call i32 (...) @testAnimals()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initTables()
%2 = tail call i32 (...) @testAnimals()
ret i32 0
}
unsigned int arm_strlen(const char *s) {
  unsigned int ret = 0;
  while (s[ret]) {
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<arm_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112e <arm_strlen+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <arm_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <arm_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @arm_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
char *strtok(char *, char *);
void explode(char *variable[], char *haystack, char *delimiter) {
  char *token_position;
  int i = 0;
  token_position = strtok(haystack, delimiter);
  while (token_position != NULL) {
    variable[i++] = token_position;
    token_position = strtok(NULL, delimiter);
  }
}


x86 assembly (clang, -O0):
<explode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1177 <explode+0x67>
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
jmp    113c <explode+0x2c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explode>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
je     1146 <explode+0x36>
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rbx)
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
add    $0x8,%rbx
test   %rax,%rax
jne    1130 <explode+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @explode(i8** nocapture writeonly %0, i8* %1, i8* nocapture %2) {
%4 = tail call i8* @strtok(i8* %1, i8* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
%9 = add nuw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %7
store i8* %8, i8** %10
%11 = tail call i8* @strtok(i8* null, i8* %2)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}
OPHANDLER(reti) {
  POP_PC();
  CLEAR_CURRENT_IRQ();
}


x86 assembly (clang, -O0):
<OPHANDLER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <POP_PC@plt>
mov    $0x0,%al
call   1030 <CLEAR_CURRENT_IRQ@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPHANDLER>:
push   %rax
xor    %eax,%eax
call   1040 <POP_PC@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CLEAR_CURRENT_IRQ@plt>

LLVM IR (-O0):
define i32 @OPHANDLER(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @POP_PC()
%5 = call i32 (...) @CLEAR_CURRENT_IRQ()
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @OPHANDLER(i32 %0) {
%2 = tail call i32 (...) @POP_PC()
%3 = tail call i32 (...) @CLEAR_CURRENT_IRQ()
ret i32 undef
}
int test_imm_FDint16_reg(short val) {
  return ((val) & (0xFD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FDint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xfd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FDint16_reg>:
test   $0xfd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FDint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 253
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_FDint16_reg(i16 signext %0) {
%2 = and i16 %0, 253
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ *sem_open(char const *, int, int /*<<< orphan*/,
                             unsigned int);
extern sem_t *_swift_Platform_sem_open4(const char *name, int oflag,
                                        mode_t mode, unsigned int value) {
  return sem_open(name, oflag, mode, value);
}


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

x86 assembly (clang, -O2):
<_swift_Platform_sem_open4>:
jmp    1030 <sem_open@plt>

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

LLVM IR (-O2):
define i32* @_swift_Platform_sem_open4(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @sem_open(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32* %5
}
/* Variables and functions */
char tolower(char);
char *strtolower(char *str) {
  char *ps = str;
  while (*ps) {
    *ps = tolower(*ps);
    ps++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strtolower+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strtolower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strtolower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strtolower(i8* returned %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 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int isThere(int, int, char, char);
int isBox(int level, char x, char y) { return isThere(level, 1, x, y); }


x86 assembly (clang, -O0):
<isBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x5(%rbp),%al
mov    $0x1,%esi
movsbl %al,%edx
movsbl -0x6(%rbp),%ecx
call   1030 <isThere@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBox>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <isThere@plt>

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

LLVM IR (-O2):
define i32 @isBox(i32 %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @isThere(i32 %0, i32 1, i8 signext %1, i8 signext %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ my_function();
int main(int argc, char *argv[]) {
  my_function();
  my_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @my_function()
%4 = tail call i32 (...) @my_function()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Reserved168_DriverIRQHandler();
__attribute__((weak)) void Reserved168_IRQHandler(void) {
  Reserved168_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved168_IRQHandler() {
%1 = call i32 (...) @Reserved168_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved168_IRQHandler() {
%1 = tail call i32 (...) @Reserved168_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM6_DAC_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM6_DAC_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM6_DAC_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int tputs(char *, int, int (*)(int));
int gtm_tputs(char *c, int la, int (*putcfunc)(int)) {
  return tputs(c, la, putcfunc);
}


x86 assembly (clang, -O0):
<gtm_tputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <tputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtm_tputs>:
jmp    1030 <tputs@plt>

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

LLVM IR (-O2):
define i32 @gtm_tputs(i8* %0, i32 %1, i32 (i32)* %2) {
%4 = tail call i32 @tputs(i8* %0, i32 %1, i32 (i32)* %2)
ret i32 %4
}
void ScaleRowDown38_2_Box_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown38_2_Box_16_C() {
ret void
}
int sgs_octchar(char c) { return c >= '0' && c <= '7'; }


x86 assembly (clang, -O0):
<sgs_octchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <sgs_octchar+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgs_octchar>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @sgs_octchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 55
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @sgs_octchar(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void video_on(void) {
  outb(0x3C4, 0x01);
  outb(0x3C5, inb(0x3C5) & ~20);
}


x86 assembly (clang, -O0):
<video_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c4,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x3c5,%edi
call   1040 <inb@plt>
mov    %eax,%esi
and    $0xffffffeb,%esi
mov    $0x3c5,%edi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_on>:
push   %rax
mov    $0x3c4,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x3c5,%edi
call   1040 <inb@plt>
and    $0xffffffeb,%eax
mov    $0x3c5,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @video_on() {
%1 = call i32 @outb(i32 964, i32 1)
%2 = call i32 @inb(i32 965)
%3 = and i32 %2, -21
%4 = call i32 @outb(i32 965, i32 %3)
ret void
}

LLVM IR (-O2):
define void @video_on() {
%1 = tail call i32 @outb(i32 964, i32 1)
%2 = tail call i32 @inb(i32 965)
%3 = and i32 %2, -21
%4 = tail call i32 @outb(i32 965, i32 %3)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int lstat(char const *, struct stat *);
int outside_lstat(const char *fname, struct stat *buf) {
  return lstat(fname, buf);
}


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

x86 assembly (clang, -O2):
<outside_lstat>:
jmp    1030 <lstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @outside_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @lstat(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @outside_lstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @lstat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ select1B(unsigned int, unsigned int);
void select1A(unsigned a, unsigned b) { select1B(a, b); }


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

x86 assembly (clang, -O2):
<select1A>:
jmp    1030 <select1B@plt>

LLVM IR (-O0):
define void @select1A(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 = call i32 @select1B(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @select1A(i32 %0, i32 %1) {
%3 = tail call i32 @select1B(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void consoleOutputCharacter(int c) {
  if (c == '\r')
    c = '\n';
  fprintf(stdout, "%c", c);
}


x86 assembly (clang, -O0):
<consoleOutputCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xd,-0x4(%rbp)
jne    112c <consoleOutputCharacter+0x1c>
movl   $0xa,-0x4(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleOutputCharacter>:
cmp    $0xd,%edi
mov    $0xa,%edx
cmovne %edi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define void @consoleOutputCharacter(i32 %0) {
%2 = icmp eq i32 %0, 13
%3 = select i1 %2, i32 10, i32 %0
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void swap(void *a, void *b, size_t element_size) {
  char *buffer = (char *)malloc(element_size);
  memcpy(buffer, a, element_size);
  memcpy(a, b, element_size);
  memcpy(b, buffer, element_size);
}


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

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i64, i64* %6
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @malloc(i64 %2)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %2)
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%8 = tail call i32 @memcpy(i8* %1, i8* %5, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int a = 1;
  if (a) {
    printf("A\n");
  } else {
    printf("!A\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1141 <main+0x31>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x3d>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [2 x i8] c"A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char ETH_P_ARP;
int is_frame_arp(char *frame) {
  return ((((frame[12]) << 8) + frame[13]) == ETH_P_ARP);
}


x86 assembly (clang, -O0):
<is_frame_arp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0xc(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl 0xd(%rcx),%ecx
add    %ecx,%eax
mov    0x2ebc(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_frame_arp>:
movsbl 0xc(%rdi),%eax
shl    $0x8,%eax
movsbl 0xd(%rdi),%ecx
add    %eax,%ecx
mov    0x2ecc(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
@ETH_P_ARP = global i8 0
define i32 @is_frame_arp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 12
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 13
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %7, %11
%13 = load i8, i8* @ETH_P_ARP
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@ETH_P_ARP = global i8 0
define i32 @is_frame_arp(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 13
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = add nsw i32 %5, %8
%10 = load i8, i8* @ETH_P_ARP
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  int fahr;
  for (fahr = 300; fahr >= 0; fahr -= 10)
    printf("%3d %6.1f\n", fahr, (5.0 / 9.0 * (fahr - 32)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12c,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1163 <main+0x53>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x136,%eax
lea    0xee9(%rip),%rbx
nop
lea    -0xa(%rax),%ebp
add    $0xffffffd6,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xecb(%rip),%xmm0
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
cmp    $0x9,%ebp
ja     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%3d %6.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 300, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 32
%10 = sitofp i32 %9 to double
%11 = fmul double 0x3FE1C71C71C71C72, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, double %11)
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 10
store i32 %15, i32* %2
br label %3
16: ; preds = %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [11 x i8] c"%3d %6.1f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 300, %0 ], [ %7, %1 ]
%3 = add nsw i32 %2, -32
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3FE1C71C71C71C72
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, double %5)
%7 = add nsw i32 %2, -10
%8 = icmp ugt i32 %2, 9
br i1 %8, label %1, label %9
9: ; preds = %1
ret i32 0
}
void XDefaultRootWindow() {}


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

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

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

LLVM IR (-O2):
define void @XDefaultRootWindow() {
ret void
}
long identity(long number) { return number; }


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

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

LLVM IR (-O0):
define i64 @identity(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @identity(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int set_blocking(int, int /*<<< orphan*/);
int set_nonblock_mode(int fd) { return set_blocking(fd, 0); }


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

x86 assembly (clang, -O2):
<set_nonblock_mode>:
xor    %esi,%esi
jmp    1030 <set_blocking@plt>

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

LLVM IR (-O2):
define i32 @set_nonblock_mode(i32 %0) {
%2 = tail call i32 @set_blocking(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ all_possibble(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int main() {
  all_possibble(0, 1);
  printf("------------\n");
  all_possibble(0, 2);
  printf("------------\n");
  all_possibble(0, 3);
  printf("------------\n");
  all_possibble(0, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <all_possibble@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <all_possibble@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <all_possibble@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   1040 <all_possibble@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <all_possibble@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <all_possibble@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <all_possibble@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   1040 <all_possibble@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"------------\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @all_possibble(i32 0, i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @all_possibble(i32 0, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @all_possibble(i32 0, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @all_possibble(i32 0, i32 4)
ret i32 0
}

LLVM IR (-O2):
@str.2 = [13 x i8] c"------------\00"
define i32 @main() {
%1 = tail call i32 @all_possibble(i32 0, i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @all_possibble(i32 0, i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @all_possibble(i32 0, i32 3)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
%7 = tail call i32 @all_possibble(i32 0, i32 4)
ret i32 0
}
/* Variables and functions */
int smaz_compress(unsigned char const *, size_t, unsigned char *, size_t);
int sCompress(int level, const unsigned char *in, size_t inlen,
              unsigned char *out, size_t *outlen) {
  int res = smaz_compress(in, inlen, out, *outlen);
  *outlen = res;
  return 0;
}


x86 assembly (clang, -O0):
<sCompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
call   1030 <smaz_compress@plt>
mov    %eax,-0x2c(%rbp)
movslq -0x2c(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sCompress>:
push   %rbx
mov    %r8,%rbx
mov    %rsi,%rdi
mov    (%r8),%rax
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %rax,%rcx
call   1030 <smaz_compress@plt>
cltq
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sCompress(i32 %0, i8* %1, i64 %2, i8* %3, i64* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64*
%11 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64* %4, i64** %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64*, i64** %10
%16 = load i64, i64* %15
%17 = call i32 @smaz_compress(i8* %12, i64 %13, i8* %14, i64 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = load i64*, i64** %10
store i64 %19, i64* %20
ret i32 0
}

LLVM IR (-O2):
define i32 @sCompress(i32 %0, i8* %1, i64 %2, i8* %3, i64* nocapture %4) {
%6 = load i64, i64* %4
%7 = tail call i32 @smaz_compress(i8* %1, i64 %2, i8* %3, i64 %6)
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
ret i32 0
}
unsigned int ceil_mul(unsigned int a, unsigned int b) {
  return ((((b) != 0) ? ((a) + (b)-1) / (b) : 0) * (b));
}


x86 assembly (clang, -O0):
<ceil_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <ceil_mul+0x2a>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1134 <ceil_mul+0x34>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <ceil_mul+0x34>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_mul>:
test   %esi,%esi
je     1112 <ceil_mul+0x12>
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %esi
imul   %esi,%eax
ret
xor    %eax,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ceil_mul(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = add i32 %0, -1
%6 = add i32 %5, %1
%7 = udiv i32 %6, %1
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = mul i32 %9, %1
ret i32 %10
}