xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xae() {
  Assert_real((isdigit(174) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              875, ("isdigit should be 0 for 0xae"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xae\00"
define void @t_isdigit_0xae() {
%1 = tail call i64 @isdigit(i32 174)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 875, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int invert(int x, int p, int n) {
  int ones_bn = ((1 << n) - 1) << p;
  return (x ^ ones_bn);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = shl i32 %5, %1
%7 = xor i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum_two_dimensional_array(int const **, int);
int main(void) {
  const int a[2][2] = {{2, 2}, {2, 2}};
  printf("Sum: %d\n", sum_two_dimensional_array(a, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1040 <sum_two_dimensional_array@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1040 <sum_two_dimensional_array@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [2 x [2 x i32]] [[2 x i32] [i32 2, i32 2], [2 x i32] [i32 2, i32 2]]
@.str = [9 x i8] c"Sum: %d\0A\00"
define i32 @main() {
%1 = alloca [2 x [2 x i32]]
%2 = bitcast [2 x [2 x i32]]* %1 to i8*
%3 = bitcast [2 x [2 x i32]]* %1 to i32**
%4 = call i32 @sum_two_dimensional_array(i32** %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void s5pv310_busfreq_lock_free(unsigned int nId) {}


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

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

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

LLVM IR (-O2):
define void @s5pv310_busfreq_lock_free(i32 %0) {
ret void
}
void DH_set_method(void) {}


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

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

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

LLVM IR (-O2):
define void @DH_set_method() {
ret void
}
extern void d(void) {}


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

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

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

LLVM IR (-O2):
define void @d() {
ret void
}
int gdc_get_drv_stat(void *param) {
  unsigned int *syscall_bc = (unsigned int *)0x8c0000bc;
  int (*syscall)() = (int (*)())(*syscall_bc);
  return syscall((param), (0), 0, (4));
  ;
}


x86 assembly (clang, -O0):
<gdc_get_drv_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8c0000bc,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   *%r8
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdc_get_drv_stat>:
mov    $0x8c0000bc,%eax
mov    (%rax),%r8d
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
xor    %eax,%eax
jmp    *%r8

LLVM IR (-O0):
define i32 @gdc_get_drv_stat(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32 (...)*
store i8* %0, i8** %2
store i32* inttoptr (i64 2348810428 to i32*), i32** %3
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32 (...)*
store i32 (...)* %8, i32 (...)** %4
%9 = load i32 (...)*, i32 (...)** %4
%10 = load i8*, i8** %2
%11 = bitcast i32 (...)* %9 to i32 (i8*, i32, i32, i32, ...)*
%12 = call i32 (i8*, i32, i32, i32, ...) %11(i8* %10, i32 0, i32 0, i32 4)
ret i32 %12
}

LLVM IR (-O2):
define i32 @gdc_get_drv_stat(i8* %0) {
%2 = load i32, i32* inttoptr (i64 2348810428 to i32*)
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32 (i8*, i32, i32, i32, ...)*
%5 = tail call i32 (i8*, i32, i32, i32, ...) %4(i8* %0, i32 0, i32 0, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f30(long j) {
  if ((j & ((1UL << (30)) - 1)) >= ((1UL << ((30) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3fffffff,%rax
cmp    $0x20000002,%rax
jb     1139 <f30+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f30>:
and    $0x3ffffffe,%edi
cmp    $0x20000002,%edi
jae    111f <f30+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f30(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1073741823
%5 = icmp uge i64 %4, 536870914
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f30(i64 %0) {
%2 = and i64 %0, 1073741822
%3 = icmp ugt i64 %2, 536870913
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32l4(uint32_t x) { return (x << 4) | (x >> 28); }


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

x86 assembly (clang, -O2):
<rot32l4>:
mov    %edi,%eax
shl    $0x4,%eax
sar    $0x1c,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rot32l4(i32 %0) {
%2 = shl i32 %0, 4
%3 = ashr i32 %0, 28
%4 = or i32 %2, %3
ret i32 %4
}
int rank(int x) { return 7 - (x >> 4); }


x86 assembly (clang, -O0):
<rank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
mov    $0x7,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rank>:
sar    $0x4,%edi
mov    $0x7,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = sub nsw i32 7, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rank(i32 %0) {
%2 = ashr i32 %0, 4
%3 = sub nsw i32 7, %2
ret i32 %3
}
/* Variables and functions */
int __builtin_wasm_trunc_s_i32_f32(float);
int trunc_s_i32_f32(float f) { return __builtin_wasm_trunc_s_i32_f32(f); }


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

x86 assembly (clang, -O2):
<trunc_s_i32_f32>:
jmp    1030 <__builtin_wasm_trunc_s_i32_f32@plt>

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

LLVM IR (-O2):
define i32 @trunc_s_i32_f32(float %0) {
%2 = tail call i32 @__builtin_wasm_trunc_s_i32_f32(float %0)
ret i32 %2
}
main() {
  int code;
  code = 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int iFunCopyString(char *cpDest, char *cpSrc) {
  int iRet = 0;
  int iIdx = 0;
  for (iIdx = 0; cpSrc[iIdx] != '\0'; iIdx++) {
    cpDest[iIdx] = cpSrc[iIdx];
  }
  cpDest[iIdx] = '\0';
  iRet = iIdx;
  return iRet;
}


x86 assembly (clang, -O0):
<iFunCopyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115a <iFunCopyString+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1121 <iFunCopyString+0x21>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iFunCopyString>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <iFunCopyString+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <iFunCopyString+0x10>
mov    %eax,%ecx
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i32 @iFunCopyString(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %9 to i32
br label %15
15: ; preds = %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ]
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 0, i8* %18
ret i32 %16
}
long __syscall1(long n, long a1) {
  long __ret;
  __asm("int $0x95" : "=a"(__ret) : "a"(n), "b"(a1) : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall1>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
int    $0x95
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall1>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
int    $0x95
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm "int $$0x95", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = tail call i64 asm "int $$0x95", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int numJewelsInStones(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ret = numJewelsInStones("aA", "aAAbbbb");
  printf("ret %d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <numJewelsInStones@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <numJewelsInStones@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ selectionSort(int *, int);
int main() {
  int arr[] = {64, 25, 12, 22, 11};
  int n = sizeof(arr) / sizeof(arr[0]);
  selectionSort(arr, n);
  printf("Sorted array: \n");
  printArray(arr, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <selectionSort@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <selectionSort@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 64, i32 25, i32 12, i32 22, i32 11]
@.str = [16 x i8] c"Sorted array: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @selectionSort(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @printArray(i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 64, i32 25, i32 12, i32 22, i32 11]
@str = [15 x i8] c"Sorted array: \00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @selectionSort(i32* %3, i32 5)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @printArray(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_graph(int *, int, int);
int /*<<< orphan*/ read_words(int *, int);
int main() {
  int count[16];
  read_words(count, 16);
  print_graph(count, 16, 50);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x10,%esi
call   1040 <read_words@plt>
lea    -0x50(%rbp),%rdi
mov    $0x10,%esi
mov    $0x32,%edx
call   1030 <print_graph@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <read_words@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x32,%edx
call   1030 <print_graph@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%4 = call i32 @read_words(i32* %3, i32 16)
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%6 = call i32 @print_graph(i32* %5, i32 16, i32 50)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @read_words(i32* %3, i32 16)
%5 = call i32 @print_graph(i32* %3, i32 16, i32 50)
ret i32 0
}
int(tolower)(int c) { return tolower(c); }


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

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

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
ret i32 undef
}
void my_func1(int INTTYPE) { INTTYPE++; }


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

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

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

LLVM IR (-O2):
define void @my_func1(i32 %0) {
ret void
}
int __attribute__((no, noclone)) iaddv(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<iaddv>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @iaddv(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @iaddv(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int *foo = malloc(4);
  free(foo);
  if (*foo)
    printf("Hi\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1176 <main+0x46>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
cmpl   $0x0,(%rbx)
je     1157 <main+0x27>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"Hi\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32 @free(i32* %3)
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void CAN2_SCE_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @CAN2_SCE_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void opj_free(void *memblock) { free(memblock); }


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

x86 assembly (clang, -O2):
<opj_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @opj_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ point(char *);
int filler(char *s) { return (point(s) && s[0] == '\\' && s[1] == 'R'); }


x86 assembly (clang, -O0):
<filler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <point@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115d <filler+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x9(%rbp)
jne    115d <filler+0x4d>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x52,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filler>:
push   %rbx
mov    %rdi,%rbx
call   1030 <point@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1131 <filler+0x21>
cmpb   $0x5c,(%rbx)
jne    1131 <filler+0x21>
xor    %eax,%eax
cmpb   $0x52,0x1(%rbx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @filler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @point(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 92
br i1 %11, label %12, label %18
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 82
br label %18
18: ; preds = %12, %6, %1
%19 = phi i1 [ false, %6 ], [ false, %1 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @filler(i8* %0) {
%2 = tail call i64 @point(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 92
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 82
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %4, %1
%13 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ DelayMS(int);
int /*<<< orphan*/ HDMITX_WriteI2C_Byte(int, int);
void HDCP_StartAnCipher(void) {
  HDMITX_WriteI2C_Byte(0x1F, 1);
  DelayMS(1);
}


x86 assembly (clang, -O0):
<HDCP_StartAnCipher>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x1,%edi
call   1040 <DelayMS@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HDCP_StartAnCipher>:
push   %rax
mov    $0x1f,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <DelayMS@plt>

LLVM IR (-O0):
define void @HDCP_StartAnCipher() {
%1 = call i32 @HDMITX_WriteI2C_Byte(i32 31, i32 1)
%2 = call i32 @DelayMS(i32 1)
ret void
}

LLVM IR (-O2):
define void @HDCP_StartAnCipher() {
%1 = tail call i32 @HDMITX_WriteI2C_Byte(i32 31, i32 1)
%2 = tail call i32 @DelayMS(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_footer(FILE *f) { fprintf(f, "]]\n"); }


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

x86 assembly (clang, -O2):
<print_footer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"]]\0A\00"
define void @print_footer(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
int sllv(int register2, int register3) { return register2 << register3; }


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

x86 assembly (clang, -O2):
<sllv>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @sllv(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _ftelli64(int /*<<< orphan*/ *);
off_t ftello(FILE *stream) { return (off_t)_ftelli64(stream); }


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

x86 assembly (clang, -O2):
<ftello>:
jmp    1030 <_ftelli64@plt>

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

LLVM IR (-O2):
define i32 @ftello(i32* %0) {
%2 = tail call i32 @_ftelli64(i32* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ av_pause_video();
int /*<<< orphan*/ av_play();
int /*<<< orphan*/ usleep(int);
int av_delay_video(int usec) {
  if (av_pause_video() < 0)
    return -1;
  usleep(usec);
  av_play();
  return 0;
}


x86 assembly (clang, -O0):
<av_delay_video>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <av_pause_video@plt>
cmp    $0x0,%rax
jge    1158 <av_delay_video+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <av_delay_video+0x3e>
mov    -0x8(%rbp),%edi
call   1050 <usleep@plt>
mov    $0x0,%al
call   1040 <av_play@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_delay_video>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <av_pause_video@plt>
test   %rax,%rax
js     1153 <av_delay_video+0x23>
mov    %ebp,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
call   1040 <av_play@plt>
jmp    1158 <av_delay_video+0x28>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @av_delay_video(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @av_pause_video()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @usleep(i32 %8)
%10 = call i32 (...) @av_play()
store i32 0, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @av_delay_video(i32 %0) {
%2 = tail call i64 (...) @av_pause_video()
%3 = icmp slt i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @usleep(i32 %0)
%6 = tail call i32 (...) @av_play()
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %8
}
int computeSignal(int int_no) {
  int sig_vals[] = {8, 5, 7, 5, 16, 16, 4, 8, 7, 11, 11, 11, 11, 11, 11, 7, 7};
  if (int_no < 16)
    return sig_vals[int_no];
  return 7;
}


x86 assembly (clang, -O0):
<computeSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x44,%edx
call   1030 <memcpy@plt>
cmpl   $0x10,-0x8(%rbp)
jge    114a <computeSignal+0x3a>
movslq -0x8(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <computeSignal+0x41>
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeSignal>:
mov    $0x7,%eax
cmp    $0xf,%edi
jg     1117 <computeSignal+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.computeSignal.sig_vals = [17 x i32] [i32 8, i32 5, i32 7, i32 5, i32 16, i32 16, i32 4, i32 8, i32 7, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 7, i32 7]
define i32 @computeSignal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [17 x i32]
store i32 %0, i32* %3
%5 = bitcast [17 x i32]* %4 to i8*
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 7, i32* %2
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@__const.computeSignal.sig_vals = [17 x i32] [i32 8, i32 5, i32 7, i32 5, i32 16, i32 16, i32 4, i32 8, i32 7, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 7, i32 7]
define i32 @computeSignal(i32 %0) {
%2 = icmp slt i32 %0, 16
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [17 x i32], [17 x i32]* @__const.computeSignal.sig_vals, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 7, %1 ]
ret i32 %8
}
void ERR_lib_error_string(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_lib_error_string() {
ret void
}
void session_upd(struct servermsg *msg, struct _session *session) {}


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

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

LLVM IR (-O0):
%struct.servermsg = type opaque
%struct._session = type opaque
define void @session_upd(%struct.servermsg* %0, %struct._session* %1) {
%3 = alloca %struct.servermsg*
%4 = alloca %struct._session*
store %struct.servermsg* %0, %struct.servermsg** %3
store %struct._session* %1, %struct._session** %4
ret void
}

LLVM IR (-O2):
%struct.servermsg = type opaque
%struct._session = type opaque
define void @session_upd(%struct.servermsg* nocapture %0, %struct._session* nocapture %1) {
ret void
}
void ff_hevc_put_hevc_bi_w_epel_hv12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv12_12_sse4() {
ret void
}
/* Variables and functions */
int tolower_alnumspace_8bit(char const *, char *, int, int);
int tolower_alnumspace_utf8(char const *, char *, int, int);
int tolower_alnumspace(const char *src, char *dest, int allchars_mode,
                       int cs_mode, int utf8_mode) {
  if (utf8_mode) {
    return tolower_alnumspace_utf8(src, dest, allchars_mode, cs_mode);
  } else {
    return tolower_alnumspace_8bit(src, dest, allchars_mode, cs_mode);
  }
}


x86 assembly (clang, -O0):
<tolower_alnumspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115f <tolower_alnumspace+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <tolower_alnumspace_utf8@plt>
mov    %eax,-0x4(%rbp)
jmp    1175 <tolower_alnumspace+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1030 <tolower_alnumspace_8bit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower_alnumspace>:
test   %r8d,%r8d
je     112a <tolower_alnumspace+0xa>
jmp    1040 <tolower_alnumspace_utf8@plt>
jmp    1030 <tolower_alnumspace_8bit@plt>

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

LLVM IR (-O2):
define i32 @tolower_alnumspace(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @tolower_alnumspace_utf8(i8* %0, i8* %1, i32 %2, i32 %3)
br label %11
9: ; preds = %5
%10 = tail call i32 @tolower_alnumspace_8bit(i8* %0, i8* %1, i32 %2, i32 %3)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void uninitvar_remove(void) {
  char *s;
  (void)remove(s);
}


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

x86 assembly (clang, -O2):
<uninitvar_remove>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
define void @uninitvar_remove() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @remove(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_remove() {
%1 = tail call i32 @remove(i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rpn(char *);
int main(int argc, char **argv) {
  char *express = "[4, 13, 5, /, +]";
  printf("express : %d\n", rpn(express));
  return 0;
}


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

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

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

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

/* Variables and functions */
void set_bit(int len, uint64_t *array, int element) {
  uint64_t one = 1;
  int array_index = element / 64;
  element -= (array_index * 64);
  array[array_index] |= one << (63 - element);
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    $0x3f,%ecx
sub    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
lea    0x3f(%rdx),%ecx
test   %edx,%edx
cmovns %edx,%ecx
mov    %ecx,%eax
sar    $0x6,%eax
and    $0xc0,%ecx
sub    %edx,%ecx
add    $0x3f,%cl
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %edx,(%rsi,%rax,4)
ret

LLVM IR (-O0):
define void @set_bit(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 1, i32* %7
%9 = load i32, i32* %6
%10 = sdiv i32 %9, 64
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = mul nsw i32 %11, 64
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, %12
store i32 %14, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = sub nsw i32 63, %16
%18 = shl i32 %15, %17
%19 = load i32*, i32** %5
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = or i32 %23, %18
store i32 %24, i32* %22
ret void
}

LLVM IR (-O2):
define void @set_bit(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sdiv i32 %2, 64
%5 = shl nsw i32 %4, 6
%6 = sub i32 63, %2
%7 = add i32 %6, %5
%8 = shl nuw i32 1, %7
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = or i32 %11, %8
store i32 %12, i32* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int strToInt(const char *str) {
  int result;
  sscanf(str, "%d", &result);
  return result;
}


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

x86 assembly (clang, -O2):
<strToInt>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @strToInt(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
char *strrchr(char *, char);
void chomp(char *sz) {
  char *nl;
  while ((nl = strrchr(sz, '\n')))
    *nl = '\0';
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <chomp+0x34>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    111c <chomp+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1137 <chomp+0x27>
movb   $0x0,(%rax)
mov    %rbx,%rdi
jmp    1120 <chomp+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @chomp(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 = call i8* @strrchr(i8* %5, i8 signext 10)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %2, %1 ]
store i8 0, i8* %5
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
float strtof(char const *, char const **);
float StrToFloat(const char *source, const char **endp) {
  return strtof(source, endp);
}


x86 assembly (clang, -O0):
<StrToFloat>:
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 <strtof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrToFloat>:
jmp    1030 <strtof@plt>

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

LLVM IR (-O2):
define float @StrToFloat(i8* %0, i8** nocapture %1) {
%3 = tail call float @strtof(i8* %0, i8** %1)
ret float %3
}