xunge/DecIR huggingface dataset:
/* Type definitions */
struct ADrawTag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int, scalar_t__,
                           unsigned int, scalar_t__);
int /*<<< orphan*/ getPsFile(struct ADrawTag *);
void PsLine(struct ADrawTag *ctx, unsigned int x1, unsigned int y1,
            unsigned int x2, unsigned int y2) {
  fprintf(getPsFile(ctx), "newpath %d %d moveto %d %d lineto stroke\n", x1,
          0 - y1, x2, 0 - y2);
}


x86 assembly (clang, -O0):
<PsLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getPsFile@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,%eax
mov    %eax,%r9d
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PsLine>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
call   1040 <getPsFile@plt>
neg    %ebp
neg    %ebx
lea    0xebe(%rip),%rsi
mov    %eax,%edi
mov    %r15d,%edx
mov    %rbp,%rcx
mov    %r14d,%r8d
mov    %rbx,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
@.str = [42 x i8] c"newpath %d %d moveto %d %d lineto stroke\0A\00"
define void @PsLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.ADrawTag*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%12 = call i32 @getPsFile(%struct.ADrawTag* %11)
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = sub i32 0, %14
%16 = zext i32 %15 to i64
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = sub i32 0, %18
%20 = zext i32 %19 to i64
%21 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %13, i64 %16, i32 %17, i64 %20)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@.str = [42 x i8] c"newpath %d %d moveto %d %d lineto stroke\0A\00"
define void @PsLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @getPsFile(%struct.ADrawTag* %0)
%7 = sub i32 0, %2
%8 = zext i32 %7 to i64
%9 = sub i32 0, %4
%10 = zext i32 %9 to i64
%11 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1, i64 %8, i32 %3, i64 %10)
ret void
}
void foo617() {}


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

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

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

LLVM IR (-O2):
define void @foo617() {
ret void
}
void gtk_widget_destroy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_destroy() {
ret void
}
void eth_gpio_config(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ balance_dirty_pages_ratelimited_nr(struct address_space *,
                                                      int);
void balance_dirty_pages_ratelimited(struct address_space *mapping) {
  balance_dirty_pages_ratelimited_nr(mapping, 1);
}


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

x86 assembly (clang, -O2):
<balance_dirty_pages_ratelimited>:
mov    $0x1,%esi
jmp    1030 <balance_dirty_pages_ratelimited_nr@plt>

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

LLVM IR (-O2):
%struct.address_space = type { i32 }
define void @balance_dirty_pages_ratelimited(%struct.address_space* %0) {
%2 = tail call i32 @balance_dirty_pages_ratelimited_nr(%struct.address_space* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_44(int /*<<< orphan*/);
int gen_44(void) {
  handle_44(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_44>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_44@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_44() {
%1 = call i32 @handle_44(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_44() {
%1 = tail call i32 @handle_44(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglBeginFragmentShaderATI();
void _Lazy_glBeginFragmentShaderATI(void) {
  if (GLeeInit())
    pglBeginFragmentShaderATI();
}


x86 assembly (clang, -O0):
<_Lazy_glBeginFragmentShaderATI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glBeginFragmentShaderATI+0x1c>
mov    $0x0,%al
call   1040 <pglBeginFragmentShaderATI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glBeginFragmentShaderATI>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glBeginFragmentShaderATI+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglBeginFragmentShaderATI@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glBeginFragmentShaderATI() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglBeginFragmentShaderATI()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glBeginFragmentShaderATI() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglBeginFragmentShaderATI()
br label %5
5: ; preds = %3, %0
ret void
}
int calculaSomaDosDivisores(int i) {
  int j, soma = i;
  for (j = (int)i / 2; j > 0; j--) {
    if (i % j == 0) {
      soma += j;
    }
  }
  return soma;
}


x86 assembly (clang, -O0):
<calculaSomaDosDivisores>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1151 <calculaSomaDosDivisores+0x51>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    113e <calculaSomaDosDivisores+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <calculaSomaDosDivisores+0x43>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <calculaSomaDosDivisores+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculaSomaDosDivisores>:
cmp    $0x2,%edi
jl     112b <calculaSomaDosDivisores+0x2b>
mov    %edi,%esi
shr    %esi
mov    %edi,%ecx
jmp    111c <calculaSomaDosDivisores+0x1c>
nopl   (%rax)
add    %eax,%ecx
lea    -0x1(%rsi),%eax
cmp    $0x1,%esi
mov    %eax,%esi
jbe    112e <calculaSomaDosDivisores+0x2e>
mov    %edi,%eax
cltd
idiv   %esi
mov    %esi,%eax
test   %edx,%edx
je     1110 <calculaSomaDosDivisores+0x10>
xor    %eax,%eax
jmp    1110 <calculaSomaDosDivisores+0x10>
mov    %edi,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @calculaSomaDosDivisores(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ %0, %3 ]
%7 = phi i32 [ %12, %5 ], [ %4, %3 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 %7, i32 0
%11 = add nsw i32 %10, %6
%12 = add nsw i32 %7, -1
%13 = icmp ugt i32 %7, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %1
%15 = phi i32 [ %0, %1 ], [ %11, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("/usr/lib/jvm/java-7-sun/bin/javac ./Main.java 2>error.log");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"/usr/lib/jvm/java-7-sun/bin/javac ./Main.java 2>error.log\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"/usr/lib/jvm/java-7-sun/bin/javac ./Main.java 2>error.log\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct lock_file {
  int dummy;
};

/* Variables and functions */
int hold_lock_file_for_update_timeout(struct lock_file *, char const *, int,
                                      int /*<<< orphan*/);
int hold_lock_file_for_update(struct lock_file *lk, const char *path,
                              int flags) {
  return hold_lock_file_for_update_timeout(lk, path, flags, 0);
}


x86 assembly (clang, -O0):
<hold_lock_file_for_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <hold_lock_file_for_update_timeout@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hold_lock_file_for_update>:
xor    %ecx,%ecx
jmp    1030 <hold_lock_file_for_update_timeout@plt>

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

LLVM IR (-O2):
%struct.lock_file = type { i32 }
define i32 @hold_lock_file_for_update(%struct.lock_file* %0, i8* %1, i32 %2) {
%4 = tail call i32 @hold_lock_file_for_update_timeout(%struct.lock_file* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_mode_change_event_get_mode(const uint8_t *event) {
  return event[5];
}


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

x86 assembly (clang, -O2):
<hci_event_mode_change_event_get_mode>:
mov    0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_mode_change_event_get_mode(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_mode_change_event_get_mode(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *p) {
  if (p) {
    free(p);
  }
}


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

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

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void conshelp(void) {
  printf("Constants:\n\n    PI      3.14159265358979323846\n    E       "
         "2.71828182845904523536\n    GAMMA   0.57721566490153286060\n    DEG  "
         "   57.29577951308322087680\n    PHI     "
         "1.61803389974989484820\n\nValues:\n    0x...   Hex number\n    0y... "
         "  Binary number\n    0c...   Octal number\n    0o...   Octal "
         "number\n    ...     Decimal number\n\n");
}


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

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

LLVM IR (-O0):
@.str = [325 x i8] c"Constants:\0A\0A PI 3.14159265358979323846\0A E 2.71828182845904523536\0A GAMMA 0.57721566490153286060\0A DEG 57.29577951308322087680\0A PHI 1.61803389974989484820\0A\0AValues:\0A 0x... Hex number\0A 0y... Binary number\0A 0c... Octal number\0A 0o... Octal number\0A ... Decimal number\0A\0A\00"
define void @conshelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([325 x i8], [325 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [324 x i8] c"Constants:\0A\0A PI 3.14159265358979323846\0A E 2.71828182845904523536\0A GAMMA 0.57721566490153286060\0A DEG 57.29577951308322087680\0A PHI 1.61803389974989484820\0A\0AValues:\0A 0x... Hex number\0A 0y... Binary number\0A 0c... Octal number\0A 0o... Octal number\0A ... Decimal number\0A\00"
define void @conshelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([324 x i8], [324 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: snd2nes [OPTION...] FILE\n"
         "snd2nes converts sound files to NES DMC format.\n\n"
         "Options:\n\n"
         "  --note-delta=DELTA              Transponse note by DELTA\n"
         "  --hertz-delta=DELTA             Transponse base hertz by DELTA\n"
         "  --multi                         Create multiple samples\n"
         "  --output=FILE                   Store output in FILE\n"
         "  --verbose                       Print progress information to "
         "standard output\n"
         "  --help                          Give this help list\n"
         "  --usage                         Give a short usage message\n"
         "  --version                       Print program version\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [580 x i8] c"Usage: snd2nes [OPTION...] FILE\0Asnd2nes converts sound files to NES DMC format.\0A\0AOptions:\0A\0A --note-delta=DELTA Transponse note by DELTA\0A --hertz-delta=DELTA Transponse base hertz by DELTA\0A --multi Create multiple samples\0A --output=FILE Store output in FILE\0A --verbose Print progress information to standard output\0A --help Give this help list\0A --usage Give a short usage message\0A --version Print program version\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([580 x i8], [580 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [579 x i8] c"Usage: snd2nes [OPTION...] FILE\0Asnd2nes converts sound files to NES DMC format.\0A\0AOptions:\0A\0A --note-delta=DELTA Transponse note by DELTA\0A --hertz-delta=DELTA Transponse base hertz by DELTA\0A --multi Create multiple samples\0A --output=FILE Store output in FILE\0A --verbose Print progress information to standard output\0A --help Give this help list\0A --usage Give a short usage message\0A --version Print program version\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([579 x i8], [579 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void test_use_before_definition() {
  int i;
  printf("%d\n", i ?: 0);
}


x86 assembly (clang, -O0):
<test_use_before_definition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1132 <test_use_before_definition+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113c <test_use_before_definition+0x2c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <test_use_before_definition+0x2c>
mov    -0xc(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @test_use_before_definition() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
ret void
}
int main(argc, argv)
int argc;
char *argv[];
{ return flex_main(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @flex_main to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buff;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ One_Line(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
void One_File(FILE *f) {
  static char buff[4096];
  for (;;) {
    if (fgets(buff, sizeof(buff), f) == NULL)
      break;
    One_Line(buff);
  }
}


x86 assembly (clang, -O0):
<One_File>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f09(%rip),%rdi
mov    $0x1000,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    1150 <One_File+0x30>
jmp    1161 <One_File+0x41>
lea    0x2ee9(%rip),%rdi
call   1030 <One_Line@plt>
jmp    112c <One_File+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<One_File>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x2f12(%rip),%rdi
mov    $0x1000,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     116d <One_File+0x4d>
lea    0x2ef9(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <One_Line@plt>
mov    %rbx,%rdi
mov    $0x1000,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
jne    1150 <One_File+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@One_File.buff = internal global [4096 x i8] zeroinitializer
define void @One_File(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %8, %1
%4 = load i32*, i32** %2
%5 = call i32* @fgets(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @One_File.buff, i64 0, i64 0), i32 4096, i32* %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %3
br label %10
8: ; preds = %3
%9 = call i32 @One_Line(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @One_File.buff, i64 0, i64 0))
br label %3
10: ; preds = %7
ret void
}

LLVM IR (-O2):
@One_File.buff = internal global [4096 x i8] zeroinitializer
define void @One_File(i32* nocapture %0) {
%2 = tail call i32* @fgets(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @One_File.buff, i64 0, i64 0), i32 4096, i32* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 @One_Line(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @One_File.buff, i64 0, i64 0))
%6 = tail call i32* @fgets(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @One_File.buff, i64 0, i64 0), i32 4096, i32* %0)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int mm_free_pages_open();
int cc_mmclient_init(void) { return mm_free_pages_open(); }


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

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

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

LLVM IR (-O2):
define i32 @cc_mmclient_init() {
%1 = tail call i32 (...) @mm_free_pages_open()
ret i32 %1
}
void printnum(long n, void (*p)(char)) {
  if (n < 0) {
    (*p)('-');
    n = -n;
  }
  if (n >= 10)
    printnum(n / 10, p);
  (*p)((int)(n % 10) + '0');
}


x86 assembly (clang, -O0):
<printnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    113d <printnum+0x2d>
mov    $0x2d,%edi
call   *-0x10(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0xa,-0x8(%rbp)
jl     1162 <printnum+0x52>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <printnum@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
mov    %edx,%ecx
add    $0x30,%ecx
movsbl %cl,%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printnum>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jns    112d <printnum+0x1d>
mov    $0x2d,%edi
mov    %rsi,%r14
call   *%rsi
mov    %r14,%rsi
neg    %rbx
movabs $0xcccccccccccccccd,%r14
cc cc cc
cmp    $0xa,%rbx
jb     1155 <printnum+0x45>
mov    %rbx,%rax
mul    %r14
mov    %rdx,%rdi
shr    $0x3,%rdi
mov    %rsi,%r15
call   1030 <printnum@plt>
mov    %r15,%rsi
mov    %rbx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ebx
or     $0x30,%bl
movzbl %bl,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    *%rsi

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

LLVM IR (-O2):
define void @printnum(i64 %0, void (i8)* nocapture %1) {
%3 = icmp slt i64 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
tail call void %1(i8 signext 45)
%5 = sub nsw i64 0, %0
br label %6
6: ; preds = %4, %2
%7 = phi i64 [ %5, %4 ], [ %0, %2 ]
%8 = icmp ugt i64 %7, 9
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = udiv i64 %7, 10
tail call void @printnum(i64 %10, void (i8)* %1)
br label %11
11: ; preds = %9, %6
%12 = urem i64 %7, 10
%13 = trunc i64 %12 to i8
%14 = or i8 %13, 48
tail call void %1(i8 signext %14)
ret void
}
void *cast_away_const(const void *string) { return (void *)string; }


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

x86 assembly (clang, -O2):
<cast_away_const>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @cast_away_const(i8* readnone returned %0) {
ret i8* %0
}
void DMA1_Stream3_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Stream3_IRQHandler() {
ret void
}
char *cdio_get_default_device_win32(void) { return ((void *)0); }


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

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

LLVM IR (-O0):
define i8* @cdio_get_default_device_win32() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @cdio_get_default_device_win32() {
ret i8* null
}
void swapLong(unsigned long long int *x, unsigned long long int *y) {
  unsigned long long int temp = 0;
  temp = *x;
  *x = *y;
  *y = temp;
}


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

x86 assembly (clang, -O2):
<swapLong>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swapLong(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
store i64 %3, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ message(char *, int, int);
void opm_collision_advantage(int k_self, int k_other, float v2) {
  message("colliding advantage opm %d from %d\n", k_self, k_other);
}


x86 assembly (clang, -O0):
<opm_collision_advantage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed0(%rip),%rdi
call   1030 <message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opm_collision_advantage>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <message@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"colliding advantage opm %d from %d\0A\00"
define void @opm_collision_advantage(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @message(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"colliding advantage opm %d from %d\0A\00"
define void @opm_collision_advantage(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @message(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void _M2_wrapsock_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_M2_wrapsock_init() {
ret void
}
void ElSuiteSparse_tic(double tic[2]) {
  tic[0] = 0;
  tic[1] = 0;
}


x86 assembly (clang, -O0):
<ElSuiteSparse_tic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ElSuiteSparse_tic>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @ElSuiteSparse_tic(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double 0.000000e+00, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0.000000e+00, double* %6
ret void
}

LLVM IR (-O2):
define void @ElSuiteSparse_tic(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to i8*
ret void
}
/* Variables and functions */
int log10(int);
float tasa_de_transferencia(float sinr) {
  return 1 * log10(1 + sinr) / log10(2);
}


x86 assembly (clang, -O0):
<tasa_de_transferencia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <log10@plt>
shl    $0x0,%eax
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <log10@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tasa_de_transferencia>:
push   %rbx
addss  0xee7(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1030 <log10@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <log10@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @tasa_de_transferencia(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float 1.000000e+00, %3
%5 = fptosi float %4 to i32
%6 = call i32 @log10(i32 %5)
%7 = mul nsw i32 1, %6
%8 = call i32 @log10(i32 2)
%9 = sdiv i32 %7, %8
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @tasa_de_transferencia(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fptosi float %2 to i32
%4 = tail call i32 @log10(i32 %3)
%5 = tail call i32 @log10(i32 2)
%6 = sdiv i32 %4, %5
%7 = sitofp i32 %6 to float
ret float %7
}
int getr(int idx) { return (1 + (idx % 13) * 4); }


x86 assembly (clang, -O0):
<getr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
shl    $0x2,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getr>:
movslq %edi,%rax
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
lea    0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 13
%5 = mul nsw i32 %4, 4
%6 = add nsw i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @getr(i32 %0) {
%2 = srem i32 %0, 13
%3 = shl nsw i32 %2, 2
%4 = or i32 %3, 1
ret i32 %4
}
int linear(int a[10], int n, int who) {
  int lcv;
  for (lcv = 0; lcv < n; lcv++)
    if (who == a[lcv])
      return lcv;
  return (-1);
}


x86 assembly (clang, -O0):
<linear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <linear+0x53>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1140 <linear+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linear+0x5a>
jmp    1145 <linear+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linear+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linear+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linear+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linear+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linear(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void dump_ioctls(void) {}


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

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

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

LLVM IR (-O2):
define void @dump_ioctls() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmcau_md5_hash_n(unsigned int *, int, unsigned int *);
void mmcau_md5_hash(unsigned int msg_data[], unsigned int md_state[]) {
  mmcau_md5_hash_n(msg_data, 1, md_state);
}


x86 assembly (clang, -O0):
<mmcau_md5_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <mmcau_md5_hash_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcau_md5_hash>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <mmcau_md5_hash_n@plt>

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

LLVM IR (-O2):
define void @mmcau_md5_hash(i32* %0, i32* %1) {
%3 = tail call i32 @mmcau_md5_hash_n(i32* %0, i32 1, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ singleton_remove_lock();
int /*<<< orphan*/ singleton_set_lock();
extern void singleton_override_lock() {
  singleton_remove_lock();
  singleton_set_lock();
}


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

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

LLVM IR (-O0):
define void @singleton_override_lock() {
%1 = call i32 (...) @singleton_remove_lock()
%2 = call i32 (...) @singleton_set_lock()
ret void
}

LLVM IR (-O2):
define void @singleton_override_lock() {
%1 = tail call i32 (...) @singleton_remove_lock()
%2 = tail call i32 (...) @singleton_set_lock()
ret void
}
void gdk_screen_get_monitor_geometry() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_monitor_geometry() {
ret void
}
int fn(int q[]) { return 12; }


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

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

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

LLVM IR (-O2):
define i32 @fn(i32* nocapture readnone %0) {
ret i32 12
}
/* Type definitions */
struct i8x_xctx {
  int dummy;
};
struct i8x_object {
  int dummy;
};
struct i8x_ctx {
  int dummy;
};

/* Variables and functions */
struct i8x_ctx *i8x_ob_get_ctx(struct i8x_object *);
struct i8x_ctx *__attribute__((always_)) i8x_xctx_get_ctx(struct i8x_xctx *x) {
  return i8x_ob_get_ctx((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_xctx_get_ctx>:
jmp    1030 <i8x_ob_get_ctx@plt>

LLVM IR (-O0):
%struct.i8x_ctx = type { i32 }
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_xctx_get_ctx(%struct.i8x_xctx* %0) {
%2 = alloca %struct.i8x_xctx*
store %struct.i8x_xctx* %0, %struct.i8x_xctx** %2
%3 = load %struct.i8x_xctx*, %struct.i8x_xctx** %2
%4 = bitcast %struct.i8x_xctx* %3 to %struct.i8x_object*
%5 = call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %4)
ret %struct.i8x_ctx* %5
}

LLVM IR (-O2):
%struct.i8x_ctx = type { i32 }
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_xctx_get_ctx(%struct.i8x_xctx* %0) {
%2 = bitcast %struct.i8x_xctx* %0 to %struct.i8x_object*
%3 = tail call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %2)
ret %struct.i8x_ctx* %3
}
void TwmOutput(c) { putchar(c); }


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

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

LLVM IR (-O0):
define void @TwmOutput(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @TwmOutput(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_USR2(int /*<<< orphan*/);
int gen_USR2() { handle_USR2(0); }


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

x86 assembly (clang, -O2):
<gen_USR2>:
xor    %edi,%edi
jmp    1030 <handle_USR2@plt>

LLVM IR (-O0):
define i32 @gen_USR2() {
%1 = alloca i32
%2 = call i32 @handle_USR2(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_USR2() {
%1 = tail call i32 @handle_USR2(i32 0)
ret i32 undef
}
/* Variables and functions */
char *env_eol(char *);
int /*<<< orphan*/ printf(char *, char *);
char *env_invalid_eol(char *env) {
  char *eol = env_eol(env);
  char eol_old = *eol;
  *eol = '\0';
  printf("Invalid environment variable: %s\n", env);
  *eol = eol_old;
  return eol;
}


x86 assembly (clang, -O0):
<env_invalid_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <env_eol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_invalid_eol>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <env_eol@plt>
mov    %rax,%rbx
mov    (%rax),%bpl
movb   $0x0,(%rax)
lea    0xec4(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %bpl,(%rbx)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Invalid environment variable: %s\0A\00"
define i8* @env_invalid_eol(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @env_eol(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
store i8 0, i8* %9
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8, i8* %4
%13 = load i8*, i8** %3
store i8 %12, i8* %13
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [34 x i8] c"Invalid environment variable: %s\0A\00"
define i8* @env_invalid_eol(i8* %0) {
%2 = tail call i8* @env_eol(i8* %0)
%3 = load i8, i8* %2
store i8 0, i8* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
store i8 %3, i8* %2
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int hndl_fatal_err(char *msg) {
  perror((const char *)msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<hndl_fatal_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<hndl_fatal_err>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @hndl_fatal_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @hndl_fatal_err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int whatsup();
int getdownsup() { return whatsup(); }


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

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

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

LLVM IR (-O2):
define i32 @getdownsup() {
%1 = tail call i32 (...) @whatsup()
ret i32 %1
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t clamp16s(int x) {
  if (x < -32768)
    return -32768;
  if (x > 32767)
    return 32767;
  return x;
}


x86 assembly (clang, -O0):
<clamp16s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffff8000,-0x8(%rbp)
jge    1120 <clamp16s+0x20>
movl   $0xffff8000,-0x4(%rbp)
jmp    113f <clamp16s+0x3f>
cmpl   $0x7fff,-0x8(%rbp)
jle    1139 <clamp16s+0x39>
movl   $0x7fff,-0x4(%rbp)
jmp    113f <clamp16s+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp16s>:
cmp    $0x7fff,%edi
mov    $0x7fff,%ecx
cmovl  %edi,%ecx
cmp    $0xffff8001,%ecx
mov    $0xffff8000,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp16s(i32 %0) {
%2 = icmp slt i32 %0, 32767
%3 = select i1 %2, i32 %0, i32 32767
%4 = icmp sgt i32 %3, -32768
%5 = select i1 %4, i32 %3, i32 -32768
ret i32 %5
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int add_raw_data(struct buffer *, int, unsigned char *, int);
int add_chalresp_avp(struct buffer *buf, unsigned char *c, int len) {
  return add_raw_data(buf, 13, c, len);
}


x86 assembly (clang, -O0):
<add_chalresp_avp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xd,%esi
call   1030 <add_raw_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_chalresp_avp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xd,%esi
jmp    1030 <add_raw_data@plt>

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_chalresp_avp(%struct.buffer* %0, i8* %1, i32 %2) {
%4 = tail call i32 @add_raw_data(%struct.buffer* %0, i32 13, i8* %1, i32 %2)
ret i32 %4
}
void glutSetIconTitle(const char *title) {}


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

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

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

LLVM IR (-O2):
define void @glutSetIconTitle(i8* nocapture %0) {
ret void
}