xunge/DecIR huggingface dataset:
void __attribute__((dllexport)) foo1() {}


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

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

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

LLVM IR (-O2):
define void @foo1() {
ret void
}
void EVP_sha224(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_sha224() {
ret void
}
unsigned char parse_hexadecimal(char digit) {
  if (digit >= '0' && digit <= '9')
    return digit - '0';
  if (digit >= 'a' && digit <= 'f')
    return digit - 'a' + 10;
  return digit - 'A' + 10;
}


x86 assembly (clang, -O0):
<parse_hexadecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <parse_hexadecimal+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <parse_hexadecimal+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    116c <parse_hexadecimal+0x6c>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     115f <parse_hexadecimal+0x5f>
movsbl -0x2(%rbp),%eax
cmp    $0x66,%eax
jg     115f <parse_hexadecimal+0x5f>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    116c <parse_hexadecimal+0x6c>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_hexadecimal>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
jb     111a <parse_hexadecimal+0x1a>
lea    -0x61(%rdi),%eax
cmp    $0x5,%al
ja     1114 <parse_hexadecimal+0x14>
add    $0xa9,%dil
jmp    1118 <parse_hexadecimal+0x18>
add    $0xc9,%dil
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @parse_hexadecimal(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i8 %0, -87
br label %11
9: ; preds = %4
%10 = add i8 %0, -55
br label %11
11: ; preds = %1, %9, %7
%12 = phi i8 [ %8, %7 ], [ %10, %9 ], [ %2, %1 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ func2();
int /*<<< orphan*/ func3();
int main(int argc, const char *argv[]) {
  func();
  func2();
  func3();
}


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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
%4 = tail call i32 (...) @func2()
%5 = tail call i32 (...) @func3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err_helper(char *);
int /*<<< orphan*/ exit(int);
void validArgc(int argc) {
  if (argc == 3) {
    err_helper("Invalid number of arguments.");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<validArgc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    114b <validArgc+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <err_helper@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validArgc>:
cmp    $0x3,%edi
je     1126 <validArgc+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <err_helper@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Invalid number of arguments.\00"
define void @validArgc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @err_helper(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Invalid number of arguments.\00"
define void @validArgc(i32 %0) {
%2 = icmp eq i32 %0, 3
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @err_helper(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
void updateMaxDepth(int64_t file_depth, int *max_depth) {
  if ((!file_depth) || (file_depth > 65535)) {
    *max_depth = 65535;
  } else if (file_depth > (*max_depth)) {
    *max_depth = (int)file_depth;
  }
}


x86 assembly (clang, -O0):
<updateMaxDepth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <updateMaxDepth+0x22>
cmpl   $0xffff,-0x4(%rbp)
jle    1131 <updateMaxDepth+0x31>
mov    -0x10(%rbp),%rax
movl   $0xffff,(%rax)
jmp    114e <updateMaxDepth+0x4e>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    1149 <updateMaxDepth+0x49>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    114e <updateMaxDepth+0x4e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateMaxDepth>:
mov    $0xffff,%eax
test   %edi,%edi
je     1117 <updateMaxDepth+0x17>
cmp    $0xffff,%edi
jg     1117 <updateMaxDepth+0x17>
mov    %edi,%eax
cmp    %edi,(%rsi)
jge    1119 <updateMaxDepth+0x19>
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @updateMaxDepth(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp sgt i32 %0, 65535
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, %0
br i1 %8, label %9, label %11
9: ; preds = %6, %2
%10 = phi i32 [ 65535, %2 ], [ %0, %6 ]
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
int myinit(void) {
  pr_info("oops myinit\n");
  *(int *)0 = 0;
  pr_info("oops after\n");
  return 0;
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
movl   $0x0,(%rax)
lea    0xede(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <pr_info@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"oops myinit\0A\00"
@.str.1 = [12 x i8] c"oops after\0A\00"
define i32 @myinit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* null
%2 = call i32 @pr_info(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"oops myinit\0A\00"
define i32 @myinit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *self) {
  fprintf(stderr, "Usage: %s destination port\n", self);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s destination port\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s destination port\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void getInput(char *buf, int size) { fgets(buf, size, stdin); }


x86 assembly (clang, -O0):
<getInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInput>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fgets@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
define void @getInput(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curscr;
int /*<<< orphan*/ draw_all(int);
int /*<<< orphan*/ resize_screen();
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/);
void redraw(const char *args[]) {
  wrefresh(curscr);
  resize_screen();
  draw_all(true);
}


x86 assembly (clang, -O0):
<redraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <wrefresh@plt>
mov    $0x0,%al
call   1050 <resize_screen@plt>
mov    $0x1,%edi
call   1030 <draw_all@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <wrefresh@plt>
xor    %eax,%eax
call   1050 <resize_screen@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <draw_all@plt>

LLVM IR (-O0):
@curscr = global i32 0
define void @redraw(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @curscr
%4 = call i32 @wrefresh(i32 %3)
%5 = call i32 (...) @resize_screen()
%6 = call i32 @draw_all(i32 1)
ret void
}

LLVM IR (-O2):
@curscr = global i32 0
define void @redraw(i8** nocapture readnone %0) {
%2 = load i32, i32* @curscr
%3 = tail call i32 @wrefresh(i32 %2)
%4 = tail call i32 (...) @resize_screen()
%5 = tail call i32 @draw_all(i32 1)
ret void
}
void mapgs(int *x) { *x = *x * 24 / 255; }


x86 assembly (clang, -O0):
<mapgs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x18,(%rax),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapgs>:
mov    (%rdi),%eax
shl    $0x3,%eax
lea    (%rax,%rax,2),%eax
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x7,%eax
add    %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @mapgs(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 24
%6 = sdiv i32 %5, 255
%7 = load i32*, i32** %2
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @mapgs(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 24
%4 = sdiv i32 %3, 255
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int main(void) {
  malloc(7931147);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x79050b,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc(i32 7931147)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int e, a;
  scanf("%i", &e);
  f(e, &a);
  printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <f@plt>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    %rsp,%rsi
call   1030 <f@plt>
mov    (%rsp),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @f(i32 %6, i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doZip(char *);
void test_DFextZipOOXML(void) { doZip("test.docx"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"test.docx\00"
define void @test_DFextZipOOXML() {
%1 = call i32 @doZip(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"test.docx\00"
define void @test_DFextZipOOXML() {
%1 = tail call i32 @doZip(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void dummy_sighandler(int signum_unused) {}


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

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

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

LLVM IR (-O2):
define void @dummy_sighandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *strdup(char *);
char *xstrdup(char *s) {
  if ((s = strdup(s)) == NULL)
    die("Out of memory\n");
  return s;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    114f <xstrdup+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
store i8* %4, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @xstrdup(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 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int main(void) {
  char in[11];
  char *s;
  unsigned char c;
  int i, j;
  int idx_in;
  in[10] = 0;
  idx_in = 0;
  s = in;
  i = 0;
  c = in[idx_in];
  while (('0' <= c) && (c <= '9')) {
    j = c - '0';
    i = i * 10 + j;
    idx_in++;
    c = in[idx_in];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0xf(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movslq -0x28(%rbp),%rax
mov    -0xf(%rbp,%rax,1),%al
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x29(%rbp)
jg     1153 <main+0x53>
movzbl -0x19(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1163 <main+0x63>
jmp    1190 <main+0x90>
movzbl -0x19(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x24(%rbp)
imul   $0xa,-0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movslq -0x28(%rbp),%rax
mov    -0xf(%rbp,%rax,1),%al
mov    %al,-0x19(%rbp)
jmp    1130 <main+0x30>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 10
store i8 0, i8* %8
store i32 0, i32* %7
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
store i8* %9, i8** %3
store i32 0, i32* %5
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %4
br label %14
14: ; preds = %24, %0
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp sle i32 48, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = icmp sle i32 %20, 57
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br i1 %23, label %24, label %38
24: ; preds = %22
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = sub nsw i32 %26, 48
store i32 %27, i32* %6
%28 = load i32, i32* %5
%29 = mul nsw i32 %28, 10
%30 = load i32, i32* %6
%31 = add nsw i32 %29, %30
store i32 %31, i32* %5
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 %35
%37 = load i8, i8* %36
store i8 %37, i8* %4
br label %14
38: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ akscan(int /*<<< orphan*/);
void op_selleft() { akscan(0); }


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

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

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

LLVM IR (-O2):
define void @op_selleft() {
%1 = tail call i32 @akscan(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
uint64_t imm64(FILE *file) {
  uint64_t qword;
  if (fread(&qword, sizeof(uint8_t), 1, file) == 1)
    return qword;
  return 0;
}


x86 assembly (clang, -O0):
<imm64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1147 <imm64+0x37>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <imm64+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm64>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1135 <imm64+0x25>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @imm64(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ check_data();
int /*<<< orphan*/ check_random(int, char **);
void testmain(int argc, char *argv[]) {
  check_data();
  check_random(argc, argv);
}


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

x86 assembly (clang, -O2):
<testmain>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <check_data@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <check_random@plt>

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

LLVM IR (-O2):
define void @testmain(i32 %0, i8** %1) {
%3 = tail call i32 (...) @check_data()
%4 = tail call i32 @check_random(i32 %0, i8** %1)
ret void
}
/* Variables and functions */
char *strdup(char const *);
int strlen(char const *);
char *url_normalize(const char *url) {
  int n = strlen(url);
  char *ret = strdup(url);
  if (url[n - 1] == '/')
    ret[n - 1] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<url_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1170 <url_normalize+0x50>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_normalize>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strdup@plt>
movslq %ebp,%rcx
cmpb   $0x2f,-0x1(%rcx,%rbx,1)
jne    1144 <url_normalize+0x24>
movb   $0x0,-0x1(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @url_normalize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = call i8* @strdup(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 47
br i1 %16, label %17, label %23
17: ; preds = %1
%18 = load i8*, i8** %4
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8 0, i8* %22
br label %23
23: ; preds = %17, %1
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
define noalias i8* @url_normalize(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @strdup(i8* %0)
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 0, i8* %10
br label %11
11: ; preds = %9, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ minprintf(char *, char *);
int main(void) {
  char *a = "Hello,World";
  minprintf("%s", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello,World\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @minprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xbb() {
  Assert_real((iscntrl(187) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              940, ("iscntrl should be 0 for 0xbb"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xbb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbb,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3ac,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xbb>:
push   %rax
mov    $0xbb,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ac,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbb\00"
define void @t_iscntrl_0xbb() {
%1 = call i64 @iscntrl(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbb\00"
define void @t_iscntrl_0xbb() {
%1 = tail call i64 @iscntrl(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void RTTcpWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpWrite() {
ret void
}
void _XMP_threads_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @_XMP_threads_init() {
ret void
}
/* Variables and functions */
int mem_free_maddr(void *);
void *paging_get_maddr(void *);
int page_free_maddr(void *vp_vaddr) {
  void *vp_maddr = paging_get_maddr(vp_vaddr);
  return mem_free_maddr(vp_maddr);
}


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

x86 assembly (clang, -O2):
<page_free_maddr>:
push   %rax
call   1040 <paging_get_maddr@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <mem_free_maddr@plt>

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

LLVM IR (-O2):
define i32 @page_free_maddr(i8* %0) {
%2 = tail call i8* @paging_get_maddr(i8* %0)
%3 = tail call i32 @mem_free_maddr(i8* %2)
ret i32 %3
}
int bar(unsigned int x) { return (int)(x + 1U) + 1; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add i32 %0, 2
ret i32 %2
}
/* Type definitions */
struct tui_gen_win_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ make_visible(struct tui_gen_win_info *, int);
void tui_make_visible(struct tui_gen_win_info *win_info) {
  make_visible(win_info, 1);
}


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

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

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

LLVM IR (-O2):
%struct.tui_gen_win_info = type { i32 }
define void @tui_make_visible(%struct.tui_gen_win_info* %0) {
%2 = tail call i32 @make_visible(%struct.tui_gen_win_info* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ done();
void sdone(int sig) { done(); }


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

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

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

LLVM IR (-O2):
define void @sdone(i32 %0) {
%2 = tail call i32 (...) @done()
ret void
}
/* Variables and functions */
double exp2(double);
double log2(double);
double compute(double a) {
  double c = 0.;
  if (a > 11.0) {
    c = log2(a);
  } else {
    c = exp2(a);
  }
  return c;
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1160 <compute+0x40>
movsd  -0x8(%rbp),%xmm0
call   1030 <log2@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    116f <compute+0x4f>
movsd  -0x8(%rbp),%xmm0
call   1040 <exp2@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
ucomisd 0xed8(%rip),%xmm0
jbe    112f <compute+0xf>
jmp    1030 <log2@plt>
jmp    1040 <exp2@plt>

LLVM IR (-O0):
define double @compute(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fcmp ogt double %4, 1.100000e+01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @log2(double %7)
store double %8, double* %3
br label %12
9: ; preds = %1
%10 = load double, double* %2
%11 = call double @exp2(double %10)
store double %11, double* %3
br label %12
12: ; preds = %9, %6
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @compute(double %0) {
%2 = fcmp ogt double %0, 1.100000e+01
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @log2(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @exp2(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Variables and functions */
char rc();
float rf();
int /*<<< orphan*/ rv();
int main() {
  float x = rf();
  char c = rc();
  rv();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rc@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1050 <rv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rf@plt>
xor    %eax,%eax
call   1030 <rc@plt>
xor    %eax,%eax
call   1050 <rv@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca i8
%3 = call float (...) @rf()
store float %3, float* %1
%4 = call signext i8 (...) @rc()
store i8 %4, i8* %2
%5 = call i32 (...) @rv()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @rf()
%2 = tail call signext i8 (...) @rc()
%3 = tail call i32 (...) @rv()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void dummy_wait_temperature(void *user) {
  fprintf(stderr, "GCodeParser: wait_temperature()\n");
}


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

x86 assembly (clang, -O2):
<dummy_wait_temperature>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"GCodeParser: wait_temperature()\0A\00"
define void @dummy_wait_temperature(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
void rop3_67_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & S;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_67_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_67_1_0>:
mov    (%rdi),%al
and    %sil,%al
or     %esi,%edx
not    %dl
or     %al,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_67_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_67_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %2, %1
%7 = xor i8 %6, -1
%8 = or i8 %5, %7
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *p = s;
  while (*p)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
long long callee(long long);
int /*<<< orphan*/ known_types();
int main() {
  register long long x, y;
  register long long i;
  x = (long long)0xfedcba9876543210LL;
  y = x++;
  x += y;
  i = 11;
  x = callee(i);
  y += x;
  known_types();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0xfedcba9876543210,%rax
ba dc fe
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0xb,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <callee@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <known_types@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb,%edi
call   1040 <callee@plt>
xor    %eax,%eax
call   1030 <known_types@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i64 -81985529216486896, i64* %2
%5 = load i64, i64* %2
%6 = add nsw i64 %5, 1
store i64 %6, i64* %2
store i64 %5, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %2
%9 = add nsw i64 %8, %7
store i64 %9, i64* %2
store i64 11, i64* %4
%10 = load i64, i64* %4
%11 = call i64 @callee(i64 %10)
store i64 %11, i64* %2
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = add nsw i64 %13, %12
store i64 %14, i64* %3
%15 = call i32 (...) @known_types()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @callee(i64 11)
%2 = tail call i32 (...) @known_types()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("*argv[0] -d <UIO_DEV_FILE> -i|-o <VALUE>\n");
  printf(" -d UIO device file. e.g. /dev/uio0");
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"*argv[0] -d <UIO_DEV_FILE> -i|-o <VALUE>\0A\00"
@.str.1 = [36 x i8] c" -d UIO device file. e.g. /dev/uio0\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c" -d UIO device file. e.g. /dev/uio0\00"
@str = [41 x i8] c"*argv[0] -d <UIO_DEV_FILE> -i|-o <VALUE>\00"
define void @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 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int inl(short port) {
  int ret;
  __asm__ volatile("inl %1, %0" : "=a"(ret) : "dN"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @inl(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @inl(i16 signext %0) {
%2 = tail call i32 asm sideeffect "inl $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_stack(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_stack() {
%1 = tail call i32 (...) @utest_control()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B1();
int *func1(int /*<<< orphan*/);
int *A1() { return func1(B1()); }


x86 assembly (clang, -O0):
<A1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <B1@plt>
mov    %eax,%edi
call   1030 <func1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<A1>:
push   %rax
xor    %eax,%eax
call   1040 <B1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <func1@plt>

LLVM IR (-O0):
define i32* @A1() {
%1 = call i32 (...) @B1()
%2 = call i32* @func1(i32 %1)
ret i32* %2
}

LLVM IR (-O2):
define i32* @A1() {
%1 = tail call i32 (...) @B1()
%2 = tail call i32* @func1(i32 %1)
ret i32* %2
}