xunge/DecIR huggingface dataset:
/* Variables and functions */
int getline();
main() {
  int len;
  int max;
  char line[10];
  char longest[10];
  max = 0;
  while ((len = getline()) > 0)
    if (len > max) {
      max = len;
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1150 <main+0x40>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114b <main+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getline@plt>
test   %eax,%eax
jg     1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %15, %0
%7 = call i32 (...) @getline()
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* %2
store i32 %14, i32* %3
br label %15
15: ; preds = %13, %9
br label %6
16: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getline()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0, %3
%4 = tail call i32 (...) @getline()
%5 = icmp sgt i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__attribute__((always_)) __u32 safe_extract_port(__u32 port) {
  return (port >> 16) | (port & 0xffff);
}


x86 assembly (clang, -O0):
<safe_extract_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_extract_port>:
movzwl %di,%eax
sar    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @safe_extract_port(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @safe_extract_port(i32 %0) {
%2 = ashr i32 %0, 16
%3 = and i32 %0, 65535
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_usage() {
  puts("brightness-control # to print brightness");
  puts("brightness-control [+-]?(0-100) # to set brightness");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"brightness-control # to print brightness\00"
@.str.1 = [52 x i8] c"brightness-control [+-]?(0-100) # to set brightness\00"
define void @print_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"brightness-control # to print brightness\00"
@.str.1 = [52 x i8] c"brightness-control [+-]?(0-100) # to set brightness\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutSwapBuffers();
void argSwapBuffers(void) { glutSwapBuffers(); }


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

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

LLVM IR (-O0):
define void @argSwapBuffers() {
%1 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
define void @argSwapBuffers() {
%1 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ say_bye();
int main() {
  printf("Hello World\n");
  say_bye();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @say_bye()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @say_bye()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
fn(double x) {
  double y;
  y = x;
  printf("y=%f\n", y);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"y=%f\0A\00"
define i32 @fn(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
store double %5, double* %4
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"y=%f\0A\00"
define i32 @fn(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %0)
ret i32 undef
}
int foo20() { return 20; }


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

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

LLVM IR (-O0):
define i32 @foo20() {
ret i32 20
}

LLVM IR (-O2):
define i32 @foo20() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int count = 1;
  while (1) {
    printf("%2d\n", count++);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%esi
lea    0xee1(%rip),%rbx
nop
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %ebp,%esi
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"%2d\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
br label %7
7: ; preds = %2, %7
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 1, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int exitval) {
  printf("Diddy usage:\n");
  printf("diddy input_file\n");
  exit(exitval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Diddy usage:\0A\00"
@.str.1 = [18 x i8] c"diddy input_file\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"Diddy usage:\00"
@str.2 = [17 x i8] c"diddy input_file\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int is_empty_pgh(const void *pgh) {
  const uint32_t *dwords = pgh;
  return ((dwords[0] | dwords[1] | dwords[2] | dwords[3]) == 0);
}


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

x86 assembly (clang, -O2):
<is_empty_pgh>:
movdqu (%rdi),%xmm0
pxor   %xmm1,%xmm1
pcmpeqb %xmm0,%xmm1
pmovmskb %xmm1,%ecx
xor    %eax,%eax
cmp    $0xffff,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_empty_pgh(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = or i32 %8, %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = or i32 %12, %15
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_empty_pgh(i8* nocapture %0) {
%2 = bitcast i8* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc_unlocked(int /*<<< orphan*/ *);
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
int fgetc(FILE *file) {
  flockfile(file);
  int result = fgetc_unlocked(file);
  funlockfile(file);
  return result;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <flockfile@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc_unlocked@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <funlockfile@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <flockfile@plt>
mov    %rbx,%rdi
call   1030 <fgetc_unlocked@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <funlockfile@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fgetc(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @flockfile(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @fgetc_unlocked(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @funlockfile(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @fgetc(i32* nocapture %0) {
%2 = tail call i32 @flockfile(i32* %0)
%3 = tail call i32 @fgetc_unlocked(i32* %0)
%4 = tail call i32 @funlockfile(i32* %0)
ret i32 %3
}
int dns_v_abi(void) { return 0x20120710; }


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

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

LLVM IR (-O0):
define i32 @dns_v_abi() {
ret i32 538052368
}

LLVM IR (-O2):
define i32 @dns_v_abi() {
ret i32 538052368
}
int absdiff2(int x, int y) {
  int result;
  if (x < y)
    result = y - x;
  else
    result = x - y;
  return result;
}


x86 assembly (clang, -O0):
<absdiff2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <absdiff2+0x24>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <absdiff2+0x2d>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absdiff2>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovge %edi,%eax
ret

LLVM IR (-O0):
define i32 @absdiff2(i32 %0, i32 %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
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %5
br label %17
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @absdiff2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = sub nsw i32 %1, %0
%5 = sub nsw i32 %0, %1
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
void gen_comment() { output_byte('#'); }


x86 assembly (clang, -O0):
<gen_comment>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1030 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_comment>:
mov    $0x23,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @gen_comment() {
%1 = call i32 @output_byte(i8 signext 35)
ret void
}

LLVM IR (-O2):
define void @gen_comment() {
%1 = tail call i32 @output_byte(i8 signext 35)
ret void
}
void for_onexit(int i, void *p) { printf("%s [%s]\n", __func__, "on_exit"); }


x86 assembly (clang, -O0):
<for_onexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    0xee0(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<for_onexit>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xeef(%rip),%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s [%s]\0A\00"
@__func__.for_onexit = [11 x i8] c"for_onexit\00"
@.str.1 = [8 x i8] c"on_exit\00"
define void @for_onexit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.for_onexit, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s [%s]\0A\00"
@__func__.for_onexit = [11 x i8] c"for_onexit\00"
@.str.1 = [8 x i8] c"on_exit\00"
define void @for_onexit(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.for_onexit, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *_strncpy(char *s, char *t, int n) {
  for (char *p = s; (s - p) <= n && (*s++ = *t++);)
    ;
}


x86 assembly (clang, -O0):
<_strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
sub    %rax,%rcx
movslq -0x1c(%rbp),%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x29(%rbp)
jg     1162 <_strncpy+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1172 <_strncpy+0x72>
jmp    1177 <_strncpy+0x77>
jmp    1117 <_strncpy+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strncpy>:
movslq %edx,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rax,%rcx
jg     1124 <_strncpy+0x24>
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rdi,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <_strncpy+0x10>
ret

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

LLVM IR (-O2):
define noalias i8* @_strncpy(i8* %0, i8* nocapture %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = sext i32 %2 to i64
br label %6
6: ; preds = %12, %3
%7 = phi i8* [ %1, %3 ], [ %13, %12 ]
%8 = phi i8* [ %0, %3 ], [ %15, %12 ]
%9 = ptrtoint i8* %8 to i64
%10 = sub i64 %9, %4
%11 = icmp sgt i64 %10, %5
br i1 %11, label %17, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %7
%15 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %14, i8* %8
%16 = icmp eq i8 %14, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %12
ret i8* undef
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showRipStatusTbl();
void cmdShowRipStatusTbl(int cmdType, struct cmd_arg *pCmdArg) {
  showRipStatusTbl();
}


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowRipStatusTbl(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showRipStatusTbl()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowRipStatusTbl(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showRipStatusTbl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M_ModeAttackEndGame(int /*<<< orphan*/);
void M_EndModeAttackRun(void) { M_ModeAttackEndGame(0); }


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

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

LLVM IR (-O0):
define void @M_EndModeAttackRun() {
%1 = call i32 @M_ModeAttackEndGame(i32 0)
ret void
}

LLVM IR (-O2):
define void @M_EndModeAttackRun() {
%1 = tail call i32 @M_ModeAttackEndGame(i32 0)
ret void
}
void smbd_destroy(struct TCP_Server_Info *server) {}


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

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

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

LLVM IR (-O2):
%struct.TCP_Server_Info = type opaque
define void @smbd_destroy(%struct.TCP_Server_Info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void msg(char *s, char *arg) {
  fprintf(stderr, "%s %s\n", s, arg);
  return;
}


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

x86 assembly (clang, -O2):
<msg>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
define void @msg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
define void @msg(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_POLYGON;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glVertex2i(int, int);
void displayCB(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(1.0, 1.0, 1.0);
  glBegin(GL_POLYGON);
  glVertex2i(200, 125);
  glVertex2i(100, 375);
  glVertex2i(300, 375);
  glEnd();
  glFlush();
}


x86 assembly (clang, -O0):
<displayCB>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
movsd  0xe86(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glColor3f@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
mov    $0xc8,%edi
mov    $0x7d,%esi
call   1030 <glVertex2i@plt>
mov    $0x64,%edi
mov    $0x177,%esi
call   1030 <glVertex2i@plt>
mov    $0x12c,%edi
mov    $0x177,%esi
call   1030 <glVertex2i@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
mov    $0x0,%al
call   1070 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayCB>:
push   %rax
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
movsd  0xe89(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1060 <glColor3f@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
mov    $0xc8,%edi
mov    $0x7d,%esi
call   1030 <glVertex2i@plt>
mov    $0x64,%edi
mov    $0x177,%esi
call   1030 <glVertex2i@plt>
mov    $0x12c,%edi
mov    $0x177,%esi
call   1030 <glVertex2i@plt>
xor    %eax,%eax
call   1050 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @displayCB() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%4 = load i32, i32* @GL_POLYGON
%5 = call i32 @glBegin(i32 %4)
%6 = call i32 @glVertex2i(i32 200, i32 125)
%7 = call i32 @glVertex2i(i32 100, i32 375)
%8 = call i32 @glVertex2i(i32 300, i32 375)
%9 = call i32 (...) @glEnd()
%10 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @displayCB() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%4 = load i32, i32* @GL_POLYGON
%5 = tail call i32 @glBegin(i32 %4)
%6 = tail call i32 @glVertex2i(i32 200, i32 125)
%7 = tail call i32 @glVertex2i(i32 100, i32 375)
%8 = tail call i32 @glVertex2i(i32 300, i32 375)
%9 = tail call i32 (...) @glEnd()
%10 = tail call i32 (...) @glFlush()
ret void
}
int toupper(int c) { return (c >= 'a' && c <= 'z') ? (c - 32) : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1129 <toupper+0x29>
cmpl   $0x7a,-0x4(%rbp)
jg     1129 <toupper+0x29>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ diagnostics(int, char *);
int /*<<< orphan*/ fprintRTF(char *);
void CmdThePage(int code) {
  diagnostics(4, "CmdThePage");
  fprintRTF("\\chpgn ");
}


x86 assembly (clang, -O0):
<CmdThePage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
lea    0xec9(%rip),%rsi
call   1030 <diagnostics@plt>
lea    0xec8(%rip),%rdi
call   1040 <fprintRTF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdThePage>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x4,%edi
call   1030 <diagnostics@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1040 <fprintRTF@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CmdThePage\00"
@.str.1 = [8 x i8] c"\\chpgn \00"
define void @CmdThePage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @fprintRTF(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"CmdThePage\00"
@.str.1 = [8 x i8] c"\\chpgn \00"
define void @CmdThePage(i32 %0) {
%2 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ is_prime(int);
unsigned nth(unsigned num) {
  if (num < 1)
    return 0;
  unsigned nth = 0;
  for (int i = 2;; ++i) {
    if (is_prime(i))
      nth++;
    if (nth == num)
      return i;
  }
  return num;
}


x86 assembly (clang, -O0):
<nth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jae    1131 <nth+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1184 <nth+0x74>
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     115a <nth+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1171 <nth+0x61>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <nth+0x74>
jmp    1176 <nth+0x66>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <nth+0x2f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1148 <nth+0x38>
mov    %edi,%r14d
xor    %ebx,%ebx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
cmp    %r14d,%ebx
jne    1130 <nth+0x20>
jmp    114a <nth+0x3a>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @nth(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 2, %1 ]
%6 = tail call i64 @is_prime(i32 %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = add i32 %4, %8
%10 = icmp eq i32 %9, %0
%11 = add nuw nsw i32 %5, 1
br i1 %10, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %5, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void getTimestamp(char *timestamp) {
  time_t timer;
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(timestamp, 20, "%Y-%m-%d_%H.%M.%S", tm_info);
}


x86 assembly (clang, -O0):
<getTimestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x14,%esi
lea    0xe9a(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimestamp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d_%H.%M.%S\00"
define void @getTimestamp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d_%H.%M.%S\00"
define void @getTimestamp(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a = 5;
  int b = 9;
  a = a + b;
  b = a - b;
  a = a - b;
  printf("a=%d, b=%d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb2(%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
mov    $0x9,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
store i32 9, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 9, i32 5)
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *s) {
  register char *p;
  if (p = strrchr(s, '/'))
    return 1 + p;
  return s;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1149 <basename+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <basename+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %13
11: ; preds = %1
%12 = load i8*, i8** %3
store i8* %12, i8** %2
br label %13
13: ; preds = %11, %8
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int arch_has_random(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arch_has_random() {
ret i32 0
}
void tdata_gtfsrt_alerts_not_available() {}


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

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

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

LLVM IR (-O2):
define void @tdata_gtfsrt_alerts_not_available() {
ret void
}
int get_st1_prop(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_st1_prop() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int test_yajl_boolean(void *ctx, int boolVal) {
  printf("bool: %s\n", boolVal ? "true" : "false");
  return 1;
}


x86 assembly (clang, -O0):
<test_yajl_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xee6(%rip),%rsi
lea    0xeda(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_yajl_boolean>:
push   %rax
test   %esi,%esi
lea    0xef5(%rip),%rax
lea    0xee9(%rip),%rsi
cmove  %rax,%rsi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"bool: %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @test_yajl_boolean(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [10 x i8] c"bool: %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @test_yajl_boolean(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}
/* Variables and functions */
int lower(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int c = 'C';
  printf("%c\n", c);
  printf("%c\n", lower(c));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x43,%esi
call   1030 <printf@plt>
mov    $0x43,%edi
call   1040 <lower@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 67)
%2 = tail call i32 @lower(i32 67)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int covertToDigit(char x) { return (x - 64); }


x86 assembly (clang, -O0):
<covertToDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x40,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<covertToDigit>:
lea    -0x40(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @covertToDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 64
ret i32 %5
}

LLVM IR (-O2):
define i32 @covertToDigit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -64
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void _FatalError(const char *s) {
  printf("Fatal error in boundary_transformation: %s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<_FatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_FatalError>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Fatal error in boundary_transformation: %s\0A\00"
define void @_FatalError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [44 x i8] c"Fatal error in boundary_transformation: %s\0A\00"
define void @_FatalError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ merge_pass(char *, int, int);
void merge_sort_bottom_up(char array[], int length) {
  int i = 0x01;
  for (; i < length; i *= 2) {
    merge_pass(array, i, length);
  }
  return;
}


x86 assembly (clang, -O0):
<merge_sort_bottom_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114f <merge_sort_bottom_up+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <merge_pass@plt>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <merge_sort_bottom_up+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort_bottom_up>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1142 <merge_sort_bottom_up+0x32>
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <merge_pass@plt>
add    %ebp,%ebp
cmp    %ebx,%ebp
jl     1130 <merge_sort_bottom_up+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @merge_sort_bottom_up(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 1, %2 ]
%6 = tail call i32 @merge_pass(i8* %0, i32 %5, i32 %1)
%7 = shl nsw i32 %5, 1
%8 = icmp slt i32 %7, %1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
void UART9BitDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x000000A4))) &= ~0x00008000;
}


x86 assembly (clang, -O0):
<UART9BitDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xa4(%rax),%rcx
and    $0xffffffffffff7fff,%rcx
mov    %rcx,0xa4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitDisable>:
andq   $0xffffffffffff7fff,0xa4(%rdi)
ff 7f ff ff
ret

LLVM IR (-O0):
define void @UART9BitDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 164
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -32769
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UART9BitDisable(i64 %0) {
%2 = add i64 %0, 164
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -32769
store volatile i64 %5, i64* %3
ret void
}
long long f(long long a) { return a * 7; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x0(,%rdi,8),%rax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = mul nsw i64 %0, 7
ret i64 %2
}
/* Variables and functions */
int pow(int, int);
int main(void) { return pow(5, 4); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x4,%esi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pow(i32 5, i32 4)
ret i32 %1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_write_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(98, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_write_random_coefficient_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x62,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_write_random_coefficient_system>:
mov    $0x62,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_write_random_coefficient_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 98, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_write_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 98, i32* undef, i32* undef, double* undef)
ret i32 %1
}