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

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t syscall_write(int fildes, const void *buf, size_t nbyte) {
  return write(fildes, buf, nbyte);
}


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

x86 assembly (clang, -O2):
<syscall_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @syscall_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void test01(unsigned int a, unsigned int b) {
  if (a < 5)
    abort();
  if (b < 5)
    abort();
  if (a - b != 5)
    abort();
}


x86 assembly (clang, -O0):
<test01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x5,-0x4(%rbp)
jae    112f <test01+0x1f>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x5,-0x8(%rbp)
jae    1140 <test01+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x5,%eax
je     1156 <test01+0x46>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test01>:
push   %rax
cmp    $0x4,%edi
jbe    1124 <test01+0x14>
cmp    $0x4,%esi
jbe    1124 <test01+0x14>
sub    %esi,%edi
cmp    $0x5,%edi
jne    1124 <test01+0x14>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test01(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 = icmp ult i32 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp ult i32 %10, 5
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %9
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sub i32 %15, %16
%18 = icmp ne i32 %17, 5
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @test01(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 5
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
%7 = icmp ult i32 %1, 5
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %6
%11 = sub i32 %0, %1
%12 = icmp eq i32 %11, 5
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret void
}
void StandbyMode(int state) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @genfin_block() {
ret void
}
void hexTobin(unsigned char *hex, unsigned char *bin) {
  int i, j;
  for (i = 0; i < 160; i++) {
    bin[i] = (hex[i / 8] >> i) & 1;
  }
}


x86 assembly (clang, -O0):
<hexTobin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa0,-0x14(%rbp)
jge    1163 <hexTobin+0x63>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <hexTobin+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexTobin>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%r8d
shr    $0x3,%r8d
movzbl (%rdi,%r8,1),%edx
mov    %eax,%ecx
shr    %cl,%edx
and    $0x1,%dl
mov    %dl,(%rsi,%rax,1)
movzbl (%rdi,%r8,1),%edx
lea    0x1(%rax),%ecx
shr    %cl,%edx
and    $0x1,%dl
mov    %dl,0x1(%rsi,%rax,1)
add    $0x2,%rax
cmp    $0xa0,%rax
jne    1110 <hexTobin+0x10>
ret

LLVM IR (-O0):
define void @hexTobin(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
br label %7
7: ; preds = %26, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 160
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 8
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i32, i32* %5
%19 = ashr i32 %17, %18
%20 = and i32 %19, 1
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
br label %26
26: ; preds = %10
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %7
29: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @hexTobin(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %26, %3 ]
%5 = trunc i64 %4 to i32
%6 = lshr i64 %4, 3
%7 = and i64 %6, 536870911
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = lshr i32 %10, %5
%12 = trunc i32 %11 to i8
%13 = and i8 %12, 1
%14 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %13, i8* %14
%15 = or i64 %4, 1
%16 = trunc i64 %15 to i32
%17 = lshr i64 %4, 3
%18 = and i64 %17, 536870911
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = lshr i32 %21, %16
%23 = trunc i32 %22 to i8
%24 = and i8 %23, 1
%25 = getelementptr inbounds i8, i8* %1, i64 %15
store i8 %24, i8* %25
%26 = add nuw nsw i64 %4, 2
%27 = icmp eq i64 %26, 160
br i1 %27, label %28, label %3
28: ; preds = %3
ret void
}
int lengthOfLastWord(char *s) {
  int c = 0;
  char p = ' ';
  while (*s) {
    if (*s != ' ')
      if (p == ' ')
        c = 1;
      else
        ++c;
    p = *s++;
  }
  return c;
}


x86 assembly (clang, -O0):
<lengthOfLastWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movb   $0x20,-0xd(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1170 <lengthOfLastWord+0x70>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1157 <lengthOfLastWord+0x57>
movsbl -0xd(%rbp),%eax
cmp    $0x20,%eax
jne    1149 <lengthOfLastWord+0x49>
movl   $0x1,-0xc(%rbp)
jmp    1152 <lengthOfLastWord+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <lengthOfLastWord+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
jmp    1113 <lengthOfLastWord+0x13>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lengthOfLastWord>:
mov    $0x20,%cl
xor    %eax,%eax
mov    $0x1,%esi
jmp    1116 <lengthOfLastWord+0x16>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdi
mov    %edx,%ecx
movzbl (%rdi),%edx
cmp    $0x20,%dl
je     1110 <lengthOfLastWord+0x10>
test   %dl,%dl
je     112d <lengthOfLastWord+0x2d>
add    $0x1,%eax
cmp    $0x20,%cl
cmove  %esi,%eax
jmp    1110 <lengthOfLastWord+0x10>
ret

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

LLVM IR (-O2):
define i32 @lengthOfLastWord(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i8* [ %0, %1 ], [ %13, %11 ]
%4 = phi i32 [ 0, %1 ], [ %12, %11 ]
%5 = phi i8 [ 32, %1 ], [ %6, %11 ]
%6 = load i8, i8* %3
switch i8 %6, label %7 [
i8 0, label %14
i8 32, label %11
]
7: ; preds = %2
%8 = icmp eq i8 %5, 32
%9 = add nsw i32 %4, 1
%10 = select i1 %8, i32 1, i32 %9
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ %4, %2 ], [ %10, %7 ]
%13 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
14: ; preds = %2
ret i32 %4
}
void os_host_main_loop_wait(int *timeout) {}


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

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

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

LLVM IR (-O2):
define void @os_host_main_loop_wait(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int f294(int *);
int f295(int *p) { return f294(p); }


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

x86 assembly (clang, -O2):
<f295>:
jmp    1030 <f294@plt>

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

LLVM IR (-O2):
define i32 @f295(i32* %0) {
%2 = tail call i32 @f294(i32* %0)
ret i32 %2
}
void actuators_init(void) {}


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

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

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

LLVM IR (-O2):
define void @actuators_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetMarsSatOsculatingCoor(double, double, int, double *);
void GetMarsSatCoor(double jd, int body, double *xyz) {
  GetMarsSatOsculatingCoor(jd, jd, body, xyz);
}


x86 assembly (clang, -O0):
<GetMarsSatCoor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <GetMarsSatOsculatingCoor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMarsSatCoor>:
movaps %xmm0,%xmm1
jmp    1030 <GetMarsSatOsculatingCoor@plt>

LLVM IR (-O0):
define void @GetMarsSatCoor(double %0, i32 %1, double* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca double*
store double %0, double* %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load i32, i32* %5
%10 = load double*, double** %6
%11 = call i32 @GetMarsSatOsculatingCoor(double %7, double %8, i32 %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @GetMarsSatCoor(double %0, i32 %1, double* %2) {
%4 = tail call i32 @GetMarsSatOsculatingCoor(double %0, double %0, i32 %1, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  int intNum1 = 1, intNum2 = 2, intNum3 = 3, intProduto = 0;
  intProduto = intNum1 * intNum2 * intNum3;
  printf("Numero 1: %d\nNumero 2: %d\nNumero 3: %d\n\nTotal   : %d\n\n",
         intNum1, intNum2, intNum3, intProduto);
  printf("Fim de Programa\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x6,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Numero 1: %d\0ANumero 2: %d\0ANumero 3: %d\0A\0ATotal : %d\0A\0A\00"
@.str.1 = [17 x i8] c"Fim de Programa\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"Numero 1: %d\0ANumero 2: %d\0ANumero 3: %d\0A\0ATotal : %d\0A\0A\00"
@str = [16 x i8] c"Fim de Programa\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 6)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int max1(int a, int b, int c) {
  a = a > b ? a : b;
  c = c > a ? c : a;
  return c;
}


x86 assembly (clang, -O0):
<max1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <max1+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112a <max1+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1147 <max1+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114d <max1+0x4d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max1>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @max1(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* %4
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %14
12: ; preds = %3
%13 = load i32, i32* %5
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
store i32 %15, i32* %4
%16 = load i32, i32* %6
%17 = load i32, i32* %4
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %6
br label %23
21: ; preds = %14
%22 = load i32, i32* %4
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %6
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
define i32 @max1(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int voltearBits(unsigned char const);
unsigned char getNr(unsigned int tam, const unsigned char *tr) {
  if (tam < 4)
    return voltearBits(tr[16]) & 7;
  else
    return voltearBits(tr[17]) & 127;
}


x86 assembly (clang, -O0):
<getNr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jae    1141 <getNr+0x31>
mov    -0x10(%rbp),%rax
movzbl 0x10(%rax),%edi
call   1030 <voltearBits@plt>
and    $0x7,%eax
mov    %al,-0x1(%rbp)
jmp    1154 <getNr+0x44>
mov    -0x10(%rbp),%rax
movzbl 0x11(%rax),%edi
call   1030 <voltearBits@plt>
and    $0x7f,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNr>:
push   %rbx
cmp    $0x4,%edi
sbb    $0x0,%rsi
cmp    $0x4,%edi
mov    $0x7,%eax
mov    $0x7f,%ebx
cmovb  %eax,%ebx
movzbl 0x11(%rsi),%edi
call   1030 <voltearBits@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @getNr(i32 %0, i8* %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = icmp ult i32 %6, 4
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 16
%11 = load i8, i8* %10
%12 = call i32 @voltearBits(i8 zeroext %11)
%13 = and i32 %12, 7
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %22
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 17
%18 = load i8, i8* %17
%19 = call i32 @voltearBits(i8 zeroext %18)
%20 = and i32 %19, 127
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
br label %22
22: ; preds = %15, %8
%23 = load i8, i8* %3
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @getNr(i32 %0, i8* nocapture %1) {
%3 = icmp ult i32 %0, 4
%4 = select i1 %3, i64 16, i64 17
%5 = select i1 %3, i8 7, i8 127
%6 = getelementptr inbounds i8, i8* %1, i64 %4
%7 = load i8, i8* %6
%8 = tail call i32 @voltearBits(i8 zeroext %7)
%9 = trunc i32 %8 to i8
%10 = and i8 %5, %9
ret i8 %10
}
void a(char *a) { __attribute__((annotate("bar"))) static char bar; }


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

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

LLVM IR (-O0):
@a.bar = internal global i8 0
@.str = [4 x i8] c"bar\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpglwey2fk/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* @a.bar, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define void @a(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
@a.bar = internal global i8 0
@.str = [4 x i8] c"bar\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpglwey2fk/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* @a.bar, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define void @a(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int /*<<< orphan*/);
int /*<<< orphan*/ do_check_dbl(void *);
int /*<<< orphan*/ do_dbl_alloc(void **);
void test_addressable_void_variable() {
  void *pv;
  do_dbl_alloc(&pv);
  assertTrue("pv != NULL", pv != NULL);
  ;
  do_check_dbl(pv);
}


x86 assembly (clang, -O0):
<test_addressable_void_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1050 <do_dbl_alloc@plt>
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeab(%rip),%rdi
call   1040 <assertTrue@plt>
mov    -0x8(%rbp),%rdi
call   1030 <do_check_dbl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_addressable_void_variable>:
push   %rax
mov    %rsp,%rdi
call   1050 <do_dbl_alloc@plt>
xor    %esi,%esi
cmpq   $0x0,(%rsp)
setne  %sil
lea    0xeb5(%rip),%rdi
call   1040 <assertTrue@plt>
mov    (%rsp),%rdi
call   1030 <do_check_dbl@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"pv != NULL\00"
define void @test_addressable_void_variable() {
%1 = alloca i8*
%2 = call i32 @do_dbl_alloc(i8** %1)
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %1
%8 = call i32 @do_check_dbl(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"pv != NULL\00"
define void @test_addressable_void_variable() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @do_dbl_alloc(i8** %1)
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %1
%9 = call i32 @do_check_dbl(i8* %8)
ret void
}
int do_350() { return 350; }


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

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

LLVM IR (-O0):
define i32 @do_350() {
ret i32 350
}

LLVM IR (-O2):
define i32 @do_350() {
ret i32 350
}
/* Variables and functions */
int get_fields(char *, char, char **);
char *enm(char *flds[20]) {
  char *sflds[20];
  int nsf = get_fields(flds[0], '|', sflds);
  return (nsf > 0 ? sflds[0] : "Unknown");
}


x86 assembly (clang, -O0):
<enm>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xb0(%rbp),%rdx
mov    $0x7c,%esi
call   1030 <get_fields@plt>
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb4(%rbp)
jle    115d <enm+0x4d>
mov    -0xb0(%rbp),%rax
mov    %rax,-0xc0(%rbp)
jmp    1170 <enm+0x60>
lea    0xe9c(%rip),%rax
mov    %rax,-0xc0(%rbp)
jmp    1170 <enm+0x60>
mov    -0xc0(%rbp),%rax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enm>:
sub    $0xa8,%rsp
mov    (%rdi),%rdi
mov    %rsp,%rdx
mov    $0x7c,%esi
call   1030 <get_fields@plt>
test   %eax,%eax
jle    1137 <enm+0x27>
mov    (%rsp),%rax
add    $0xa8,%rsp
ret
lea    0xec2(%rip),%rax
add    $0xa8,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Unknown\00"
define i8* @enm(i8** %0) {
%2 = alloca i8**
%3 = alloca [20 x i8*]
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 0
%9 = call i32 @get_fields(i8* %7, i8 signext 124, i8** %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 0
%14 = load i8*, i8** %13
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %12
%17 = phi i8* [ %14, %12 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %15 ]
ret i8* %17
}

LLVM IR (-O2):
@.str = [8 x i8] c"Unknown\00"
define i8* @enm(i8** nocapture %0) {
%2 = alloca [20 x i8*]
%3 = bitcast [20 x i8*]* %2 to i8*
%4 = load i8*, i8** %0
%5 = getelementptr inbounds [20 x i8*], [20 x i8*]* %2, i64 0, i64 0
%6 = call i32 @get_fields(i8* %4, i8 signext 124, i8** %5)
%7 = icmp sgt i32 %6, 0
%8 = load i8*, i8** %5
%9 = select i1 %7, i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void printHelp(const char *program) {
  fprintf(stderr,
          "\nUse: %s [option] <file name, for decompress dont type the "
          "extension %s>"
          "\n"
          "\n"
          "\n\toptions"
          "\n\t======="
          "\n\t\t -z compress"
          "\n\t\t -u decompress"
          "\n\t\t -h help"
          "\n\n",
          program, ".compressed");
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xf53(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xf60(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [138 x i8] c"\0AUse: %s [option] <file name, for decompress dont type the extension %s>\0A\0A\0A\09options\0A\09=======\0A\09\09 -z compress\0A\09\09 -u decompress\0A\09\09 -h help\0A\0A\00"
@.str.1 = [12 x i8] c".compressed\00"
define void @printHelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [138 x i8] c"\0AUse: %s [option] <file name, for decompress dont type the extension %s>\0A\0A\0A\09options\0A\09=======\0A\09\09 -z compress\0A\09\09 -u decompress\0A\09\09 -h help\0A\0A\00"
@.str.1 = [12 x i8] c".compressed\00"
define void @printHelp(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef void *time_t;
typedef void *clock_t;

/* Variables and functions */
void *strtoull(char const *, char **, int);
void getTimeClockFromName(const char *d_name, time_t *timep, clock_t *clockp) {
  char *clockstrp;
  *timep = strtoull(d_name + 8, &clockstrp, 10);
  *clockp = strtoull(clockstrp + 1, NULL, 10);
}


x86 assembly (clang, -O0):
<getTimeClockFromName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeClockFromName>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
add    $0x8,%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    %rax,(%rbx)
mov    (%rsp),%rdi
add    $0x1,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @getTimeClockFromName(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 8
%10 = call i8* @strtoull(i8* %9, i8** %7, i32 10)
%11 = load i8**, i8*** %5
store i8* %10, i8** %11
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = call i8* @strtoull(i8* %13, i8** null, i32 10)
%15 = load i8**, i8*** %6
store i8* %14, i8** %15
ret void
}

LLVM IR (-O2):
define void @getTimeClockFromName(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = call i8* @strtoull(i8* %6, i8** %4, i32 10)
store i8* %7, i8** %1
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = tail call i8* @strtoull(i8* nocapture %9, i8** null, i32 10)
store i8* %10, i8** %2
ret void
}
void my_printh(int *ptr) {
  print_hex(ptr);
  puts(" = ");
  print_hex(*ptr);
  puts("\n");
}


x86 assembly (clang, -O0):
<my_printh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <print_hex@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1040 <print_hex@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_printh>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <print_hex@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    (%rbx),%edi
xor    %eax,%eax
call   1040 <print_hex@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" = \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @my_printh(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @print_hex to i32 (i32*, ...)*)(i32* %3)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @print_hex to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" = \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @my_printh(i32* %0) {
%2 = tail call i32 (i32*, ...) bitcast (i32 (...)* @print_hex to i32 (i32*, ...)*)(i32* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_hex to i32 (i32, ...)*)(i32 %4)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int httpParamLength(char *in) {
  int i;
  for (i = 0; in[i] != '\0' && in[i] != '&' && in[i] != ' '; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<httpParamLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1158 <httpParamLength+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x26,%ecx
mov    %al,-0xd(%rbp)
je     1158 <httpParamLength+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1168 <httpParamLength+0x68>
jmp    117b <httpParamLength+0x7b>
jmp    116d <httpParamLength+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <httpParamLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpParamLength>:
xor    %eax,%eax
movabs $0x4100000001,%rcx
jmp    1114 <httpParamLength+0x14>
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x26,%rdx
ja     1110 <httpParamLength+0x10>
bt     %rdx,%rcx
jae    1110 <httpParamLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @httpParamLength(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 38, label %8
i8 32, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
char *strncat(char *, char *, int);
char *xstrncat(char *des, char *str, int size) {
  des[size - 1] = 0;
  return strncat(des, str, size - 1);
}


x86 assembly (clang, -O0):
<xstrncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrncat>:
movslq %edx,%rdx
movb   $0x0,-0x1(%rdi,%rdx,1)
add    $0xffffffffffffffff,%rdx
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define i8* @xstrncat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = call i8* @strncat(i8* %12, i8* %13, i32 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @xstrncat(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = tail call i8* @strncat(i8* %0, i8* %1, i32 %4)
ret i8* %7
}
/* Type definitions */
struct cluster_args_info {
  int dummy;
};

/* Variables and functions */
int cluster_cmdline_parser2(int, char **, struct cluster_args_info *,
                            int /*<<< orphan*/, int, int);
int cluster_cmdline_parser(int argc, char **argv,
                           struct cluster_args_info *args_info) {
  return cluster_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


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

x86 assembly (clang, -O2):
<cluster_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <cluster_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.cluster_args_info = type { i32 }
define i32 @cluster_cmdline_parser(i32 %0, i8** %1, %struct.cluster_args_info* %2) {
%4 = tail call i32 @cluster_cmdline_parser2(i32 %0, i8** %1, %struct.cluster_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
void f3(int a) {
  switch (!!a)
    break;
  switch (!a)
    break;
}


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

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

LLVM IR (-O0):
define void @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
switch i32 %7, label %8 [
]
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
switch i32 %12, label %13 [
]
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @f3(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("Usage:   runawk [OPTIONS] file        [arguments ...]\n         runawk "
       "[OPTIONS] -e 'script' [arguments...]\n         wrapper for "
       "/usr/bin/awk"
       " interpreter\nAuthor:  Jim Pryor <dubiousjim@gmail.com>\nVersion: "
       "0.30.0"
       "\n\nOptions:\n               -F sep  assign FS=sep\n         -v "
       "var=value  assign var=value\n   -f|--file file.awk  load awk library "
       "files\n -e|--source 'script'  program\n              --stdin  process "
       "stdin after arguments...\n            --version  show version number "
       "and exit\n               --help  show this message and exit\n    ");
}


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

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

LLVM IR (-O0):
@.str = [538 x i8] c"Usage: runawk [OPTIONS] file [arguments ...]\0A runawk [OPTIONS] -e 'script' [arguments...]\0A wrapper for /usr/bin/awk interpreter\0AAuthor: Jim Pryor <dubiousjim@gmail.com>\0AVersion: 0.30.0\0A\0AOptions:\0A -F sep assign FS=sep\0A -v var=value assign var=value\0A -f|--file file.awk load awk library files\0A -e|--source 'script' program\0A --stdin process stdin after arguments...\0A --version show version number and exit\0A --help show this message and exit\0A \00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([538 x i8], [538 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [538 x i8] c"Usage: runawk [OPTIONS] file [arguments ...]\0A runawk [OPTIONS] -e 'script' [arguments...]\0A wrapper for /usr/bin/awk interpreter\0AAuthor: Jim Pryor <dubiousjim@gmail.com>\0AVersion: 0.30.0\0A\0AOptions:\0A -F sep assign FS=sep\0A -v var=value assign var=value\0A -f|--file file.awk load awk library files\0A -e|--source 'script' program\0A --stdin process stdin after arguments...\0A --version show version number and exit\0A --help show this message and exit\0A \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([538 x i8], [538 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void neuralops_maxpool2d_2x2_fwd(size_t batch_sz, size_t in_width,
                                 size_t in_height, size_t chan,
                                 const float *in_buf, float *out_buf) {}


x86 assembly (clang, -O0):
<neuralops_maxpool2d_2x2_fwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @neuralops_maxpool2d_2x2_fwd(i64 %0, i64 %1, i64 %2, i64 %3, float* %4, float* %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca float*
%12 = alloca float*
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store float* %4, float** %11
store float* %5, float** %12
ret void
}

LLVM IR (-O2):
define void @neuralops_maxpool2d_2x2_fwd(i64 %0, i64 %1, i64 %2, i64 %3, float* nocapture %4, float* nocapture %5) {
ret void
}
int recon_plm(struct Grid *theGrid, struct Face *theFaces1,
              struct Face *theFaces2, struct Face *theFaces3, int nf1, int nf2,
              int nf3) {
  return 0;
}


x86 assembly (clang, -O0):
<recon_plm>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Grid = type opaque
%struct.Face = type opaque
define i32 @recon_plm(%struct.Grid* %0, %struct.Face* %1, %struct.Face* %2, %struct.Face* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.Grid*
%9 = alloca %struct.Face*
%10 = alloca %struct.Face*
%11 = alloca %struct.Face*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.Grid* %0, %struct.Grid** %8
store %struct.Face* %1, %struct.Face** %9
store %struct.Face* %2, %struct.Face** %10
store %struct.Face* %3, %struct.Face** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret i32 0
}

LLVM IR (-O2):
%struct.Grid = type opaque
%struct.Face = type opaque
define i32 @recon_plm(%struct.Grid* nocapture readnone %0, %struct.Face* nocapture readnone %1, %struct.Face* nocapture readnone %2, %struct.Face* nocapture readnone %3, i32 %4, i32 %5, i32 %6) {
ret i32 0
}
void AnalogConversionOff(void) {}


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

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

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

LLVM IR (-O2):
define void @AnalogConversionOff() {
ret void
}
int calculateImagePixels(size) {
  int width_of_pixel_box = (int)sqrt(4);
  int number_nodes = (int)pow(4, size - 1);
  int number_nodes_per_row = (int)sqrt(number_nodes);
  int total_pixels_per_row = width_of_pixel_box * number_nodes_per_row;
  return total_pixels_per_row;
}


x86 assembly (clang, -O0):
<calculateImagePixels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  0xecd(%rip),%xmm0
call   1040 <sqrt@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeaf(%rip),%xmm0
call   1030 <pow@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
call   1040 <sqrt@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateImagePixels>:
push   %rax
add    $0xffffffff,%edi
cvtsi2sd %edi,%xmm0
addsd  %xmm0,%xmm0
call   1030 <exp2@plt>
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1149 <calculateImagePixels+0x29>
sqrtsd %xmm0,%xmm0
jmp    114e <calculateImagePixels+0x2e>
call   1040 <sqrt@plt>
cvttsd2si %xmm0,%eax
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @calculateImagePixels(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = call double @sqrt(double 4.000000e+00)
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = call double @pow(double 4.000000e+00, double %11)
%13 = fptosi double %12 to i32
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = call double @sqrt(double %15)
%17 = fptosi double %16 to i32
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
define i32 @calculateImagePixels(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 2.000000e+00
%5 = tail call double @exp2(double %4)
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
%8 = tail call double @sqrt(double %7)
%9 = fptosi double %8 to i32
%10 = shl nsw i32 %9, 1
ret i32 %10
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_toggle_23() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 2;
  unsigned int d = exynos_5410_gpio_read(bank_offset);
  d ^= (1U << bit_index);
  exynos_5410_gpio_write_mask(bank_offset, d, (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_toggle_23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exynos_5410_gpio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_toggle_23>:
push   %rax
mov    $0xc40,%edi
call   1040 <exynos_5410_gpio_read@plt>
xor    $0x4,%eax
mov    $0xc40,%edi
mov    %eax,%esi
mov    $0x4,%edx
pop    %rax
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_toggle_23() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3136, i32* %1
store i32 2, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @exynos_5410_gpio_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = call i32 @exynos_5410_gpio_write_mask(i32 %10, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_toggle_23() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = xor i32 %1, 4
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %2, i32 4)
ret void
}
/* Variables and functions */
int fb_KeyHit();
int fb_hConsoleInputBufferChanged(void) { return fb_KeyHit(); }


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

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

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

LLVM IR (-O2):
define i32 @fb_hConsoleInputBufferChanged() {
%1 = tail call i32 (...) @fb_KeyHit()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cstr_free(char **s) {
  if (s != NULL) {
    if (*s != NULL) {
      free((void *)(*s));
      *s = NULL;
    }
  }
}


x86 assembly (clang, -O0):
<cstr_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <cstr_free+0x41>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <cstr_free+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    1151 <cstr_free+0x41>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr_free>:
push   %rbx
test   %rdi,%rdi
je     112d <cstr_free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <cstr_free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @cstr_free(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 %15
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = call i32 @free(i8* %11)
%13 = load i8**, i8*** %2
store i8* null, i8** %13
br label %14
14: ; preds = %9, %5
br label %15
15: ; preds = %14, %1
ret void
}

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