xunge/DecIR huggingface dataset:
/* Variables and functions */
int gmx_genconf(int, char **);
int main(int argc, char *argv[]) { return gmx_genconf(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_genconf@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_genconf(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
main(int argc, char **argv) {
  while (argc)
    printf("%s\n", argv[--argc]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1155 <main+0x45>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     1155 <main+0x45>
mov    %edi,%r15d
movslq %edi,%rax
neg    %r15d
lea    (%rsi,%rax,8),%r12
add    $0xfffffffffffffff8,%r12
xor    %ebx,%ebx
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r15d
jne    1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = trunc i64 %8 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x39() {
  Assert_real((isbdigit(57) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              290, ("isbdigit should be 0 for 9"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x39>:
push   %rax
mov    $0x39,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x122,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 9\00"
define void @t_isbdigit_0x39() {
%1 = call i64 @isbdigit(i32 57)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 9\00"
define void @t_isbdigit_0x39() {
%1 = tail call i64 @isbdigit(i32 57)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ power_soc_reset();
int main(void) {
  power_soc_reset();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @power_soc_reset()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flushinp();
void kb_flushinp() { flushinp(); }


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

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

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

LLVM IR (-O2):
define void @kb_flushinp() {
%1 = tail call i32 (...) @flushinp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CantDeleteItemErrorMessage(void *, char *, char const *);
void DeffunctionDeleteError(void *theEnv, const char *dfnxName) {
  CantDeleteItemErrorMessage(theEnv, "deffunction", dfnxName);
}


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

x86 assembly (clang, -O2):
<DeffunctionDeleteError>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <CantDeleteItemErrorMessage@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"deffunction\00"
define void @DeffunctionDeleteError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @CantDeleteItemErrorMessage(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"deffunction\00"
define void @DeffunctionDeleteError(i8* %0, i8* %1) {
%3 = tail call i32 @CantDeleteItemErrorMessage(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int pc_test_bit(unsigned int nr, unsigned long *bitmap) {
  unsigned long offset = nr / ((int)sizeof(unsigned long) * 8);
  unsigned long bit = nr & (((int)sizeof(unsigned long) * 8) - 1);
  return (bitmap[offset] >> bit) & 1;
}


x86 assembly (clang, -O0):
<pc_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x6,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_test_bit>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x6,%eax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pc_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = udiv i32 %7, 64
%9 = zext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i32, i32* %3
%11 = and i32 %10, 63
%12 = zext i32 %11 to i64
store i64 %12, i64* %6
%13 = load i64*, i64** %4
%14 = load i64, i64* %5
%15 = getelementptr inbounds i64, i64* %13, i64 %14
%16 = load i64, i64* %15
%17 = load i64, i64* %6
%18 = lshr i64 %16, %17
%19 = and i64 %18, 1
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @pc_test_bit(i32 %0, i64* nocapture %1) {
%3 = lshr i32 %0, 6
%4 = zext i32 %3 to i64
%5 = and i32 %0, 63
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %1, i64 %4
%8 = load i64, i64* %7
%9 = lshr i64 %8, %6
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 1
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int VdpIs60Hz(void) {
  uint8_t ver = *((uint8_t *)0xA10000);
  return ver & 0x40 ? 0 : 1;
}


x86 assembly (clang, -O0):
<VdpIs60Hz>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa10000,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x40,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VdpIs60Hz>:
xor    %eax,%eax
testb  $0x40,0xa10000
40
sete   %al
ret

LLVM IR (-O0):
define i32 @VdpIs60Hz() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 10551296 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 64
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @VdpIs60Hz() {
%1 = load i32, i32* inttoptr (i64 10551296 to i32*)
%2 = lshr i32 %1, 6
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Variables and functions */
float brrand();
float linhi() {
  float randnum, randnum2;
  randnum = brrand();
  randnum2 = brrand();
  if (randnum2 > randnum)
    randnum = randnum2;
  return (randnum);
}


x86 assembly (clang, -O0):
<linhi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <brrand@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <brrand@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1149 <linhi+0x39>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linhi>:
push   %rax
xor    %eax,%eax
call   1030 <brrand@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <brrand@plt>
maxss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @linhi() {
%1 = alloca float
%2 = alloca float
%3 = call float (...) @brrand()
store float %3, float* %1
%4 = call float (...) @brrand()
store float %4, float* %2
%5 = load float, float* %2
%6 = load float, float* %1
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load float, float* %2
store float %9, float* %1
br label %10
10: ; preds = %8, %0
%11 = load float, float* %1
ret float %11
}

LLVM IR (-O2):
define float @linhi() {
%1 = tail call float (...) @brrand()
%2 = tail call float (...) @brrand()
%3 = fcmp ogt float %2, %1
%4 = select i1 %3, float %2, float %1
ret float %4
}
int is_leap_year(int year) {
  if (year <= 1752) {
    if (year % 4 == 0)
      return 1;
    else
      return 0;
  } else {
    if (year % 4 == 0 && year % 100 != 0)
      return 1;
    if (year % 400 == 0)
      return 1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x6d8,-0x8(%rbp)
jg     1140 <is_leap_year+0x40>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <is_leap_year+0x34>
movl   $0x1,-0x4(%rbp)
jmp    119b <is_leap_year+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    119b <is_leap_year+0x9b>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1174 <is_leap_year+0x74>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1174 <is_leap_year+0x74>
movl   $0x1,-0x4(%rbp)
jmp    119b <is_leap_year+0x9b>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1194 <is_leap_year+0x94>
movl   $0x1,-0x4(%rbp)
jmp    119b <is_leap_year+0x9b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
cmp    $0x6d8,%edi
jg     1113 <is_leap_year+0x13>
test   $0x3,%dil
sete   %al
movzbl %al,%eax
ret
test   $0x3,%dil
jne    1135 <is_leap_year+0x35>
mov    %edi,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%al
sub    %ecx,%edx
je     1135 <is_leap_year+0x35>
movzbl %al,%eax
ret
imul   $0xc28f5c29,%edi,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = icmp slt i32 %0, 1753
%3 = and i32 %0, 3
br i1 %2, label %4, label %6
4: ; preds = %1
%5 = icmp eq i32 %3, 0
br label %14
6: ; preds = %1
%7 = icmp ne i32 %3, 0
%8 = urem i32 %0, 100
%9 = icmp eq i32 %8, 0
%10 = or i1 %7, %9
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = urem i32 %0, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %11, %6, %4
%15 = phi i1 [ %5, %4 ], [ true, %6 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int testdup(FILE *fp, char *iden) {
  fprintf(fp, "#ifndef %s\n", iden);
  fprintf(fp, "#define %s\n", iden);
  return (0);
}


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

x86 assembly (clang, -O2):
<testdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"#ifndef %s\0A\00"
@.str.1 = [12 x i8] c"#define %s\0A\00"
define i32 @testdup(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"#ifndef %s\0A\00"
@.str.1 = [12 x i8] c"#define %s\0A\00"
define i32 @testdup(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
void *test21_malloc(size_t n) {
  (void)(n);
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @test21_malloc(i64 %0) {
ret i8* null
}
int strkey(char C) {
  int i;
  char S[4] = {'L', 'B', 'H', 'S'};
  for (i = 0; i < 4; i++)
    if (S[i] == C)
      return i;
  return 4;
}


x86 assembly (clang, -O0):
<strkey>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1157 <strkey+0x57>
movslq -0xc(%rbp),%rax
movsbl -0x10(%rbp,%rax,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <strkey+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <strkey+0x5e>
jmp    1149 <strkey+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <strkey+0x1a>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strkey>:
add    $0xbe,%dil
cmp    $0x11,%dil
ja     1126 <strkey+0x26>
xor    %eax,%eax
movzbl %dil,%ecx
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%eax
ret
mov    $0x4,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
@__const.strkey.S = [4 x i8] c"LBHS"
define i32 @strkey(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca [4 x i8]
store i8 %0, i8* %3
%6 = bitcast [4 x i8]* %5 to i8*
store i32 0, i32* %4
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %26
21: ; preds = %10
br label %22
22: ; preds = %21
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %7
25: ; preds = %7
store i32 4, i32* %2
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @strkey(i8 signext %0) {
switch i8 %0, label %2 [
i8 76, label %6
i8 66, label %3
i8 72, label %4
i8 83, label %5
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ 0, %1 ], [ 4, %2 ], [ 1, %3 ], [ 2, %4 ], [ 3, %5 ]
ret i32 %7
}
/* Variables and functions */
int japi_random();
int j_random() { return (japi_random()); }


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

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

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

LLVM IR (-O2):
define i32 @j_random() {
%1 = tail call i32 (...) @japi_random()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int iam = 0, np = 1;
#pragma omp parallel default(shared) private(iam, np)
  { printf("Hello from thread %d out of %d\n", iam, np); }
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Hello from thread %d out of %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
store i32 1, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Hello from thread %d out of %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}
/* Variables and functions */
int intel_piix4_gpo_set(int, int /*<<< orphan*/);
int intel_piix4_gpo30_lower(void) { return intel_piix4_gpo_set(30, 0); }


x86 assembly (clang, -O0):
<intel_piix4_gpo30_lower>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
xor    %esi,%esi
call   1030 <intel_piix4_gpo_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_piix4_gpo30_lower>:
mov    $0x1e,%edi
xor    %esi,%esi
jmp    1030 <intel_piix4_gpo_set@plt>

LLVM IR (-O0):
define i32 @intel_piix4_gpo30_lower() {
%1 = call i32 @intel_piix4_gpo_set(i32 30, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intel_piix4_gpo30_lower() {
%1 = tail call i32 @intel_piix4_gpo_set(i32 30, i32 0)
ret i32 %1
}
int go(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6,
       int arg7, int arg8, int arg9) {
  return (arg1);
}


x86 assembly (clang, -O0):
<go>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<go>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @go(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%21 = load i32, i32* %12
ret i32 %21
}

LLVM IR (-O2):
define i32 @go(i32 %0, i32 returned %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void pipe() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @pipe() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
unsigned char *cbor_write_type_size(unsigned char *, unsigned int, int,
                                    unsigned int);
unsigned char *cbor_write_special(unsigned char *data, unsigned int size,
                                  unsigned int special) {
  return cbor_write_type_size(data, size, 7, special);
}


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

x86 assembly (clang, -O2):
<cbor_write_special>:
mov    %edx,%ecx
mov    $0x7,%edx
jmp    1030 <cbor_write_type_size@plt>

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

LLVM IR (-O2):
define i8* @cbor_write_special(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @cbor_write_type_size(i8* %0, i32 %1, i32 7, i32 %2)
ret i8* %4
}
void restterm(save) struct termio_dummy *save;
{ ; }


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

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

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

LLVM IR (-O2):
%struct.termio_dummy = type opaque
define void @restterm(%struct.termio_dummy* nocapture %0) {
ret void
}
int ft_tolower(int c) {
  if (c >= 65 && c <= 90)
    c += 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <ft_tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <ft_tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int get_pref_length(char const *, char const *);
float jaro_similarity(char const *, char const *);
float jaro_winkler_similarity(const char *str1, const char *str2) {
  float d = jaro_similarity(str1, str2);
  int pref_len = get_pref_length(str1, str2);
  return (d + (((float)pref_len) * (float)0.1 * (((float)1.0) - d)));
}


x86 assembly (clang, -O0):
<jaro_winkler_similarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <jaro_similarity@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_pref_length@plt>
mov    %eax,-0x18(%rbp)
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x18(%rbp),%xmm0
movss  0xea0(%rip),%xmm2
mulss  %xmm2,%xmm0
movss  0xe90(%rip),%xmm2
subss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jaro_winkler_similarity>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <jaro_similarity@plt>
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <get_pref_length@plt>
cvtsi2ss %eax,%xmm1
mulss  0xeb4(%rip),%xmm1
movss  0xeb0(%rip),%xmm0
movss  0x4(%rsp),%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @jaro_winkler_similarity(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call float @jaro_similarity(i8* %7, i8* %8)
store float %9, float* %5
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @get_pref_length(i8* %10, i8* %11)
store i32 %12, i32* %6
%13 = load float, float* %5
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to float
%16 = fmul float %15, 0x3FB99999A0000000
%17 = load float, float* %5
%18 = fsub float 1.000000e+00, %17
%19 = call float @llvm.fmuladd.f32(float %16, float %18, float %13)
ret float %19
}

LLVM IR (-O2):
define float @jaro_winkler_similarity(i8* %0, i8* %1) {
%3 = tail call float @jaro_similarity(i8* %0, i8* %1)
%4 = tail call i32 @get_pref_length(i8* %0, i8* %1)
%5 = sitofp i32 %4 to float
%6 = fmul float %5, 0x3FB99999A0000000
%7 = fsub float 1.000000e+00, %3
%8 = tail call float @llvm.fmuladd.f32(float %6, float %7, float %3)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_CTR_DRBG_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO not "
         "defined.\n");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [79 x i8] c"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [78 x i8] c"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void lws_latency_pre(struct libwebsocket_context *context,
                     struct libwebsocket *wsi) {
  while (0)
    ;
}


x86 assembly (clang, -O0):
<lws_latency_pre>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    111b <lws_latency_pre+0x1b>
jmp    1120 <lws_latency_pre+0x20>
jmp    110c <lws_latency_pre+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.libwebsocket_context = type opaque
%struct.libwebsocket = type opaque
define void @lws_latency_pre(%struct.libwebsocket_context* %0, %struct.libwebsocket* %1) {
%3 = alloca %struct.libwebsocket_context*
%4 = alloca %struct.libwebsocket*
store %struct.libwebsocket_context* %0, %struct.libwebsocket_context** %3
store %struct.libwebsocket* %1, %struct.libwebsocket** %4
br label %5
5: ; preds = %6, %2
br i1 false, label %6, label %7
6: ; preds = %5
br label %5
7: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.libwebsocket_context = type opaque
%struct.libwebsocket = type opaque
define void @lws_latency_pre(%struct.libwebsocket_context* nocapture %0, %struct.libwebsocket* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBOTGSessionRequest(uint32_t ui32Base, bool bStart) {
  ;
  if (bStart) {
    (*((volatile uint8_t *)(ui32Base + 0x00000060))) |= 0x00000001;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000060))) &= ~0x00000001;
  }
}


x86 assembly (clang, -O0):
<USBOTGSessionRequest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1127 <USBOTGSessionRequest+0x27>
mov    -0x8(%rbp),%rax
mov    0x60(%rax),%ecx
or     $0x1,%ecx
mov    %ecx,0x60(%rax)
jmp    1134 <USBOTGSessionRequest+0x34>
mov    -0x8(%rbp),%rax
mov    0x60(%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,0x60(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBOTGSessionRequest>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    0x60(%rdi),%ecx
and    $0xfffffffe,%ecx
or     %ecx,%eax
mov    %eax,0x60(%rdi)
ret

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

LLVM IR (-O2):
define void @USBOTGSessionRequest(i64 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = add nsw i64 %0, 96
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -2
%8 = zext i1 %3 to i32
%9 = or i32 %7, %8
store volatile i32 %9, i32* %5
ret void
}
char D2Hex(int i) {
  if (i < 0)
    return 0;
  else if (i < 10)
    return i + 48;
  else if (i < 16)
    return i + 55;
  else
    return 0;
}


x86 assembly (clang, -O0):
<D2Hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111a <D2Hex+0x1a>
movb   $0x0,-0x1(%rbp)
jmp    114e <D2Hex+0x4e>
cmpl   $0xa,-0x8(%rbp)
jge    1132 <D2Hex+0x32>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    114e <D2Hex+0x4e>
cmpl   $0x10,-0x8(%rbp)
jge    114a <D2Hex+0x4a>
mov    -0x8(%rbp),%eax
add    $0x37,%eax
mov    %al,-0x1(%rbp)
jmp    114e <D2Hex+0x4e>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<D2Hex>:
test   %edi,%edi
js     1116 <D2Hex+0x16>
mov    %edi,%eax
cmp    $0x9,%edi
ja     110e <D2Hex+0xe>
add    $0x30,%al
ret
cmp    $0xf,%eax
ja     1116 <D2Hex+0x16>
add    $0x37,%al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @D2Hex(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 10
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i32 %0 to i8
%7 = add nuw nsw i8 %6, 48
br label %13
8: ; preds = %3
%9 = icmp ult i32 %0, 16
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = trunc i32 %0 to i8
%12 = add nuw nsw i8 %11, 55
br label %13
13: ; preds = %8, %1, %10, %5
%14 = phi i8 [ %7, %5 ], [ %12, %10 ], [ 0, %1 ], [ 0, %8 ]
ret i8 %14
}
const char *find_callback(void *func, void *object) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @find_callback(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void sig_chld(int sig) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0)
    printf("child %d terminated\n", pid);
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <sig_chld+0x42>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <sig_chld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117e <sig_chld+0x5e>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <sig_chld+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
int condiiton_lessThan(char c) { return c == '<'; }


x86 assembly (clang, -O0):
<condiiton_lessThan>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condiiton_lessThan>:
xor    %eax,%eax
cmp    $0x3c,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @condiiton_lessThan(i8 signext %0) {
%2 = icmp eq i8 %0, 60
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int sum(int);
int main() { return sum(100); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x64,%edi
jmp    1030 <sum@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 100)
ret i32 %1
}
void ignore_ptr(void *p) { (void)p; }


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

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

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

LLVM IR (-O2):
define void @ignore_ptr(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_init(int);
void log_init_verbose() { log_init(1); }


x86 assembly (clang, -O0):
<log_init_verbose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <log_init@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @log_init_verbose() {
%1 = call i32 @log_init(i32 1)
ret void
}

LLVM IR (-O2):
define void @log_init_verbose() {
%1 = tail call i32 @log_init(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void show_usage(const char *pro_name) {
  fprintf(stderr,
          "Usage: %s [Options] [inputfile]\n"
          "\n"
          "Options:\n"
          "        -h show this help\n"
          "\n",
          pro_name);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: %s [Options] [inputfile]\0A\0AOptions:\0A -h show this help\0A\0A\00"
define void @show_usage(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 ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: %s [Options] [inputfile]\0A\0AOptions:\0A -h show this help\0A\0A\00"
define void @show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int destroyNLSocket(int sock) {
  if (sock <= 0) {
    printf("ERROR - %s:%d :: Invalid input netlink socket %d\n", __func__, 195,
           sock);
    return -1;
  }
  close(sock);
  return 0;
}


x86 assembly (clang, -O0):
<destroyNLSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     115e <destroyNLSocket+0x3e>
mov    -0x8(%rbp),%ecx
lea    0xec1(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0xc3,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <destroyNLSocket+0x4f>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyNLSocket>:
push   %rbx
mov    %edi,%ecx
test   %edi,%edi
jle    1134 <destroyNLSocket+0x14>
xor    %ebx,%ebx
mov    %ecx,%edi
xor    %eax,%eax
call   1040 <close@plt>
jmp    1153 <destroyNLSocket+0x33>
lea    0xec5(%rip),%rdi
lea    0xef0(%rip),%rsi
mov    $0xc3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"ERROR - %s:%d :: Invalid input netlink socket %d\0A\00"
@__func__.destroyNLSocket = [16 x i8] c"destroyNLSocket\00"
define i32 @destroyNLSocket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.destroyNLSocket, i64 0, i64 0), i32 195, i32 %7)
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %10)
store i32 0, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [50 x i8] c"ERROR - %s:%d :: Invalid input netlink socket %d\0A\00"
@__func__.destroyNLSocket = [16 x i8] c"destroyNLSocket\00"
define i32 @destroyNLSocket(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.destroyNLSocket, i64 0, i64 0), i32 195, i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -1, %3 ], [ 0, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ permute(int *, int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arrange[8] = {0, 1, 2, 3, 4, 5, 6, 7};
  int count = 0;
  permute(arrange, 0, 8, &count);
  printf("Printing the number of ways %d\n", count);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
lea    -0x34(%rbp),%rcx
call   1030 <permute@plt>
mov    -0x34(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <permute@plt>
mov    0xc(%rsp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.arrange = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [32 x i8] c"Printing the number of ways %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = call i32 @permute(i32* %5, i32 0, i32 8, i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 1
}

LLVM IR (-O2):
@__const.main.arrange = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [32 x i8] c"Printing the number of ways %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = bitcast [8 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 @permute(i32* %5, i32 0, i32 8, i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 1
}