xunge/DecIR huggingface dataset:
int in_battlefield(double x, double y) {
  return ((x - 0.5 >= 0) && (x + 0.5 <= 25) && (y - 0.5 >= 0) &&
          (y + 0.5 <= 25));
}


x86 assembly (clang, -O0):
<in_battlefield>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
subsd  %xmm1,%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jb     1197 <in_battlefield+0x97>
movsd  0xec7(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
xor    %eax,%eax
movsd  0xec0(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jb     1197 <in_battlefield+0x97>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
subsd  %xmm1,%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jb     1197 <in_battlefield+0x97>
movsd  0xe80(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe7b(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_battlefield>:
movsd  0xef8(%rip),%xmm2
movapd %xmm0,%xmm3
addsd  %xmm2,%xmm3
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm3
setae  %al
movsd  0xee5(%rip),%xmm3
addsd  %xmm3,%xmm0
movsd  0xee1(%rip),%xmm5
ucomisd %xmm0,%xmm5
setae  %cl
and    %al,%cl
addsd  %xmm1,%xmm2
ucomisd %xmm4,%xmm2
setae  %al
addsd  %xmm3,%xmm1
ucomisd %xmm1,%xmm5
setae  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @in_battlefield(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fsub double %5, 5.000000e-01
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load double, double* %3
%10 = fadd double %9, 5.000000e-01
%11 = fcmp ole double %10, 2.500000e+01
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load double, double* %4
%14 = fsub double %13, 5.000000e-01
%15 = fcmp oge double %14, 0.000000e+00
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load double, double* %4
%18 = fadd double %17, 5.000000e-01
%19 = fcmp ole double %18, 2.500000e+01
br label %20
20: ; preds = %16, %12, %8, %2
%21 = phi i1 [ false, %12 ], [ false, %8 ], [ false, %2 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @in_battlefield(double %0, double %1) {
%3 = fadd double %0, -5.000000e-01
%4 = fcmp ult double %3, 0.000000e+00
%5 = fadd double %0, 5.000000e-01
%6 = fcmp ugt double %5, 2.500000e+01
%7 = or i1 %4, %6
%8 = fadd double %1, -5.000000e-01
%9 = fcmp ult double %8, 0.000000e+00
%10 = or i1 %7, %9
%11 = fadd double %1, 5.000000e-01
%12 = fcmp ole double %11, 2.500000e+01
%13 = xor i1 %10, true
%14 = and i1 %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x3d() {
  Assert_real((isascii(61)),
              "/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_isascii.c",
              310, ("isascii should be 1 for ="));
}


x86 assembly (clang, -O0):
<t_isascii_0x3d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x136,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x3d>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x136,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for =\00"
define void @t_isascii_0x3d() {
%1 = call i32 @isascii(i32 61)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for =\00"
define void @t_isascii_0x3d() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long hashmap_get_hashval(unsigned char *str) {
  unsigned long hash = 5381;
  int c = 0;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hashmap_get_hashval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1151 <hashmap_get_hashval+0x51>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hashmap_get_hashval+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_get_hashval>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hashmap_get_hashval+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashmap_get_hashval+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashmap_get_hashval(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = mul i64 %6, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rotl_16b(short dummy, uint16_t x) { return (x << 8) | (x >> 8); }


x86 assembly (clang, -O0):
<rotl_16b>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl_16b(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_16b(i16 signext %0, i32 %1) {
%3 = shl i32 %1, 8
%4 = ashr i32 %1, 8
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sys_call_uname();
int /*<<< orphan*/ sys_call_uname_int();
int /*<<< orphan*/ sys_call_use_function();
int /*<<< orphan*/ sys_call_use_int();
int main() {
  printf("syscall use function syscall()\n");
  sys_call_use_function();
  sys_call_use_int();
  sys_call_uname();
  sys_call_uname_int();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <sys_call_use_function@plt>
mov    $0x0,%al
call   1060 <sys_call_use_int@plt>
mov    $0x0,%al
call   1040 <sys_call_uname@plt>
mov    $0x0,%al
call   1070 <sys_call_uname_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <sys_call_use_function@plt>
xor    %eax,%eax
call   1060 <sys_call_use_int@plt>
xor    %eax,%eax
call   1040 <sys_call_uname@plt>
xor    %eax,%eax
call   1070 <sys_call_uname_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"syscall use function syscall()\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @sys_call_use_function()
%4 = call i32 (...) @sys_call_use_int()
%5 = call i32 (...) @sys_call_uname()
%6 = call i32 (...) @sys_call_uname_int()
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"syscall use function syscall()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @sys_call_use_function()
%3 = tail call i32 (...) @sys_call_use_int()
%4 = tail call i32 (...) @sys_call_uname()
%5 = tail call i32 (...) @sys_call_uname_int()
ret i32 0
}
int argc_count(char *opts) {
  int i = 0;
  while (*opts != '\0')
    if (*opts++ == ' ')
      i++;
  return i;
}


x86 assembly (clang, -O0):
<argc_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <argc_count+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1143 <argc_count+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <argc_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argc_count>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <argc_count+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x20,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <argc_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @argc_count(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 32
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int mkstemp(char *);
int /*<<< orphan*/ unlink(char *);
char *mktemp(char *tpl) {
  int fd;
  fd = mkstemp(tpl);
  if (fd < 0) {
    tpl[0] = 0;
    return tpl;
  }
  close(fd);
  unlink(tpl);
  return tpl;
}


x86 assembly (clang, -O0):
<mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mkstemp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1166 <mktemp+0x36>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <mktemp+0x4f>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktemp>:
push   %rbx
mov    %rdi,%rbx
call   1050 <mkstemp@plt>
test   %eax,%eax
js     114e <mktemp+0x1e>
mov    %eax,%edi
call   1040 <close@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
jmp    1151 <mktemp+0x21>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mktemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @mkstemp(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 0, i8* %11
%12 = load i8*, i8** %3
store i8* %12, i8** %2
br label %19
13: ; preds = %1
%14 = load i32, i32* %4
%15 = call i32 @close(i32 %14)
%16 = load i8*, i8** %3
%17 = call i32 @unlink(i8* %16)
%18 = load i8*, i8** %3
store i8* %18, i8** %2
br label %19
19: ; preds = %13, %9
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @mktemp(i8* returned %0) {
%2 = tail call i32 @mkstemp(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 0, i8* %0
br label %8
5: ; preds = %1
%6 = tail call i32 @close(i32 %2)
%7 = tail call i32 @unlink(i8* %0)
br label %8
8: ; preds = %5, %4
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_NOP(int n) { C67_asm("NOP", n, 0, 0); }


x86 assembly (clang, -O0):
<C67_NOP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_NOP>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"NOP\00"
define void @C67_NOP(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getattribute(char *, int);
float microfacet_roughness(float roughness, float depth_scale) {
  float out = roughness;
  if (depth_scale > 1.0) {
    int ray_depth;
    getattribute("path:ray_depth", ray_depth);
    if (ray_depth) {
      out = roughness * depth_scale * ray_depth;
    }
  }
  return out;
}


x86 assembly (clang, -O0):
<microfacet_roughness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117d <microfacet_roughness+0x6d>
mov    -0x10(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <getattribute@plt>
cmpl   $0x0,-0x10(%rbp)
je     1178 <microfacet_roughness+0x68>
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    117d <microfacet_roughness+0x6d>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microfacet_roughness>:
push   %rax
ucomiss 0xee8(%rip),%xmm1
jbe    1132 <microfacet_roughness+0x22>
lea    0xee3(%rip),%rdi
movss  %xmm0,0x4(%rsp)
call   1030 <getattribute@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"path:ray_depth\00"
define float @microfacet_roughness(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
store float %7, float* %5
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fcmp ogt double %9, 1.000000e+00
br i1 %10, label %11, label %24
11: ; preds = %2
%12 = load i32, i32* %6
%13 = call i32 @getattribute(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %6
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %11
%17 = load float, float* %3
%18 = load float, float* %4
%19 = fmul float %17, %18
%20 = load i32, i32* %6
%21 = sitofp i32 %20 to float
%22 = fmul float %19, %21
store float %22, float* %5
br label %23
23: ; preds = %16, %11
br label %24
24: ; preds = %23, %2
%25 = load float, float* %5
ret float %25
}

LLVM IR (-O2):
@.str = [15 x i8] c"path:ray_depth\00"
define float @microfacet_roughness(float returned %0, float %1) {
%3 = fcmp ogt float %1, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @getattribute(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 undef)
br label %6
6: ; preds = %4, %2
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
void radix__flush_tlb_lpid_page(unsigned int lpid, unsigned long addr,
                                unsigned long page_size) {
  WARN_ON(1);
}


x86 assembly (clang, -O0):
<radix__flush_tlb_lpid_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix__flush_tlb_lpid_page>:
mov    $0x1,%edi
jmp    1030 <WARN_ON@plt>

LLVM IR (-O0):
define void @radix__flush_tlb_lpid_page(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 @WARN_ON(i32 1)
ret void
}

LLVM IR (-O2):
define void @radix__flush_tlb_lpid_page(i32 %0, i64 %1, i64 %2) {
%4 = tail call i32 @WARN_ON(i32 1)
ret void
}
void SPIDataPut(unsigned long ulBase, unsigned long ulData) {

  ;
  while (!((*((volatile unsigned long *)(ulBase + 0x00000008))) & 0x00000002)) {
  }
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) = ulData;
}


x86 assembly (clang, -O0):
<SPIDataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <SPIDataPut+0x2e>
jmp    1133 <SPIDataPut+0x33>
jmp    110c <SPIDataPut+0xc>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDataPut>:
testq  $0x2,0x8(%rdi)
je     1100 <SPIDataPut>
mov    %rsi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @SPIDataPut(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %13, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 2
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i64, i64* %4
%16 = load i64, i64* %3
%17 = add i64 %16, 12
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @SPIDataPut(i64 %0, i64 %1) {
%3 = add i64 %0, 8
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 2
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = add i64 %0, 12
%11 = inttoptr i64 %10 to i64*
store volatile i64 %1, i64* %11
ret void
}
int ConvExa(char str[2]) {
  if (!str)
    return 0;
  return ((int)(str[0] - '0') << 4) + ((int)(str[1] - '0'));
}


x86 assembly (clang, -O0):
<ConvExa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ConvExa+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    113c <ConvExa+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
shl    $0x4,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvExa>:
test   %rdi,%rdi
je     1117 <ConvExa+0x17>
movsbl (%rdi),%eax
shl    $0x4,%eax
movsbl 0x1(%rdi),%ecx
add    %ecx,%eax
add    $0xfffffcd0,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ConvExa(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = shl nsw i32 %5, 4
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, -816
%11 = add nsw i32 %10, %6
br label %12
12: ; preds = %1, %3
%13 = phi i32 [ %11, %3 ], [ 0, %1 ]
ret i32 %13
}
unsigned int r2h_bits(int cmd) {
  unsigned int mask = (((cmd) > 0) ? (1 << ((cmd)-1)) : 0);
  if (cmd == 13)
    mask |= ((((14) > 0) ? (1 << ((14) - 1)) : 0) |
             (((15) > 0) ? (1 << ((15) - 1)) : 0));
  else if (cmd == 4)
    mask |= ((((14) > 0) ? (1 << ((14) - 1)) : 0) |
             (((15) > 0) ? (1 << ((15) - 1)) : 0) |
             (((13) > 0) ? (1 << ((13) - 1)) : 0));
  return (mask |= (((32) > 0) ? (1 << ((32) - 1)) : 0));
}


x86 assembly (clang, -O0):
<r2h_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1126 <r2h_bits+0x26>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xd,-0x4(%rbp)
jne    1150 <r2h_bits+0x50>
mov    -0x8(%rbp),%eax
or     $0x6000,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <r2h_bits+0x6a>
cmpl   $0x4,-0x4(%rbp)
jne    1165 <r2h_bits+0x65>
mov    -0x8(%rbp),%eax
or     $0x7000,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <r2h_bits+0x6a>
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2h_bits>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edi,%edi
cmovg  %edx,%eax
cmp    $0x4,%edi
je     1126 <r2h_bits+0x26>
cmp    $0xd,%edi
jne    112b <r2h_bits+0x2b>
or     $0x6000,%eax
or     $0x80000000,%eax
ret
or     $0x7000,%eax
or     $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @r2h_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 0, %10 ]
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = or i32 %16, 24576
store i32 %17, i32* %3
br label %25
18: ; preds = %11
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = or i32 %22, 28672
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %15
%26 = load i32, i32* %3
%27 = or i32 %26, -2147483648
store i32 %27, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @r2h_bits(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 %4, i32 0
switch i32 %0, label %10 [
i32 13, label %6
i32 4, label %8
]
6: ; preds = %1
%7 = or i32 %5, 24576
br label %10
8: ; preds = %1
%9 = or i32 %5, 28672
br label %10
10: ; preds = %1, %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ], [ %5, %1 ]
%12 = or i32 %11, -2147483648
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ div_t;

/* Variables and functions */
int /*<<< orphan*/ div(int, int);
int safe_index(int size, int index) {
  div_t d = div(index, size);
  return 0;
}


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

x86 assembly (clang, -O2):
<safe_index>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1030 <div@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @safe_index(i32 %0, i32 %1) {
%3 = tail call i32 @div(i32 %1, i32 %0)
ret i32 0
}
int main() {
  int i, j;
  for (i = 0; i < 5; i++)
    for (j = 5; j >= 0; j--)
      ;
  return i + j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1153 <main+0x53>
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1140 <main+0x40>
jmp    1132 <main+0x32>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1145 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void vlc_h2_window_status(void *ctx, uint32_t *rcwd) {
  assert(ctx == ((void *)(uintptr_t)0x44556677));
  *rcwd = (1u << 31) - 1;
}


x86 assembly (clang, -O0):
<vlc_h2_window_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x44556677,%eax
cmp    %rax,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x7fffffff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlc_h2_window_status>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x44556677,%rdi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
movl   $0x7fffffff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @vlc_h2_window_status(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, inttoptr (i64 1146447479 to i8*)
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
store i32 2147483647, i32* %9
ret void
}

LLVM IR (-O2):
define void @vlc_h2_window_status(i8* readnone %0, i32* nocapture writeonly %1) {
%3 = icmp eq i8* %0, inttoptr (i64 1146447479 to i8*)
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
store i32 2147483647, i32* %1
ret void
}
void USB_DisableSofInt(void) {}


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

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

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

LLVM IR (-O2):
define void @USB_DisableSofInt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Sorry, can’t talk now.\n");
  printf("I’m busy!");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Sorry, can\E2\80\99t talk now.\0A\00"
@.str.1 = [12 x i8] c"I\E2\80\99m busy!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"I\E2\80\99m busy!\00"
@str = [25 x i8] c"Sorry, can\E2\80\99t talk now.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void PaUtil_FreeMemory(void *block) {
  if (block != NULL) {
    free(block);
  }
}


x86 assembly (clang, -O0):
<PaUtil_FreeMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <PaUtil_FreeMemory+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PaUtil_FreeMemory>:
test   %rdi,%rdi
je     111a <PaUtil_FreeMemory+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @PaUtil_FreeMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @PaUtil_FreeMemory(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int getLength(int);
uint16_t getSize(uint16_t pos) {
  if (pos > 15000 - 2) {
    return 0;
  }
  return getLength(pos) - 2;
}


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3a96,-0x8(%rbp)
jle    1134 <getSize+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1142 <getSize+0x32>
mov    -0x8(%rbp),%edi
call   1030 <getLength@plt>
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
xor    %eax,%eax
cmp    $0x3a96,%edi
jg     1127 <getSize+0x17>
push   %rax
call   1030 <getLength@plt>
add    $0xfffffffe,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @getSize(i32 %0) {
%2 = icmp sgt i32 %0, 14998
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @getLength(i32 %0)
%5 = add nsw i32 %4, -2
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ prinf(char *);
void main() { prinf("hello DevOps"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello DevOps\00"
define void @main() {
%1 = call i32 @prinf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello DevOps\00"
define void @main() {
%1 = tail call i32 @prinf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int int_add(int line, int a, int b) { return a + b; }


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

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

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

LLVM IR (-O2):
define i32 @int_add(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
ret i32 %4
}
void VP8LDspInitMIPS32(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8LDspInitMIPS32() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ outl(int, int);
int /*<<< orphan*/ outw(int, int);
void vrWrite(uint16_t wClassIndex, uint16_t wData) {
  outl(((uint32_t)0xFC53 << 16) | wClassIndex, 0xAC1C);
  outw(wData, 0xAC1E);
}


x86 assembly (clang, -O0):
<vrWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
or     $0xfc530000,%edi
mov    $0xac1c,%esi
call   1030 <outl@plt>
mov    -0x8(%rbp),%edi
mov    $0xac1e,%esi
call   1040 <outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrWrite>:
push   %rbx
mov    %esi,%ebx
or     $0xfc530000,%edi
mov    $0xac1c,%esi
call   1030 <outl@plt>
mov    %ebx,%edi
mov    $0xac1e,%esi
pop    %rbx
jmp    1040 <outw@plt>

LLVM IR (-O0):
define void @vrWrite(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 = or i32 -61669376, %5
%7 = call i32 @outl(i32 %6, i32 44060)
%8 = load i32, i32* %4
%9 = call i32 @outw(i32 %8, i32 44062)
ret void
}

LLVM IR (-O2):
define void @vrWrite(i32 %0, i32 %1) {
%3 = or i32 %0, -61669376
%4 = tail call i32 @outl(i32 %3, i32 44060)
%5 = tail call i32 @outw(i32 %1, i32 44062)
ret void
}
void floats(float a, float b, float c, float d) {}


x86 assembly (clang, -O0):
<floats>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @floats(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
ret void
}

LLVM IR (-O2):
define void @floats(float %0, float %1, float %2, float %3) {
ret void
}
int isaac_strlen_zero(const char *s) { return (!s || (*s == '\0')); }


x86 assembly (clang, -O0):
<isaac_strlen_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <isaac_strlen_zero+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaac_strlen_zero>:
test   %rdi,%rdi
je     110e <isaac_strlen_zero+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isaac_strlen_zero(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isaac_strlen_zero(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
int main() {
  const char *input = "This is a test message.\n";
  char output[30];
  int length = 25;
  __asm__ __volatile__("cld\n\t"
                       "rep movsb"
                       :
                       : "S"(input), "D"(output), "c"(length));
  printf("%s", output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x19,-0x34(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%ecx
cld
rep movsb %ds:(%rsi),%es:(%rdi)
lea    -0x30(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rsi
mov    %rsp,%rax
mov    %rax,%rdi
mov    $0x19,%ecx
cld
rep movsb %ds:(%rsi),%es:(%rdi)
lea    0xee9(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"This is a test message.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [30 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 25, i32* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %4
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"This is a test message.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ chdir(char *);
int maybeSetCurrentDir(char *newDir) { return chdir(newDir) == 0; }


x86 assembly (clang, -O0):
<maybeSetCurrentDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maybeSetCurrentDir>:
push   %rax
call   1030 <chdir@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @maybeSetCurrentDir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @chdir(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @maybeSetCurrentDir(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dump_end(int dump) {
  if (dump == 2) {
    printf("]\n}\n");
  }
}


x86 assembly (clang, -O0):
<dump_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1131 <dump_end+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_end>:
cmp    $0x2,%edi
jne    1121 <dump_end+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <puts@plt>
ret

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

LLVM IR (-O2):
@str = [4 x i8] c"]\0A}\00"
define void @dump_end(i32 %0) {
%2 = icmp eq i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
int set_bits_less(int number, int index) { return number | ((1 << index) - 1); }


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

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

LLVM IR (-O0):
define i32 @set_bits_less(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 1, %6
%8 = sub nsw i32 %7, 1
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @set_bits_less(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = or i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SessionManagingHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void SessionManagingUpdated() { UAVObjUpdated(SessionManagingHandle()); }


x86 assembly (clang, -O0):
<SessionManagingUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SessionManagingHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SessionManagingUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <SessionManagingHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @SessionManagingUpdated() {
%1 = call i32 (...) @SessionManagingHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SessionManagingUpdated() {
%1 = tail call i32 (...) @SessionManagingHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void wpa_supplicant_ctrl_iface_wait(struct ctrl_iface_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.ctrl_iface_priv = type opaque
define void @wpa_supplicant_ctrl_iface_wait(%struct.ctrl_iface_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_address_of_variable_ptr(int *a) {
  printf("%p - Function address of n passed by address. "
         "(Where *a point to)\n",
         a);
  printf("%p - Address of function pointer *a.\n", &a);
}


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

x86 assembly (clang, -O2):
<print_address_of_variable_ptr>:
push   %rax
mov    %rdi,%rsi
mov    %rdi,(%rsp)
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [67 x i8] c"%p - Function address of n passed by address. (Where *a point to)\0A\00"
@.str.1 = [38 x i8] c"%p - Address of function pointer *a.\0A\00"
define void @print_address_of_variable_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32** %2)
ret void
}

LLVM IR (-O2):
@.str = [67 x i8] c"%p - Function address of n passed by address. (Where *a point to)\0A\00"
@.str.1 = [38 x i8] c"%p - Address of function pointer *a.\0A\00"
define void @print_address_of_variable_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32* %0)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32** %2)
ret void
}
int compareFloatKeys(void *a, void *b) {
  float *a1, *b1;
  a1 = (float *)a;
  b1 = (float *)b;
  return ((*a1) - (*b1));
}


x86 assembly (clang, -O0):
<compareFloatKeys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  (%rax),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareFloatKeys>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @compareFloatKeys(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float*
%6 = alloca float*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
store float* %8, float** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to float*
store float* %10, float** %6
%11 = load float*, float** %5
%12 = load float, float* %11
%13 = load float*, float** %6
%14 = load float, float* %13
%15 = fsub float %12, %14
%16 = fptosi float %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @compareFloatKeys(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = fptosi float %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ simgraph_exit();
int close_adaptor() {
  simgraph_exit();
  return 1;
}


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

x86 assembly (clang, -O2):
<close_adaptor>:
push   %rax
xor    %eax,%eax
call   1030 <simgraph_exit@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @close_adaptor() {
%1 = call i32 (...) @simgraph_exit()
ret i32 1
}

LLVM IR (-O2):
define i32 @close_adaptor() {
%1 = tail call i32 (...) @simgraph_exit()
ret i32 1
}