xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("in main\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [9 x i8] c"in main\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"in main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void g_file_get_contents() {}


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

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

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

LLVM IR (-O2):
define void @g_file_get_contents() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ZLIBH_decompress(char *, char const *);
size_t FIO_ZLIBH_decompress(void *dst, size_t dstSize, const void *src,
                            size_t srcSize) {
  (void)srcSize;
  (void)dstSize;
  return (size_t)ZLIBH_decompress((char *)dst, (const char *)src);
}


x86 assembly (clang, -O0):
<FIO_ZLIBH_decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ZLIBH_decompress@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIO_ZLIBH_decompress>:
push   %rax
mov    %rdx,%rsi
call   1030 <ZLIBH_decompress@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @FIO_ZLIBH_decompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %6
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = call i32 @ZLIBH_decompress(i8* %11, i8* %12)
%14 = sext i32 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @FIO_ZLIBH_decompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @ZLIBH_decompress(i8* %0, i8* %2)
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IXOTH;
int is_others_exec(mode_t mode) { return mode & S_IXOTH; }


x86 assembly (clang, -O0):
<is_others_exec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_others_exec>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@S_IXOTH = global i32 0
define i32 @is_others_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @S_IXOTH
%5 = and i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@S_IXOTH = global i32 0
define i32 @is_others_exec(i32 %0) {
%2 = load i32, i32* @S_IXOTH
%3 = and i32 %2, %0
ret i32 %3
}
const char *ccnxPortalAbout_ShortNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\n";
}


x86 assembly (clang, -O0):
<ccnxPortalAbout_ShortNotice>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnxPortalAbout_ShortNotice>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxPortalAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxPortalAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int /*<<< orphan*/ abort();
int Bus() {
  Log("Bus error caused abort");
  abort();
}


x86 assembly (clang, -O0):
<Bus>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Bus>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Bus error caused abort\00"
define i32 @Bus() {
%1 = call i32 @Log(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Bus error caused abort\00"
define i32 @Bus() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int O_NONBLOCK;
int O_RDWR;
int open(char *, int);
long _OpenPort(char *name) {
  int fd;
  fd = open(name, O_RDWR | O_NONBLOCK);
  return fd;
}


x86 assembly (clang, -O0):
<_OpenPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_OpenPort>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1030 <open@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
define i64 @_OpenPort(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_NONBLOCK
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
define i64 @_OpenPort(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}
void test42_TestMod_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test42_TestMod_targetInit__I() {
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char);
int is_id_start(char c) { return isalpha(c) || (c == '_'); }


x86 assembly (clang, -O0):
<is_id_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <is_id_start+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_id_start>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_id_start(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int quit(char **args, int argc, int flags) {
  printf("BYE\n");
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"BYE\0A\00"
define i32 @quit(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 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [4 x i8] c"BYE\00"
define i32 @quit(i8** nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int i = 0;
  for (;;) {
    printf("My counter: %d\n", i);
    sleep(2);
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
add    $0x1,%ebx
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"My counter: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sleep(i32 2)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"My counter: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 2)
%5 = add nuw nsw i32 %2, 1
br label %1
}
int _hex(int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  if (c >= 'A' && c <= 'F')
    return 10 + (c - 'A');
  if (c >= 'a' && c <= 'f')
    return 10 + (c - 'a');
  return -1;
}


x86 assembly (clang, -O0):
<_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <_hex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <_hex+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <_hex+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <_hex+0x4e>
cmpl   $0x46,-0x8(%rbp)
jg     114e <_hex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <_hex+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <_hex+0x73>
cmpl   $0x66,-0x8(%rbp)
jg     1173 <_hex+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <_hex+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <_hex+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <_hex+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 10, %20
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 102
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 10, %30
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @_hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
void foo(void) {
  int i;
#pragma acc parallel
  { i = 1; }
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int rand();
void randomize_key(unsigned char *key, int key_data_len) {
  int randomized = 0;
  int counter = 0;
  if (!randomized) {
    for (; counter < key_data_len; counter++)
      key[counter] = (unsigned char)(rand() % 256);
  }
}


x86 assembly (clang, -O0):
<randomize_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1175 <randomize_key+0x65>
jmp    113c <randomize_key+0x2c>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <randomize_key+0x60>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <randomize_key+0x2c>
jmp    1175 <randomize_key+0x65>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize_key>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <randomize_key+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <randomize_key+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @randomize_key(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int a = 1;
  printf("a is %s\n", a >= 0 ? "positive" : "negative");
  printf("a has value %s\n", a == 0 ? "equal to zero" : "different from zero");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
lea    0xedb(%rip),%rsi
lea    0xecb(%rip),%rax
cmp    $0x0,%ecx
cmovge %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%ecx
lea    0xede(%rip),%rsi
lea    0xec9(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rsi
lea    0xeab(%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
lea    0xeea(%rip),%rsi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"a is %s\0A\00"
@.str.1 = [9 x i8] c"positive\00"
@.str.2 = [9 x i8] c"negative\00"
@.str.3 = [16 x i8] c"a has value %s\0A\00"
@.str.4 = [14 x i8] c"equal to zero\00"
@.str.5 = [20 x i8] c"different from zero\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"a is %s\0A\00"
@.str.1 = [9 x i8] c"positive\00"
@.str.3 = [16 x i8] c"a has value %s\0A\00"
@.str.5 = [20 x i8] c"different from zero\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}
void g_date_set_julian() {}


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

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

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

LLVM IR (-O2):
define void @g_date_set_julian() {
ret void
}
int snd_pcm_plug_slave_format(int format, struct snd_mask *format_mask) {
  return format;
}


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

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

LLVM IR (-O0):
%struct.snd_mask = type opaque
define i32 @snd_pcm_plug_slave_format(i32 %0, %struct.snd_mask* %1) {
%3 = alloca i32
%4 = alloca %struct.snd_mask*
store i32 %0, i32* %3
store %struct.snd_mask* %1, %struct.snd_mask** %4
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
%struct.snd_mask = type opaque
define i32 @snd_pcm_plug_slave_format(i32 returned %0, %struct.snd_mask* nocapture readnone %1) {
ret i32 %0
}
void Vector(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z,
            float *rx, float *ry, float *rz) {
  *rx = v1x - v2x;
  *ry = v1y - v2y;
  *rz = v1z - v2z;
}


x86 assembly (clang, -O0):
<Vector>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector>:
subss  %xmm3,%xmm0
movss  %xmm0,(%rdi)
subss  %xmm4,%xmm1
movss  %xmm1,(%rsi)
subss  %xmm5,%xmm2
movss  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define void @Vector(float %0, float %1, float %2, float %3, float %4, float %5, float* %6, float* %7, float* %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float*
%17 = alloca float*
%18 = alloca float*
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float* %6, float** %16
store float* %7, float** %17
store float* %8, float** %18
%19 = load float, float* %10
%20 = load float, float* %13
%21 = fsub float %19, %20
%22 = load float*, float** %16
store float %21, float* %22
%23 = load float, float* %11
%24 = load float, float* %14
%25 = fsub float %23, %24
%26 = load float*, float** %17
store float %25, float* %26
%27 = load float, float* %12
%28 = load float, float* %15
%29 = fsub float %27, %28
%30 = load float*, float** %18
store float %29, float* %30
ret void
}

LLVM IR (-O2):
define void @Vector(float %0, float %1, float %2, float %3, float %4, float %5, float* nocapture writeonly %6, float* nocapture writeonly %7, float* nocapture writeonly %8) {
%10 = fsub float %0, %3
store float %10, float* %6
%11 = fsub float %1, %4
store float %11, float* %7
%12 = fsub float %2, %5
store float %12, float* %8
ret void
}
int _open_PLX9080(unsigned int *BASEA, unsigned int *BASEB,
                  unsigned int *BASEB_phys, int *pci_handle,
                  unsigned int *mmap_io_ptr, int *interrupt_line, int print) {
  volatile unsigned char *BASE0, *BASE1;
  unsigned flags, lastbus, version, hardware, bus, device;
  int temp;
  unsigned pci_index = 0;
  unsigned int *mmap_ptr;
  return 1;
}


x86 assembly (clang, -O0):
<_open_PLX9080>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x60(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_open_PLX9080(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32 %6, i32* %14
store i32 0, i32* %24
ret i32 1
}

LLVM IR (-O2):
define i32 @_open_PLX9080(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture readnone %4, i32* nocapture readnone %5, i32 %6) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void main() {
  short int n;
  for (n = 3; n != 0; n--) {
    printf("n=%d", n--);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x3,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     115a <main+0x4a>
mov    -0x2(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x2(%rbp)
movswl %ax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
jmp    111e <main+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x3,%bx
lea    0xee1(%rip),%r14
nop
movswl %bx,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xfffe,%bx
jne    1120 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"n=%d\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i16 [ 3, %0 ], [ %5, %1 ]
%3 = sext i16 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add i16 %2, -2
%6 = icmp eq i16 %5, 0
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_fixture_one();
int /*<<< orphan*/ test_fixture_two();
void all_tests(void) {
  test_fixture_one();
  test_fixture_two();
}


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

x86 assembly (clang, -O2):
<all_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_fixture_one@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_fixture_two@plt>

LLVM IR (-O0):
define void @all_tests() {
%1 = call i32 (...) @test_fixture_one()
%2 = call i32 (...) @test_fixture_two()
ret void
}

LLVM IR (-O2):
define void @all_tests() {
%1 = tail call i32 (...) @test_fixture_one()
%2 = tail call i32 (...) @test_fixture_two()
ret void
}
void debugInit() {}


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

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

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

LLVM IR (-O2):
define void @debugInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a(int /*<<< orphan*/, int);
int /*<<< orphan*/ alloca(int);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int main() {
  a(strcpy(alloca(100), "abc"), 1234);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <alloca@plt>
mov    %eax,%edi
lea    0xeae(%rip),%rsi
call   1030 <strcpy@plt>
mov    %eax,%edi
mov    $0x4d2,%esi
call   1050 <a@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1040 <alloca@plt>
lea    0xebe(%rip),%rsi
mov    %eax,%edi
call   1030 <strcpy@plt>
mov    %eax,%edi
mov    $0x4d2,%esi
call   1050 <a@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alloca(i32 100)
%3 = call i32 @strcpy(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @a(i32 %3, i32 1234)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = tail call i32 @alloca(i32 100)
%2 = tail call i32 @strcpy(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @a(i32 %2, i32 1234)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char *test_string_one = "Gooseberries.";
  char *test_string_two = "Kiwis.";
  printf("%d", any(test_string_one, test_string_two));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Gooseberries.\00"
@.str.1 = [7 x i8] c"Kiwis.\00"
@.str.2 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @any(i8* %4, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [14 x i8] c"Gooseberries.\00"
@.str.1 = [7 x i8] c"Kiwis.\00"
@.str.2 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @any(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void goUp(int xyzk[]) {
  xyzk[0] >>= 1;
  xyzk[1] >>= 1;
  xyzk[2] >>= 1;
  xyzk[3] -= 1;
}


x86 assembly (clang, -O0):
<goUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
sar    $0x1,%ecx
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
sar    $0x1,%ecx
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<goUp>:
sarl   (%rdi)
sarl   0x4(%rdi)
sarl   0x8(%rdi)
addl   $0xffffffff,0xc(%rdi)
ret

LLVM IR (-O0):
define void @goUp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = ashr i32 %5, 1
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = ashr i32 %9, 1
store i32 %10, i32* %8
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = ashr i32 %13, 1
store i32 %14, i32* %12
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @goUp(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 1
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = ashr i32 %5, 1
store i32 %6, i32* %4
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = ashr i32 %8, 1
store i32 %9, i32* %7
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = add nsw i32 %11, -1
store i32 %12, i32* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
void kill_it(void) {
  char *command = "hdparm --direct -t /dev/sda";
  fclose(stdout);
  while (1) {
    system(command);
  }
}


x86 assembly (clang, -O0):
<kill_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rdi
call   1040 <system@plt>
jmp    1141 <kill_it+0x21>

x86 assembly (clang, -O2):
<kill_it>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
lea    0xeca(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <system@plt>
jmp    1140 <kill_it+0x20>

LLVM IR (-O0):
@.str = [28 x i8] c"hdparm --direct -t /dev/sda\00"
@stdout = global i32 0
define void @kill_it() {
%1 = alloca i8*
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stdout
%3 = call i32 @fclose(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = load i8*, i8** %1
%6 = call i32 @system(i8* %5)
br label %4
}

LLVM IR (-O2):
@.str = [28 x i8] c"hdparm --direct -t /dev/sda\00"
@stdout = global i32 0
define void @kill_it() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fclose(i32 %1)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %3
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int gxmessagePresent() {
  static int lGxmessagePresent = -1;
  if (lGxmessagePresent < 0) {
    lGxmessagePresent = detectPresence("gxmessage");
  }
  return lGxmessagePresent && graphicMode();
}


x86 assembly (clang, -O0):
<gxmessagePresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <gxmessagePresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <gxmessagePresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gxmessagePresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <gxmessagePresent+0x23>
test   %eax,%eax
je     1159 <gxmessagePresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <gxmessagePresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@gxmessagePresent.lGxmessagePresent = internal global i32 -1
@.str = [10 x i8] c"gxmessage\00"
define i32 @gxmessagePresent() {
%1 = load i32, i32* @gxmessagePresent.lGxmessagePresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @gxmessagePresent.lGxmessagePresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @gxmessagePresent.lGxmessagePresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@gxmessagePresent.lGxmessagePresent = internal unnamed_addr global i32 -1
@.str = [10 x i8] c"gxmessage\00"
define i32 @gxmessagePresent() {
%1 = load i32, i32* @gxmessagePresent.lGxmessagePresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @gxmessagePresent.lGxmessagePresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_server_new_ipv6() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_server_new_ipv6"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_socket_server_new_ipv6\0A\00"
define i32 @pa_socket_server_new_ipv6() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_socket_server_new_ipv6\00"
define i32 @pa_socket_server_new_ipv6() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glLineStipple(int, unsigned short);
void LineStipple(int f, unsigned short p) { glLineStipple(f, p); }


x86 assembly (clang, -O0):
<LineStipple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movzwl -0x6(%rbp),%esi
call   1030 <glLineStipple@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LineStipple>:
jmp    1030 <glLineStipple@plt>

LLVM IR (-O0):
define void @LineStipple(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
%7 = call i32 @glLineStipple(i32 %5, i16 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @LineStipple(i32 %0, i16 zeroext %1) {
%3 = tail call i32 @glLineStipple(i32 %0, i16 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stderr, "ERROR\n");
  fprintf(stdout, "OUT\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"ERROR\0A\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"OUT\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"ERROR\0A\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"OUT\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct dns_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct dns_packet *);
int /*<<< orphan*/ free(struct dns_packet *);
void dns_packet_free(struct dns_packet *p) {
  assert(p);
  free(p);
}


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

x86 assembly (clang, -O2):
<dns_packet_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.dns_packet = type { i32 }
define void @dns_packet_free(%struct.dns_packet* %0) {
%2 = alloca %struct.dns_packet*
store %struct.dns_packet* %0, %struct.dns_packet** %2
%3 = load %struct.dns_packet*, %struct.dns_packet** %2
%4 = call i32 @assert(%struct.dns_packet* %3)
%5 = load %struct.dns_packet*, %struct.dns_packet** %2
%6 = call i32 @free(%struct.dns_packet* %5)
ret void
}

LLVM IR (-O2):
%struct.dns_packet = type { i32 }
define void @dns_packet_free(%struct.dns_packet* %0) {
%2 = tail call i32 @assert(%struct.dns_packet* %0)
%3 = tail call i32 @free(%struct.dns_packet* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void RunEncryptionKeySchedule(uint8_t *key, uint8_t *roundKeys) {
  memcpy((void *)roundKeys, (void *)key, 16);
}


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

x86 assembly (clang, -O2):
<RunEncryptionKeySchedule>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @RunEncryptionKeySchedule(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 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %3
%8 = bitcast i32* %7 to i8*
%9 = call i32 @memcpy(i8* %6, i8* %8, i32 16)
ret void
}

LLVM IR (-O2):
define void @RunEncryptionKeySchedule(i32* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %0 to i8*
%5 = tail call i32 @memcpy(i8* %3, i8* %4, i32 16)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glTexParameteriv(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/ *);
void TexParameteriv(GLenum target, GLenum pname, GLint *params) {
  glTexParameteriv(target, pname, params);
}


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

x86 assembly (clang, -O2):
<TexParameteriv>:
jmp    1030 <glTexParameteriv@plt>

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

LLVM IR (-O2):
define void @TexParameteriv(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @glTexParameteriv(i32 %0, i32 %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reboot();
int _reboot_handler(int argc, char **argv) {
  (void)argc;
  (void)argv;
  reboot();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @_reboot_handler(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 (...) @reboot()
ret i32 0
}

LLVM IR (-O2):
define i32 @_reboot_handler(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @reboot()
ret i32 0
}
void EC_POINT_set_compressed_coordinates_GFp(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_set_compressed_coordinates_GFp() {
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del(struct list_head *);
int /*<<< orphan*/ list_add_tail(struct list_head *, struct list_head *);
void list_move_tail(struct list_head *entry, struct list_head *head) {
  __list_del(entry);
  list_add_tail(entry, head);
}


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

x86 assembly (clang, -O2):
<list_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__list_del@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add_tail@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @__list_del(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add_tail(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del(%struct.list_head* %0)
%4 = tail call i32 @list_add_tail(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbEnd(char *, char const *);
void UnknownOption(const char *Opt) { AbEnd("Unknown option: %s", Opt); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Unknown option: %s\00"
define void @UnknownOption(i8* %0) {
%2 = tail call i32 @AbEnd(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ network_init();
int module_init() {
  network_init();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @module_init() {
%1 = call i32 (...) @network_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @module_init() {
%1 = tail call i32 (...) @network_init()
ret i32 0
}