xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LZ5_compressBound(int);
int LZ5_compress_HC(char const *, char *, int, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int LZ5_compressHC(const char *src, char *dst, int srcSize) {
  return LZ5_compress_HC(src, dst, srcSize, LZ5_compressBound(srcSize), 0);
}


x86 assembly (clang, -O0):
<LZ5_compressHC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <LZ5_compressBound@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <LZ5_compress_HC@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ5_compressHC>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1040 <LZ5_compressBound@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %r8d,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <LZ5_compress_HC@plt>

LLVM IR (-O0):
define i32 @LZ5_compressHC(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 i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @LZ5_compressBound(i32 %10)
%12 = call i32 @LZ5_compress_HC(i8* %7, i8* %8, i32 %9, i32 %11, i32 0)
ret i32 %12
}

LLVM IR (-O2):
define i32 @LZ5_compressHC(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @LZ5_compressBound(i32 %2)
%5 = tail call i32 @LZ5_compress_HC(i8* %0, i8* %1, i32 %2, i32 %4, i32 0)
ret i32 %5
}
void exo_prefetch0(volatile void *p) {
  asm volatile("prefetcht0 %[p]" : [p] "+m"(*(volatile char *)p));
}


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

x86 assembly (clang, -O2):
<exo_prefetch0>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @exo_prefetch0(i8* %0) {
tail call void asm sideeffect "prefetcht0 $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
/* Type definitions */
struct link_map {
  int dummy;
};
typedef int /*<<< orphan*/ Elf32_Rela;
typedef int /*<<< orphan*/ Elf32_Addr;

/* Variables and functions */
Elf32_Addr elf_machine_plt_value(struct link_map *map, const Elf32_Rela *reloc,
                                 Elf32_Addr value) {
  return value;
}


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

x86 assembly (clang, -O2):
<elf_machine_plt_value>:
mov    %edx,%eax
ret

LLVM IR (-O0):
%struct.link_map = type { i32 }
define i32 @elf_machine_plt_value(%struct.link_map* %0, i32* %1, i32 %2) {
%4 = alloca %struct.link_map*
%5 = alloca i32*
%6 = alloca i32
store %struct.link_map* %0, %struct.link_map** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.link_map = type { i32 }
define i32 @elf_machine_plt_value(%struct.link_map* nocapture readnone %0, i32* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
/* Type definitions */
struct timecoder_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ timecoder_monitor_clear(struct timecoder_t *);
void timecoder_clear(struct timecoder_t *tc) { timecoder_monitor_clear(tc); }


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

x86 assembly (clang, -O2):
<timecoder_clear>:
jmp    1030 <timecoder_monitor_clear@plt>

LLVM IR (-O0):
%struct.timecoder_t = type { i32 }
define void @timecoder_clear(%struct.timecoder_t* %0) {
%2 = alloca %struct.timecoder_t*
store %struct.timecoder_t* %0, %struct.timecoder_t** %2
%3 = load %struct.timecoder_t*, %struct.timecoder_t** %2
%4 = call i32 @timecoder_monitor_clear(%struct.timecoder_t* %3)
ret void
}

LLVM IR (-O2):
%struct.timecoder_t = type { i32 }
define void @timecoder_clear(%struct.timecoder_t* %0) {
%2 = tail call i32 @timecoder_monitor_clear(%struct.timecoder_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puke(char const *);
void pukeif(int ret, const char *message) {
  if (ret != 0) {
    puke(message);
  }
}


x86 assembly (clang, -O0):
<pukeif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <pukeif+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <puke@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pukeif>:
test   %edi,%edi
je     111c <pukeif+0xc>
mov    %rsi,%rdi
jmp    1030 <puke@plt>
ret

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

LLVM IR (-O2):
define void @pukeif(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puke(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
unsigned char *get_sha256(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  unsigned char *test = NULL;
  test = get_sha256("test", 4);
  printf("SHA256 from test: %s", (char *)test);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [21 x i8] c"SHA256 from test: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i8* @get_sha256(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [21 x i8] c"SHA256 from test: %s\00"
define i32 @main() {
%1 = tail call i8* @get_sha256(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int isalpha(int);
bool invalidFunctionArgBool_isalpha(bool b, int c) {
  (void)isalpha(b);
  return isalpha(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isalpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_isalpha>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <isalpha@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isalpha(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 = call i32 @isalpha(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isalpha(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isalpha(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @isalpha(i32 %4)
ret i32 %5
}
int nwd(int a, int b) {
  while (b != 0) {
    int temp = a % b;
    a = b;
    b = temp;
  }
  return a;
}


x86 assembly (clang, -O0):
<nwd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <nwd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <nwd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nwd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <nwd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <nwd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @nwd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
char *astrcpy(char *);
char *astrmid(char const *, int, int);
int strlen(char const *);
char *astrunquote(const char *s) {
  if (strlen(s) == 2)
    return astrcpy("");
  else
    return astrmid(s, 1, strlen(s) - 2);
}


x86 assembly (clang, -O0):
<astrunquote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1163 <astrunquote+0x33>
lea    0xeab(%rip),%rdi
call   1040 <astrcpy@plt>
mov    %rax,-0x8(%rbp)
jmp    118b <astrunquote+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
sub    $0x2,%edx
mov    $0x1,%esi
call   1050 <astrmid@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrunquote>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    114b <astrunquote+0x1b>
lea    0xebb(%rip),%rdi
pop    %rbx
jmp    1040 <astrcpy@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x2(%rax),%edx
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1050 <astrmid@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @astrunquote(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @astrcpy(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %2
br label %15
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = sub nsw i32 %12, 2
%14 = call i8* @astrmid(i8* %10, i32 1, i32 %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %9, %7
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @astrunquote(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @astrcpy(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, -2
%9 = tail call i8* @astrmid(i8* %0, i32 1, i32 %8)
br label %10
10: ; preds = %6, %4
%11 = phi i8* [ %5, %4 ], [ %9, %6 ]
ret i8* %11
}
/* Variables and functions */
double pow(double, double);
__attribute__((__weak__, __always___)) double softboundmpx_pow(double x,
                                                               double y) {
  return pow(x, y);
}


x86 assembly (clang, -O0):
<softboundmpx_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define weak double @softboundmpx_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define weak double @softboundmpx_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
int is_prime(int in) {
  if (in < 2)
    return -1;
  if (in == 2 || in == 3)
    return 1;
  if (in % 2 == 0 || in % 3 == 0)
    return 0;
  else
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <is_prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <is_prime+0x78>
cmpl   $0x2,-0x8(%rbp)
je     1131 <is_prime+0x31>
cmpl   $0x3,-0x8(%rbp)
jne    113d <is_prime+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1178 <is_prime+0x78>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1165 <is_prime+0x65>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1171 <is_prime+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1178 <is_prime+0x78>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     112d <is_prime+0x2d>
mov    %edi,%ecx
and    $0xfffffffe,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
je     112d <is_prime+0x2d>
imul   $0xaaaaaaab,%edi,%eax
cmp    $0x55555556,%eax
setae  %al
and    %dil,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, -2
%5 = icmp eq i32 %4, 2
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = and i32 %0, 1
%8 = icmp ne i32 %7, 0
%9 = urem i32 %0, 3
%10 = icmp ne i32 %9, 0
%11 = and i1 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 1, %3 ], [ %12, %6 ]
ret i32 %14
}
void write_byte(int address, char byte) {
  char *a = (char *)address;
  *a = byte;
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
movslq %edi,%rax
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define void @write_byte(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8, i8* %4
%10 = load i8*, i8** %5
store i8 %9, i8* %10
ret void
}

LLVM IR (-O2):
define void @write_byte(i32 %0, i8 signext %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
store i8 %1, i8* %4
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ tpi_write(int);
void tpi_sst_postinc(uint8_t data) {
  tpi_write((0x64));
  tpi_write(data);
}


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

x86 assembly (clang, -O2):
<tpi_sst_postinc>:
push   %rbx
mov    %edi,%ebx
mov    $0x64,%edi
call   1030 <tpi_write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tpi_write@plt>

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

LLVM IR (-O2):
define void @tpi_sst_postinc(i32 %0) {
%2 = tail call i32 @tpi_write(i32 100)
%3 = tail call i32 @tpi_write(i32 %0)
ret void
}
int test_imm_7Aint16_mem(short *val) {
  return ((*val) & (0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Aint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x7a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Aint16_mem>:
testb  $0x7a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 122
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int branch(int selector) {
  if (selector)
    return 1;
  else
    goto successor;
successor:
  return 0;
}


x86 assembly (clang, -O0):
<branch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <branch+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1129 <branch+0x29>
jmp    1122 <branch+0x22>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<branch>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @branch(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_ino;
};

/* Variables and functions */
void foo() {
  struct dirent *d;
  d->d_ino;
}


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

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

LLVM IR (-O0):
%struct.dirent = type { i32 }
define void @foo() {
%1 = alloca %struct.dirent*
%2 = load %struct.dirent*, %struct.dirent** %1
%3 = getelementptr inbounds %struct.dirent, %struct.dirent* %2, i32 0, i32 0
%4 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_flag(unsigned int *, int);
int /*<<< orphan*/ print_flag(unsigned int);
int /*<<< orphan*/ set_flag(unsigned int *, int);
int main(void) {
  unsigned int flag = 0;
  set_flag(&flag, 1 | 2 | 8);
  print_flag(flag);
  clear_flag(&flag, 2 | 8);
  print_flag(flag);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1050 <set_flag@plt>
mov    -0x8(%rbp),%edi
call   1040 <print_flag@plt>
lea    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <clear_flag@plt>
mov    -0x8(%rbp),%edi
call   1040 <print_flag@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <set_flag@plt>
mov    0xc(%rsp),%edi
call   1040 <print_flag@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <clear_flag@plt>
mov    0xc(%rsp),%edi
call   1040 <print_flag@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @set_flag(i32* %2, i32 11)
%4 = load i32, i32* %2
%5 = call i32 @print_flag(i32 %4)
%6 = call i32 @clear_flag(i32* %2, i32 10)
%7 = load i32, i32* %2
%8 = call i32 @print_flag(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @set_flag(i32* %1, i32 11)
%4 = load i32, i32* %1
%5 = call i32 @print_flag(i32 %4)
%6 = call i32 @clear_flag(i32* %1, i32 10)
%7 = load i32, i32* %1
%8 = call i32 @print_flag(i32 %7)
ret i32 0
}
int e_free_arg(char **arg, int argc) {
  int i;
  for (i = 0; i < argc; i++)
    if (arg[i])
      free(arg[i]);
  free(arg);
  return (i);
}


x86 assembly (clang, -O0):
<e_free_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <e_free_arg+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <e_free_arg+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    115b <e_free_arg+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <e_free_arg+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_free_arg>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
test   %esi,%esi
jle    1149 <e_free_arg+0x39>
mov    %esi,%r14d
mov    %esi,%ebp
xor    %ebx,%ebx
jmp    1139 <e_free_arg+0x29>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
je     114c <e_free_arg+0x3c>
mov    (%r15,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <e_free_arg+0x20>
call   1030 <free@plt>
jmp    1130 <e_free_arg+0x20>
xor    %r14d,%r14d
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @e_free_arg(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ 0, %4 ], [ %13, %12 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %6
tail call void @free(i8* %9)
br label %12
12: ; preds = %6, %11
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %12, %2
%16 = phi i32 [ 0, %2 ], [ %1, %12 ]
%17 = bitcast i8** %0 to i8*
tail call void @free(i8* %17)
ret i32 %16
}
void urb_print(struct admhcd *ahcd, struct urb *urb, char *str, int small) {}


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

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

LLVM IR (-O0):
%struct.admhcd = type opaque
%struct.urb = type opaque
define void @urb_print(%struct.admhcd* %0, %struct.urb* %1, i8* %2, i32 %3) {
%5 = alloca %struct.admhcd*
%6 = alloca %struct.urb*
%7 = alloca i8*
%8 = alloca i32
store %struct.admhcd* %0, %struct.admhcd** %5
store %struct.urb* %1, %struct.urb** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.admhcd = type opaque
%struct.urb = type opaque
define void @urb_print(%struct.admhcd* nocapture %0, %struct.urb* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
int count_lbx_key_value_delimiter_chars(char *s) {
  int i;
  i = 0;
  while (s[i] == '\t')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<count_lbx_key_value_delimiter_chars>:
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),%eax
cmp    $0x9,%eax
jne    1132 <count_lbx_key_value_delimiter_chars+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <count_lbx_key_value_delimiter_chars+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @count_lbx_key_value_delimiter_chars(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 eq i32 %10, 9
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @count_lbx_key_value_delimiter_chars(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 9
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ reverseAdd(int);
int scanf(char *, int *);
int main() {
  int x;
  assert(scanf("%d", &x) == 1);
  reverseAdd(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%edi
call   1030 <reverseAdd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x4(%rsp),%edi
call   1030 <reverseAdd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @reverseAdd(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @reverseAdd(i32 %7)
ret i32 0
}
signed char explicit_signed_int_to_signed_char(signed int src) {
  return (signed char)src;
}


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

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

LLVM IR (-O0):
define signext i8 @explicit_signed_int_to_signed_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @explicit_signed_int_to_signed_char(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_ino;
};
typedef int /*<<< orphan*/ ino_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
ino_t get_inode(char *fname) {
  struct stat info;
  if (stat(fname, &info) == -1) {
    fprintf(stderr, "Cannot stat ");
    perror(fname);
    exit(1);
  }
  return info.st_ino;
}


x86 assembly (clang, -O0):
<get_inode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    118a <get_inode+0x4a>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_inode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1161 <get_inode+0x21>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [13 x i8] c"Cannot stat \00"
define i32 @get_inode(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = call i32 @perror(i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [13 x i8] c"Cannot stat \00"
define i32 @get_inode(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @perror(i8* %0)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%13 = load i32, i32* %12
ret i32 %13
}
/* Variables and functions */
int omp_get_num_threads();
int /*<<< orphan*/ printf(char *, int);
void printThreads() {
  int count;
#pragma omp parallel
  { count = omp_get_num_threads(); }
  printf("Use threads: %2d\n", count);
}


x86 assembly (clang, -O0):
<printThreads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <omp_get_num_threads@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printThreads>:
push   %rax
xor    %eax,%eax
call   1040 <omp_get_num_threads@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Use threads: %2d\0A\00"
define void @printThreads() {
%1 = tail call i32 (...) @omp_get_num_threads()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
scalar_t__ stat(char *, struct stat *);
int isdir(char *path) {
  struct stat s;
  if (stat(path, &s) == 0) {
    if (s.st_mode & S_IFDIR) {
      return 1;
    } else {
      return 0;
    }
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1160 <isdir+0x50>
mov    -0x18(%rbp),%eax
mov    0x2e9b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1154 <isdir+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1167 <isdir+0x57>
movl   $0x0,-0x4(%rbp)
jmp    1167 <isdir+0x57>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdir>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1128 <isdir+0x18>
pop    %rcx
ret
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i32, i32* @S_IFDIR
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 1, i32* %2
br label %17
15: ; preds = %8
store i32 0, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %14
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isdir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFDIR
%10 = and i32 %9, %8
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %1, %6
%14 = phi i32 [ %12, %6 ], [ -1, %1 ]
ret i32 %14
}
void wcnss_wlan_crypto_free_ahash(void *tfm) {}


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

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

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

LLVM IR (-O2):
define void @wcnss_wlan_crypto_free_ahash(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t ct_isnonzero_u64(uint64_t x) { return (x | -x) >> 63; }


x86 assembly (clang, -O0):
<ct_isnonzero_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
or     %ecx,%eax
mov    $0x3f,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ct_isnonzero_u64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tsk_free(void **ptr) {
  if (ptr && *ptr) {
    free(*ptr);
    *ptr = 0;
  }
}


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

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

LLVM IR (-O0):
define void @tsk_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 %14
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, %1
ret void
}

LLVM IR (-O2):
define void @tsk_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 = %6, %3, %1
ret void
}
int test_imm_56int16_mem(short *val) {
  return ((*val) & (-0x56 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_56int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_56int16_mem>:
movzwl (%rdi),%eax
test   $0xffaa,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_56int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -86
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
typahead() { return (0); }


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

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

LLVM IR (-O0):
define i32 @typahead() {
ret i32 0
}

LLVM IR (-O2):
define i32 @typahead() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char *, char const *, int /*<<< orphan*/);
int line_starts_with(char *line, const char *prefix) {
  if (strncmp(line, prefix, strlen(prefix)) == 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<line_starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116e <line_starts_with+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1175 <line_starts_with+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @line_starts_with(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @strncmp(i8* %6, i8* %7, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @line_starts_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void INT_Excep_MTU5_TGIU5(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU5_TGIU5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testforty_state_pop(char *, void *);
void testforty_state_pop_one(void *context) {
  testforty_state_pop("ONE", context);
}


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

x86 assembly (clang, -O2):
<testforty_state_pop_one>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <testforty_state_pop@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"ONE\00"
define void @testforty_state_pop_one(i8* %0) {
%2 = tail call i32 @testforty_state_pop(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t btz_pop_i(int32_t *stack, uint32_t *stack_ptr) {
  *stack_ptr -= 1;
  return stack[*stack_ptr];
}


x86 assembly (clang, -O0):
<btz_pop_i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btz_pop_i>:
movslq (%rsi),%rax
lea    -0x1(%rax),%rcx
mov    %ecx,(%rsi)
mov    -0x4(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @btz_pop_i(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @btz_pop_i(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *submissionSetPart(struct sqlConnection *, int, char *);
char *bioImagePublication(struct sqlConnection *conn, int id) {
  return submissionSetPart(conn, id, "publication");
}


x86 assembly (clang, -O0):
<bioImagePublication>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <submissionSetPart@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bioImagePublication>:
lea    0xee9(%rip),%rdx
jmp    1030 <submissionSetPart@plt>

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

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [12 x i8] c"publication\00"
define i8* @bioImagePublication(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @submissionSetPart(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int sync();
int main() { return sync(); }


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

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

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

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