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

/* Variables and functions */
int /*<<< orphan*/ get_program_name(char *, int);
int /*<<< orphan*/ my_system(char *, char *, char const *);
void disassemble_function(const char *function_name) {
  char myname[1024];
  get_program_name(myname, sizeof(myname));
  my_system(
      "objdump --disassemble --source %s | sed -n '/<.*%s.*>:/,/<.*>:/p\'",
      myname, function_name);
}


x86 assembly (clang, -O0):
<disassemble_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1040 <get_program_name@plt>
lea    -0x410(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xeae(%rip),%rdi
call   1030 <my_system@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disassemble_function>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1040 <get_program_name@plt>
lea    0xebc(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <my_system@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [66 x i8] c"objdump --disassemble --source %s | sed -n '/<.*%s.*>:/,/<.*>:/p'\00"
define void @disassemble_function(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @get_program_name(i8* %4, i32 1024)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @my_system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"objdump --disassemble --source %s | sed -n '/<.*%s.*>:/,/<.*>:/p'\00"
define void @disassemble_function(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_program_name(i8* %3, i32 1024)
%5 = call i32 @my_system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(int a, int b) {
  if (b != 1)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     112f <bar+0x1f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x1,%esi
jne    1116 <bar+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int f219(int *);
int f220(int *p) { return f219(p); }


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

x86 assembly (clang, -O2):
<f220>:
jmp    1030 <f219@plt>

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

LLVM IR (-O2):
define i32 @f220(i32* %0) {
%2 = tail call i32 @f219(i32* %0)
ret i32 %2
}
unsigned long rDB_hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<rDB_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <rDB_hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <rDB_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rDB_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <rDB_hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <rDB_hash+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @rDB_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 5381, i64* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %5
%12 = load i64, i64* %3
%13 = shl i64 %12, 5
%14 = load i64, i64* %3
%15 = add i64 %13, %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = add i64 %15, %17
store i64 %18, i64* %3
br label %5
19: ; preds = %5
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @rDB_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid(unsigned int *, unsigned int *, unsigned int *,
                           unsigned int *);
int xsave_enabled(void) {
  unsigned int eax, ebx, ecx, edx;
  eax = 0x1;
  ecx = 0x0;
  __cpuid(&eax, &ebx, &ecx, &edx);
  return ecx & (1U << 27);
}


x86 assembly (clang, -O0):
<xsave_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <__cpuid@plt>
mov    -0xc(%rbp),%eax
and    $0x8000000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsave_enabled>:
sub    $0x18,%rsp
movl   $0x1,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <__cpuid@plt>
mov    $0x8000000,%eax
and    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @xsave_enabled() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %3
%5 = call i32 @__cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %3
%7 = and i32 %6, 134217728
ret i32 %7
}

LLVM IR (-O2):
define i32 @xsave_enabled() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 1, i32* %1
store i32 0, i32* %3
%9 = call i32 @__cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = and i32 %10, 134217728
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ rcu_note_context_switch();
void rcu_virt_note_context_switch(int cpu) { rcu_note_context_switch(); }


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

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

LLVM IR (-O0):
define void @rcu_virt_note_context_switch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rcu_note_context_switch()
ret void
}

LLVM IR (-O2):
define void @rcu_virt_note_context_switch(i32 %0) {
%2 = tail call i32 (...) @rcu_note_context_switch()
ret void
}
/* Variables and functions */
int foo();
int a() { return foo(); }


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

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

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

LLVM IR (-O2):
define i32 @a() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
void AnalogConversionStop(void) {}


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

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

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

LLVM IR (-O2):
define void @AnalogConversionStop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *, ...);
void R_ScreenshotFilename(int lastNumber, char *fileName) {
  if (lastNumber < 0 || lastNumber > 9999) {
    Com_sprintf(fileName, 256, "screenshots/shot9999.tga");
    return;
  }
  Com_sprintf(fileName, 256, "screenshots/shot%04i.tga", lastNumber);
}


x86 assembly (clang, -O0):
<R_ScreenshotFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1136 <R_ScreenshotFilename+0x26>
cmpl   $0x270f,-0x4(%rbp)
jle    1152 <R_ScreenshotFilename+0x42>
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
jmp    116c <R_ScreenshotFilename+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xeb4(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_ScreenshotFilename>:
cmp    $0x2710,%edi
jb     112e <R_ScreenshotFilename+0x1e>
lea    0xee1(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>
mov    %edi,%ecx
lea    0xee2(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"screenshots/shot9999.tga\00"
@.str.1 = [25 x i8] c"screenshots/shot%04i.tga\00"
define void @R_ScreenshotFilename(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 9999
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %11, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %17
13: ; preds = %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %3
%16 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %14, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"screenshots/shot9999.tga\00"
@.str.1 = [25 x i8] c"screenshots/shot%04i.tga\00"
define void @R_ScreenshotFilename(i32 %0, i8* %1) {
%3 = icmp ugt i32 %0, 9999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
int utf8_unichar_valid_range(int unichar) {
  if (unichar > 0x10ffff)
    return 0;
  if ((unichar & 0xfffff800) == 0xd800)
    return 0;
  if ((unichar > 0xfdcf) && (unichar < 0xfdf0))
    return 0;
  if ((unichar & 0xffff) == 0xffff)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<utf8_unichar_valid_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x10ffff,-0x8(%rbp)
jle    1120 <utf8_unichar_valid_range+0x20>
movl   $0x0,-0x4(%rbp)
jmp    118b <utf8_unichar_valid_range+0x8b>
mov    -0x8(%rbp),%eax
and    $0xfffff800,%eax
cmp    $0xd800,%eax
jne    113f <utf8_unichar_valid_range+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    118b <utf8_unichar_valid_range+0x8b>
cmpl   $0xfdcf,-0x8(%rbp)
jle    1165 <utf8_unichar_valid_range+0x65>
cmpl   $0xfdf0,-0x8(%rbp)
jge    1165 <utf8_unichar_valid_range+0x65>
movl   $0x0,-0x4(%rbp)
jmp    118b <utf8_unichar_valid_range+0x8b>
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
cmp    $0xffff,%eax
jne    1184 <utf8_unichar_valid_range+0x84>
movl   $0x0,-0x4(%rbp)
jmp    118b <utf8_unichar_valid_range+0x8b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_unichar_valid_range>:
cmp    $0x110000,%edi
setl   %al
mov    %edi,%ecx
and    $0xfffff800,%ecx
cmp    $0xd800,%ecx
setne  %cl
and    %al,%cl
lea    -0xfdd0(%rdi),%eax
cmp    $0x20,%eax
setae  %al
cmp    $0xffff,%di
setne  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @utf8_unichar_valid_range(i32 %0) {
%2 = icmp sgt i32 %0, 1114111
%3 = and i32 %0, -2048
%4 = icmp eq i32 %3, 55296
%5 = or i1 %2, %4
%6 = add i32 %0, -64976
%7 = icmp ult i32 %6, 32
%8 = or i1 %7, %5
%9 = and i32 %0, 65535
%10 = icmp ne i32 %9, 65535
%11 = xor i1 %8, true
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
int ysocket_pull(int socketfd, char *data, int len) {
  int readlen = (int)read(socketfd, data, len);
  return readlen;
}


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

x86 assembly (clang, -O2):
<ysocket_pull>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @ysocket_pull(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ agindex(void *, char *);
char *agxget(void *, int /*<<< orphan*/);
char *agget(void *obj, char *attr) { return agxget(obj, agindex(obj, attr)); }


x86 assembly (clang, -O0):
<agget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <agindex@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <agxget@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agget>:
push   %rbx
mov    %rdi,%rbx
call   1040 <agindex@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <agxget@plt>

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

LLVM IR (-O2):
define i8* @agget(i8* %0, i8* %1) {
%3 = tail call i32 @agindex(i8* %0, i8* %1)
%4 = tail call i8* @agxget(i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ usDelay(int);
void msDelay(int delay) {
  while (delay--) {
    usDelay(1030);
  }
}


x86 assembly (clang, -O0):
<msDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <msDelay+0x2e>
mov    $0x406,%edi
call   1030 <usDelay@plt>
jmp    111b <msDelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msDelay>:
push   %rbx
test   %edi,%edi
je     112f <msDelay+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x406,%edi
call   1030 <usDelay@plt>
add    $0xffffffff,%ebx
jne    1120 <msDelay+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @msDelay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @usDelay(i32 1030)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void glCompressedTexSubImage3D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glCompressedTexSubImage3D() {
ret void
}
/* Variables and functions */
scalar_t__ md2_test();
int /*<<< orphan*/ printf(char *, char *);
int main() { printf("MD2 tests: %s\n", md2_test() ? "SUCCEEDED" : "FAILED"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <md2_test@plt>
mov    %rax,%rcx
lea    0xee4(%rip),%rsi
lea    0xed3(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <md2_test@plt>
test   %rax,%rax
lea    0xee7(%rip),%rax
lea    0xed6(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"MD2 tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = call i64 (...) @md2_test()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"MD2 tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = tail call i64 (...) @md2_test()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetWMClientMachine() {
  printf("XSetWMClientMachine called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"XSetWMClientMachine called\0A\00"
define i32 @XSetWMClientMachine() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @XGetOCValues() {
ret void
}
char transition(char ch) {
  switch (ch) {
  case 'A':
    ch = 'G';
    break;
  case 'T':
    ch = 'C';
    break;
  case 'C':
    ch = 'T';
    break;
  case 'G':
    ch = 'A';
    break;
  }
  return ch;
}


x86 assembly (clang, -O0):
<transition>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1153 <transition+0x53>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x47,-0x1(%rbp)
jmp    1153 <transition+0x53>
movb   $0x43,-0x1(%rbp)
jmp    1153 <transition+0x53>
movb   $0x54,-0x1(%rbp)
jmp    1153 <transition+0x53>
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transition>:
mov    %edi,%eax
mov    %edi,%ecx
add    $0xffffffbf,%ecx
cmp    $0x13,%ecx
ja     1124 <transition+0x24>
lea    0xeed(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x47,%al
ret
mov    $0x54,%al
ret
mov    $0x41,%al
ret
mov    $0x43,%al
ret

LLVM IR (-O0):
define signext i8 @transition(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 65, label %5
i32 84, label %6
i32 67, label %7
i32 71, label %8
]
5: ; preds = %1
store i8 71, i8* %2
br label %9
6: ; preds = %1
store i8 67, i8* %2
br label %9
7: ; preds = %1
store i8 84, i8* %2
br label %9
8: ; preds = %1
store i8 65, i8* %2
br label %9
9: ; preds = %1, %8, %7, %6, %5
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @transition(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 65, label %3
i32 84, label %4
i32 67, label %5
i32 71, label %6
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i8 [ %0, %1 ], [ 65, %6 ], [ 84, %5 ], [ 67, %4 ], [ 71, %3 ]
ret i8 %8
}
int hello(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @hello() {
ret i32 1
}

LLVM IR (-O2):
define i32 @hello() {
ret i32 1
}
/* Variables and functions */
void fb_ConsolePrintBufferEx(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
void fb_ConsolePrintBuffer(const char *buffer, int mask) {
  return fb_ConsolePrintBufferEx(buffer, strlen(buffer), mask);
}


x86 assembly (clang, -O0):
<fb_ConsolePrintBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <fb_ConsolePrintBufferEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_ConsolePrintBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fb_ConsolePrintBufferEx@plt>

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

LLVM IR (-O2):
define void @fb_ConsolePrintBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
tail call void @fb_ConsolePrintBufferEx(i8* %0, i32 %3, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *wcscpy(wchar_t *restrict d, const wchar_t *restrict s) {
  wchar_t *a = d;
  while ((*d++ = *s++))
    ;
  return a;
}


x86 assembly (clang, -O0):
<wcscpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     1144 <wcscpy+0x44>
jmp    1114 <wcscpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsi,%rcx,1),%edx
mov    %edx,(%rax,%rcx,1)
add    $0x4,%rcx
test   %edx,%edx
jne    1110 <wcscpy+0x10>
ret

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

LLVM IR (-O2):
define i32* @wcscpy(i32* noalias returned writeonly %0, i32* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %1, %2 ], [ %6, %3 ]
%5 = phi i32* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %4
%8 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %7, i32* %5
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32* %0
}
void prompt(n, f, s) int n;
char *f, *s;
{
  (void)move(21 + n, 0);
  (void)clrtoeol();
  (void)printw(f, s);
  (void)refresh();
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    $0x15,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1060 <move@plt>
mov    $0x0,%al
call   1050 <clrtoeol@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
add    $0x15,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <move@plt>
xor    %eax,%eax
call   1050 <clrtoeol@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @prompt(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = add nsw i32 21, %7
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %8, i32 0)
%10 = call i32 (...) @clrtoeol()
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, i8*, ...)*)(i8* %11, i8* %12)
%14 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @prompt(i32 %0, i8* %1, i8* %2) {
%4 = add nsw i32 %0, 21
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %4, i32 0)
%6 = tail call i32 (...) @clrtoeol()
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, i8*, ...)*)(i8* %1, i8* %2)
%8 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or "
         "MBEDLTS_MD_C and/or "
         "MBEDTLS_SHA256_C and/or MBEDTLS_FS_IO not defined.\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [116 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or MBEDLTS_MD_C and/or MBEDTLS_SHA256_C and/or MBEDTLS_FS_IO not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([116 x i8], [116 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};
typedef long long int64_t;

/* Variables and functions */
int64_t timespec_to_us(struct timespec ts) {
  int64_t t;
  t = ts.tv_sec * 1000000LL;
  t += ts.tv_nsec / 1000LL;
  return t;
}


x86 assembly (clang, -O0):
<timespec_to_us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_us>:
mov    %rsi,%rax
imul   $0xf4240,%rdi,%rcx
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_us(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca i64
%5 = bitcast %struct.timespec* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%9 = load i64, i64* %8
%10 = mul nsw i64 %9, 1000000
store i64 %10, i64* %4
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = sdiv i64 %12, 1000
%14 = load i64, i64* %4
%15 = add nsw i64 %14, %13
store i64 %15, i64* %4
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
define i64 @timespec_to_us(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 1000000
%4 = sdiv i64 %1, 1000
%5 = add nsw i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int t = 1;
  printf("main; -enter\n");
  if (t == 1) {
    printf("t==1; \n");
  } else {
    printf("t!=1; \n");
  }
  printf("main; -exit\n");
  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)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1154 <main+0x44>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x50>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%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
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"main; -enter\0A\00"
@.str.1 = [8 x i8] c"t==1; \0A\00"
@.str.2 = [8 x i8] c"t!=1; \0A\00"
@.str.3 = [13 x i8] c"main; -exit\0A\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 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"main; -enter\00"
@str.4 = [7 x i8] c"t==1; \00"
@str.5 = [12 x i8] c"main; -exit\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
__attribute__((target("avx,sse4.2"))) void foo_multi(int i, double d) {}


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

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

LLVM IR (-O0):
define void @foo_multi(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @foo_multi(i32 %0, double %1) {
ret void
}
void spca561_stop0(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @spca561_stop0(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int close(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void cmd_close(int argc, char *argv[]) {
  if (close(atoi(argv[1])) == -1)
    perror("close");
}


x86 assembly (clang, -O0):
<cmd_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1168 <cmd_close+0x38>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_close>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     1148 <cmd_close+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"close\00"
define void @cmd_close(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @atoi(i8* %7)
%9 = call i32 @close(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define void @cmd_close(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @close(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}
/* Variables and functions */
int fun(int *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a[10] = {3, 5, 6, 7, 8, 2, 1, 4, 9, 10}, n;
  scanf("%d", &n);
  printf("%d", fun(a, n));
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    0xead(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1070 <scanf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1030 <fun@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 3, i32 5, i32 6, i32 7, i32 8, i32 2, i32 1, i32 4, i32 9, i32 10]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @fun(i32* %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @getchar()
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 3, i32 5, i32 6, i32 7, i32 8, i32 2, i32 1, i32 4, i32 9, i32 10]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @fun(i32* %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @getchar()
%11 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ICPrint();
int main(int argc, const char *argv[]) {
  return 0;
  ICPrint();
  return 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void pcp_def_disk_metrics(struct activity *a) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_def_disk_metrics(%struct.activity* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ ft_putstr_fd(char *, int);
char *ft_strjoin(char const *, char *);
void ft_putendl_fd(char const *s, int fd) {
  char *tmp;
  tmp = ft_strjoin(s, "\n");
  ft_putstr_fd(tmp, fd);
  free(tmp);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <ft_strjoin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <ft_putstr_fd@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0xec4(%rip),%rsi
call   1040 <ft_strjoin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ft_putstr_fd@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @ft_strjoin(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call i32 @ft_putstr_fd(i8* %8, i32 %9)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = tail call i8* @ft_strjoin(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @ft_putstr_fd(i8* %3, i32 %1)
%5 = tail call i32 @free(i8* %3)
ret void
}
int $Sub$$_sys_read(unsigned int fh, unsigned char *buf, unsigned int len,
                    int mode) {
  return len;
}


x86 assembly (clang, -O0):
<$Sub$$_sys_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @"$Sub$$_sys_read"(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
ret i32 %9
}

LLVM IR (-O2):
define i32 @"$Sub$$_sys_read"(i32 %0, i8* nocapture readnone %1, i32 returned %2, i32 %3) {
ret i32 %2
}
/* Variables and functions */
int PAPI_flops(float *, float *, long long *, float *);
void papif_flops_(float *real_time, float *proc_time, long long *flpops,
                  float *mflops, int *check) {
  *check = PAPI_flops(real_time, proc_time, flpops, mflops);
}


x86 assembly (clang, -O0):
<papif_flops_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_flops@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_flops_>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_flops@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_flops_(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_flops(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_flops_(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_flops(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void assert(char *msg) { printf("%s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @assert(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, world!");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void plan(int num) { printf("1..%d\n", num); }


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

x86 assembly (clang, -O2):
<plan>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"1..%d\0A\00"
define void @plan(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int initMemcache() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @initMemcache() {
ret i32 0
}