xunge/DecIR huggingface dataset:
void h() {}


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

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

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

LLVM IR (-O2):
define void @h() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ getparyx(int /*<<< orphan*/ *, int, int);
void macro_getparyx(WINDOW *win, int *y, int *x) { getparyx(win, *y, *x); }


x86 assembly (clang, -O0):
<macro_getparyx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <getparyx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macro_getparyx>:
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <getparyx@plt>

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

LLVM IR (-O2):
define void @macro_getparyx(i32* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 @getparyx(i32* %0, i32 %4, i32 %5)
ret void
}
int called(int i, int j) { return i + j; }


x86 assembly (clang, -O0):
<called>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<called>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @called(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @called(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_irq6(void) { print("IRQ 6"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"IRQ 6\00"
define void @idt_irq6() {
%1 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"IRQ 6\00"
define void @idt_irq6() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int write(int, char *, size_t);
int dowrite(int fd, off_t offset, size_t count, char *buf) {
  int ret;
  ret = lseek(fd, offset, SEEK_SET);
  if (ret == -1)
    return ret;
  return write(fd, buf, count);
}


x86 assembly (clang, -O0):
<dowrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1162 <dowrite+0x42>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <dowrite+0x55>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dowrite>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
je     1150 <dowrite+0x30>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @dowrite(i32 %0, i32 %1, i64 %2, i8* nocapture %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @lseek(i32 %0, i32 %1, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @write(i32 %0, i8* %3, i64 %2)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
float xdivf(float d, int n) {
  if (*(int *)&d & 0x7FFFFFFF) {
    *(int *)&d -= n << 23;
  }
  return d;
}


x86 assembly (clang, -O0):
<xdivf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
cmp    $0x0,%eax
je     112b <xdivf+0x2b>
mov    -0x8(%rbp),%ecx
shl    $0x17,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdivf>:
movd   %xmm0,%eax
test   $0x7fffffff,%eax
je     1114 <xdivf+0x14>
shl    $0x17,%edi
sub    %edi,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @xdivf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = bitcast float* %3 to i32*
%6 = load i32, i32* %5
%7 = and i32 %6, 2147483647
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = shl i32 %10, 23
%12 = bitcast float* %3 to i32*
%13 = load i32, i32* %12
%14 = sub nsw i32 %13, %11
store i32 %14, i32* %12
br label %15
15: ; preds = %9, %2
%16 = load float, float* %3
ret float %16
}

LLVM IR (-O2):
define float @xdivf(float %0, i32 %1) {
%3 = bitcast float %0 to i32
%4 = and i32 %3, 2147483647
%5 = icmp eq i32 %4, 0
%6 = mul i32 %1, -8388608
%7 = add i32 %6, %3
%8 = bitcast i32 %7 to float
%9 = select i1 %5, float %0, float %8
ret float %9
}
/* Variables and functions */
size_t hash_function(const char *key) {
  size_t hash = 0;
  for (size_t i = 0; key[i] != '\0'; i++) {
    hash *= 31;
    hash += key[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <hash_function+0x5c>
imul   $0x1f,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <hash_function+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @hash_function(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i64 [ 0, %1 ], [ %12, %6 ]
ret i64 %5
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %2, %1 ]
%8 = phi i64 [ %13, %6 ], [ 0, %1 ]
%9 = phi i64 [ %12, %6 ], [ 0, %1 ]
%10 = mul i64 %9, 31
%11 = sext i8 %7 to i64
%12 = add i64 %10, %11
%13 = add i64 %8, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/ *);
void stoptimer(void) {
  alarm(0);
  signal(SIGALRM, NULL);
}


x86 assembly (clang, -O0):
<stoptimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <alarm@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoptimer>:
push   %rax
xor    %edi,%edi
call   1030 <alarm@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @stoptimer() {
%1 = call i32 @alarm(i32 0)
%2 = load i32, i32* @SIGALRM
%3 = call i32 @signal(i32 %2, i32* null)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @stoptimer() {
%1 = tail call i32 @alarm(i32 0)
%2 = load i32, i32* @SIGALRM
%3 = tail call i32 @signal(i32 %2, i32* null)
ret void
}
/* Variables and functions */
int rand();
int _randomInteger(int min, int max) { return min + rand() % (max - min + 1); }


x86 assembly (clang, -O0):
<_randomInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_randomInteger>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_randomInteger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_randomInteger(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int b();
int main(void) { return b(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @b()
ret i32 %1
}
/* Variables and functions */
int error(int, char *);
int b_nice(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return error(49, argv[0]);
}


x86 assembly (clang, -O0):
<b_nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_nice+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <b_nice+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_nice>:
cmp    $0x2,%edi
mov    (%rsi),%rsi
mov    $0x1,%eax
mov    $0x31,%edi
cmovge %eax,%edi
jmp    1030 <error@plt>

LLVM IR (-O0):
define i32 @b_nice(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 1, i8* %11)
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @error(i32 49, i8* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @b_nice(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = load i8*, i8** %1
%5 = select i1 %3, i32 1, i32 49
%6 = tail call i32 @error(i32 %5, i8* %4)
ret i32 %6
}
unsigned long unsignedlong_ignoring_signedlonglong(unsigned long x,
                                                   signed long long y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_signedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ nomem();
char *strdup(char const *);
char *sipStrdup(const char *s) {
  char *h;
  if ((h = strdup(s)) == NULL)
    nomem();
  return h;
}


x86 assembly (clang, -O0):
<sipStrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <sipStrdup+0x2a>
mov    $0x0,%al
call   1030 <nomem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sipStrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <sipStrdup+0x15>
xor    %eax,%eax
call   1030 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sipStrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @nomem()
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @sipStrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @nomem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
double xdiv(int, double);
double xpercent(double part, double whole) { return xdiv(100 * part, whole); }


x86 assembly (clang, -O0):
<xpercent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x10(%rbp),%xmm0
call   1030 <xdiv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpercent>:
mulsd  0xee8(%rip),%xmm0
cvttsd2si %xmm0,%edi
movaps %xmm1,%xmm0
jmp    1030 <xdiv@plt>

LLVM IR (-O0):
define double @xpercent(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double 1.000000e+02, %5
%7 = fptosi double %6 to i32
%8 = load double, double* %4
%9 = call double @xdiv(i32 %7, double %8)
ret double %9
}

LLVM IR (-O2):
define double @xpercent(double %0, double %1) {
%3 = fmul double %0, 1.000000e+02
%4 = fptosi double %3 to i32
%5 = tail call double @xdiv(i32 %4, double %1)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ s_print_region(char *);
void s_print_sudoku(char *sudoku) {
  for (char i = 0; i < 9; i++) {
    s_print_region(sudoku + (i * 9));
  }
}


x86 assembly (clang, -O0):
<s_print_sudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
jge    114f <s_print_sudoku+0x3f>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%eax
imul   $0x9,%eax,%eax
cltq
add    %rax,%rdi
call   1030 <s_print_region@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1120 <s_print_sudoku+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_print_sudoku>:
push   %rbx
mov    %rdi,%rbx
call   1030 <s_print_region@plt>
lea    0x9(%rbx),%rdi
call   1030 <s_print_region@plt>
lea    0x12(%rbx),%rdi
call   1030 <s_print_region@plt>
lea    0x1b(%rbx),%rdi
call   1030 <s_print_region@plt>
lea    0x24(%rbx),%rdi
call   1030 <s_print_region@plt>
lea    0x2d(%rbx),%rdi
call   1030 <s_print_region@plt>
lea    0x36(%rbx),%rdi
call   1030 <s_print_region@plt>
lea    0x3f(%rbx),%rdi
call   1030 <s_print_region@plt>
add    $0x48,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <s_print_region@plt>

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

LLVM IR (-O2):
define void @s_print_sudoku(i8* %0) {
%2 = tail call i32 @s_print_region(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 9
%4 = tail call i32 @s_print_region(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 18
%6 = tail call i32 @s_print_region(i8* %5)
%7 = getelementptr inbounds i8, i8* %0, i64 27
%8 = tail call i32 @s_print_region(i8* %7)
%9 = getelementptr inbounds i8, i8* %0, i64 36
%10 = tail call i32 @s_print_region(i8* %9)
%11 = getelementptr inbounds i8, i8* %0, i64 45
%12 = tail call i32 @s_print_region(i8* %11)
%13 = getelementptr inbounds i8, i8* %0, i64 54
%14 = tail call i32 @s_print_region(i8* %13)
%15 = getelementptr inbounds i8, i8* %0, i64 63
%16 = tail call i32 @s_print_region(i8* %15)
%17 = getelementptr inbounds i8, i8* %0, i64 72
%18 = tail call i32 @s_print_region(i8* %17)
ret void
}
void g2() {
#define Y 1
  int resync_parser_4;
}


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

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

LLVM IR (-O0):
define void @g2() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @g2() {
ret void
}
/* Variables and functions */
double M_PI;
double ephRadToDeg(double rad) { return rad * 180.0 / M_PI; }


x86 assembly (clang, -O0):
<ephRadToDeg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephRadToDeg>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @ephRadToDeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @ephRadToDeg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ print();
int main(int argc, char *argv[]) {
  print();
  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)
mov    $0x0,%al
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
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
%6 = call i32 (...) @print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @print()
ret i32 0
}
/* Variables and functions */
double get_double(int /*<<< orphan*/ *);
double GetDouble(void) { return get_double(NULL); }


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

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

LLVM IR (-O0):
define double @GetDouble() {
%1 = call double @get_double(i32* null)
ret double %1
}

LLVM IR (-O2):
define double @GetDouble() {
%1 = tail call double @get_double(i32* null)
ret double %1
}
int g(int y) { return y * 2; }


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

x86 assembly (clang, -O2):
<g>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
char *format_edit_selection_cmd(int *);
int /*<<< orphan*/ free(char *const);
int run_vim(char *const, int, int);
int vim_edit_selection(void) {
  int error = 1;
  int bg;
  char *const cmd = format_edit_selection_cmd(&bg);
  if (cmd != NULL) {
    error = run_vim(cmd, bg, 1);
    free(cmd);
  }
  return error;
}


x86 assembly (clang, -O0):
<vim_edit_selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <format_edit_selection_cmd@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1174 <vim_edit_selection+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1050 <run_vim@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vim_edit_selection>:
push   %rbp
push   %rbx
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <format_edit_selection_cmd@plt>
test   %rax,%rax
je     1162 <vim_edit_selection+0x32>
mov    %rax,%rbx
mov    0x4(%rsp),%esi
mov    %rax,%rdi
mov    $0x1,%edx
call   1050 <run_vim@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1167 <vim_edit_selection+0x37>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vim_edit_selection() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %1
%4 = call i8* @format_edit_selection_cmd(i32* %2)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i8*, i8** %3
%9 = load i32, i32* %2
%10 = call i32 @run_vim(i8* %8, i32 %9, i32 1)
store i32 %10, i32* %1
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %7, %0
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @vim_edit_selection() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8* @format_edit_selection_cmd(i32* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @run_vim(i8* %3, i32 %6, i32 1)
%8 = call i32 @free(i8* %3)
br label %9
9: ; preds = %5, %0
%10 = phi i32 [ %7, %5 ], [ 1, %0 ]
ret i32 %10
}
/* Variables and functions */
int Scl_ConGetOutLoad_(int /*<<< orphan*/, int);
int /*<<< orphan*/ Scl_ConReadMan();
int Scl_ConGetOutLoad(int i) { return Scl_ConGetOutLoad_(Scl_ConReadMan(), i); }


x86 assembly (clang, -O0):
<Scl_ConGetOutLoad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <Scl_ConGetOutLoad_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_ConGetOutLoad>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <Scl_ConGetOutLoad_@plt>

LLVM IR (-O0):
define i32 @Scl_ConGetOutLoad(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Scl_ConReadMan()
%4 = load i32, i32* %2
%5 = call i32 @Scl_ConGetOutLoad_(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Scl_ConGetOutLoad(i32 %0) {
%2 = tail call i32 (...) @Scl_ConReadMan()
%3 = tail call i32 @Scl_ConGetOutLoad_(i32 %2, i32 %0)
ret i32 %3
}
int i1eq(void *key1, void *key2) {
  return (((int *)key1)[0] == ((int *)key2)[0]);
}


x86 assembly (clang, -O0):
<i1eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i1eq>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @i1eq(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 = bitcast i8* %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @i1eq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
struct timeval d2tv(double t) {
  struct timeval tv;
  tv.tv_sec = t;
  tv.tv_usec = (t - tv.tv_sec) * 1e6;
  return tv;
}


x86 assembly (clang, -O0):
<d2tv>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2tv>:
movapd %xmm0,%xmm1
subsd  %xmm0,%xmm1
mulsd  0xef0(%rip),%xmm1
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define { double, double } @d2tv(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store double %4, double* %5
%6 = load double, double* %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load double, double* %7
%9 = fsub double %6, %8
%10 = fmul double %9, 1.000000e+06
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store double %10, double* %11
%12 = bitcast %struct.timeval* %2 to { double, double }*
%13 = load { double, double }, { double, double }* %12
ret { double, double } %13
}

LLVM IR (-O2):
define { double, double } @d2tv(double %0) {
%2 = fsub double %0, %0
%3 = fmul double %2, 1.000000e+06
%4 = insertvalue { double, double } poison, double %0, 0
%5 = insertvalue { double, double } %4, double %3, 1
ret { double, double } %5
}
void SDCard_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @SDCard_RestoreConfig() {
ret void
}
int main() {
  int i, sum, n = 5;
  int a[5] = {11, 22, 33, 44, 55};
  i = 0;
  sum = 0;
  while (i < n) {
    sum = sum + a[i];
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x10(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee2(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1167 <main+0x67>
mov    -0xc(%rbp),%eax
movslq -0x8(%rbp),%rcx
add    -0x30(%rbp,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x3f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 11, i32 22, i32 33, i32 44, i32 55]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [5 x i32]
store i32 0, i32* %1
store i32 5, i32* %4
%6 = bitcast [5 x i32]* %5 to i8*
store i32 0, i32* %2
store i32 0, i32* %3
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %12, %16
store i32 %17, i32* %3
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %7
20: ; preds = %7
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int initialize_common() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @initialize_common() {
ret i32 0
}
/* Variables and functions */
float poti(float, float);
float pot(float base, float expoente) { return poti(base, expoente); }


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

x86 assembly (clang, -O2):
<pot>:
jmp    1030 <poti@plt>

LLVM IR (-O0):
define float @pot(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @poti(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @pot(float %0, float %1) {
%3 = tail call float @poti(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *findspace(char *str) {
  while (*str && !isspace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<findspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <findspace+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <findspace+0x48>
jmp    1169 <findspace+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <findspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findspace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <findspace+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <findspace+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <findspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @findspace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @isspace(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @findspace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_multichar(char c, int num) {
  for (; num > 0; num--) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<print_multichar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1142 <print_multichar+0x32>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <print_multichar+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_multichar>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112f <print_multichar+0x1f>
mov    %esi,%ebx
add    $0x1,%ebx
movsbl %dil,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <print_multichar+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print_multichar(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %11, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8, i8* %3
%10 = call i32 @putchar(i8 signext %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @print_multichar(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LREP(char *, char *, char *);
int cli_app_uname_callback(int argc, char **argv, void *user) {
  LREP("\r\nSystem version 0.1 build %s %s", "14:29:24", "Mar 15 2022");
  return 0;
}


x86 assembly (clang, -O0):
<cli_app_uname_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
lea    0xef0(%rip),%rsi
lea    0xef2(%rip),%rdx
call   1030 <LREP@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_app_uname_callback>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf02(%rip),%rsi
lea    0xf04(%rip),%rdx
call   1030 <LREP@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0D\0ASystem version 0.1 build %s %s\00"
@.str.1 = [9 x i8] c"14:29:24\00"
@.str.2 = [12 x i8] c"Mar 15 2022\00"
define i32 @cli_app_uname_callback(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 = call i32 @LREP(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0D\0ASystem version 0.1 build %s %s\00"
@.str.1 = [9 x i8] c"14:29:24\00"
@.str.2 = [12 x i8] c"Mar 15 2022\00"
define i32 @cli_app_uname_callback(i32 %0, i8** nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @LREP(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void print_usage(const char *pname) {
  fprintf(stdout, "usage: %s -i in_file -o out_file\n", pname);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"usage: %s -i in_file -o out_file\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"usage: %s -i in_file -o out_file\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int compare_cycles(void const *, void const *);
int rs_rainflow_compare_descending(void const *left, void const *right) {
  return compare_cycles(right, left);
}


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

x86 assembly (clang, -O2):
<rs_rainflow_compare_descending>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <compare_cycles@plt>

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

LLVM IR (-O2):
define i32 @rs_rainflow_compare_descending(i8* %0, i8* %1) {
%3 = tail call i32 @compare_cycles(i8* %1, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("sort <filename> <K-ways>\n");
  printf("\tfilename: filename of file to be sorted\n");
  printf("\tK-ways: how many ways to merge\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"sort <filename> <K-ways>\0A\00"
@.str.1 = [42 x i8] c"\09filename: filename of file to be sorted\0A\00"
@.str.2 = [33 x i8] c"\09K-ways: how many ways to merge\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"sort <filename> <K-ways>\00"
@str.3 = [41 x i8] c"\09filename: filename of file to be sorted\00"
@str.4 = [32 x i8] c"\09K-ways: how many ways to merge\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void handler(int sig) {
  const char str[] = "got sigill\n";
  write(1, str, sizeof(str) - 1);
  (void)sig;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
mov    $0x1,%edi
mov    $0xb,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
sub    $0x18,%rsp
movabs $0x6967697320746f67,%rax
69 67 69
mov    %rax,0x8(%rsp)
movl   $0xa6c6c,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0xb,%edx
call   1030 <write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.handler.str = [12 x i8] c"got sigill\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
store i32 %0, i32* %2
%4 = bitcast [12 x i8]* %3 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = call i32 @write(i32 1, i8* %5, i32 11)
%7 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
@__const.handler.str = [12 x i8] c"got sigill\0A\00"
define void @handler(i32 %0) {
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 @write(i32 1, i8* %3, i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void writeFloat(float f) { printf("%f", f); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @writeFloat(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
void GLCD_ScrollVertical(unsigned int dy) {}


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

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

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

LLVM IR (-O2):
define void @GLCD_ScrollVertical(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int main(int c, char **v) { foo(atoi(v[1])); }


x86 assembly (clang, -O0):
<main>:
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   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(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 @foo(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(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 @foo(i32 %5)
ret i32 0
}
void authdummy() {}


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

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

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

LLVM IR (-O2):
define void @authdummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_parport_close();
int /*<<< orphan*/ drv_generic_serial_close();
int drv_Sample_close(void) {
  drv_generic_parport_close();
  drv_generic_serial_close();
  return 0;
}


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

x86 assembly (clang, -O2):
<drv_Sample_close>:
push   %rax
xor    %eax,%eax
call   1030 <drv_generic_parport_close@plt>
xor    %eax,%eax
call   1040 <drv_generic_serial_close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @drv_Sample_close() {
%1 = call i32 (...) @drv_generic_parport_close()
%2 = call i32 (...) @drv_generic_serial_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @drv_Sample_close() {
%1 = tail call i32 (...) @drv_generic_parport_close()
%2 = tail call i32 (...) @drv_generic_serial_close()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void alarm_ha(int sig) {
  static int count = 0;
  printf("alarm  har %03d\n", count++);
  alarm(5);
}


x86 assembly (clang, -O0):
<alarm_ha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f03(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2ef8(%rip)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarm_ha>:
push   %rax
mov    0x2f0d(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2f04(%rip)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@alarm_ha.count = internal global i32 0
@.str = [17 x i8] c"alarm har %03d\0A\00"
define void @alarm_ha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @alarm_ha.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @alarm_ha.count
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i32 @alarm(i32 5)
ret void
}

LLVM IR (-O2):
@alarm_ha.count = internal unnamed_addr global i32 0
@.str = [17 x i8] c"alarm har %03d\0A\00"
define void @alarm_ha(i32 %0) {
%2 = load i32, i32* @alarm_ha.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @alarm_ha.count
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @alarm(i32 5)
ret void
}
int warningInHeader() {}


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

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

LLVM IR (-O0):
define i32 @warningInHeader() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @warningInHeader() {
ret i32 undef
}