xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printUsage(char *appname) {
  char *usage =
      "%s usage:\n\n"
      "\t-h                 Print help\n"
      "\t-d <device name>   Serial port device (default: /dev/ttyS0)\n"
      "\t-a <address>       IP address (default: 127.0.0.1)\n"
      "\t-p <port>          UDP port (default: 9998)\n"
      "\t-i                 Ignore CRC failures\n";
  fprintf(stderr, usage, appname);
}


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

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

LLVM IR (-O0):
@.str = [241 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> IP address (default: 127.0.0.1)\0A\09-p <port> UDP port (default: 9998)\0A\09-i Ignore CRC failures\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([241 x i8], [241 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [241 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> IP address (default: 127.0.0.1)\0A\09-p <port> UDP port (default: 9998)\0A\09-i Ignore CRC failures\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([241 x i8], [241 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_letter(int, int, int /*<<< orphan*/);
void print_text(int note) {
  int i;
  for (i = 0; i < 59; i++)
    print_letter(note, i, 0);
}


x86 assembly (clang, -O0):
<print_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3b,-0x8(%rbp)
jge    1147 <print_text+0x37>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <print_letter@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_text+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_text>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <print_letter@plt>
add    $0x1,%ebp
cmp    $0x3b,%ebp
jne    1120 <print_text+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_text(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @print_letter(i32 %0, i32 %3, i32 0)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 59
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: find_sqfs -i infile -o outfile [-s signature]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: find_sqfs -i infile -o outfile [-s signature]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: find_sqfs -i infile -o outfile [-s signature]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
short int cast_uchar_short_fast(unsigned char x) { return (short int)x; }


x86 assembly (clang, -O0):
<cast_uchar_short_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_uchar_short_fast>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @cast_uchar_short_fast(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @cast_uchar_short_fast(i8 zeroext %0) {
%2 = zext i8 %0 to i16
ret i16 %2
}
/* Variables and functions */
int strcoll(char *, char *);
int qsort_strcmp_func(const void *a, const void *b) {
  return strcoll(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<qsort_strcmp_func>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcoll@plt>

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

LLVM IR (-O2):
define i32 @qsort_strcmp_func(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcoll(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ japi_setimage(int, int);
void j_setimage(int arg0, int arg1) { japi_setimage(arg0, arg1); }


x86 assembly (clang, -O0):
<j_setimage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <japi_setimage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_setimage>:
jmp    1030 <japi_setimage@plt>

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

LLVM IR (-O2):
define void @j_setimage(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setimage(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
void echo_quote(int c) {
  int d;
  putchar(c);
  while ((d = getchar()) != c) {
    putchar(d);
    if (d == '\\')
      putchar(getchar());
  }
  putchar(d);
}


x86 assembly (clang, -O0):
<echo_quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
je     116b <echo_quote+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x5c,-0x8(%rbp)
jne    1166 <echo_quote+0x46>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1133 <echo_quote+0x13>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_quote>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    %ebx,%eax
jne    1142 <echo_quote+0x22>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>
mov    %eax,%ebp
jmp    115d <echo_quote+0x3d>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
je     1135 <echo_quote+0x15>
mov    %ebp,%edi
call   1030 <putchar@plt>
cmp    $0x5c,%ebp
jne    1150 <echo_quote+0x30>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1150 <echo_quote+0x30>

LLVM IR (-O0):
define void @echo_quote(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @putchar(i32 %4)
br label %6
6: ; preds = %18, %1
%7 = call i32 (...) @getchar()
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @putchar(i32 %11)
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 92
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = call i32 (...) @getchar()
%17 = call i32 @putchar(i32 %16)
br label %18
18: ; preds = %15, %10
br label %6
19: ; preds = %6
%20 = load i32, i32* %3
%21 = call i32 @putchar(i32 %20)
ret void
}

LLVM IR (-O2):
define void @echo_quote(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, %0
br i1 %4, label %15, label %5
5: ; preds = %1, %12
%6 = phi i32 [ %13, %12 ], [ %3, %1 ]
%7 = tail call i32 @putchar(i32 %6)
%8 = icmp eq i32 %6, 92
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = tail call i32 (...) @getchar()
%11 = tail call i32 @putchar(i32 %10)
br label %12
12: ; preds = %9, %5
%13 = tail call i32 (...) @getchar()
%14 = icmp eq i32 %13, %0
br i1 %14, label %15, label %5
15: ; preds = %12, %1
%16 = tail call i32 @putchar(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You are %d miles away", distance);
  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   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"You are %d miles away\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 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"You are %d miles away\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Type definitions */
struct lnklist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lnklist_destroy_with_destructor(struct lnklist *,
                                                   int /*<<< orphan*/ *);
void lnklist_destroy(struct lnklist *obj) {
  lnklist_destroy_with_destructor(obj, NULL);
}


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

x86 assembly (clang, -O2):
<lnklist_destroy>:
xor    %esi,%esi
jmp    1030 <lnklist_destroy_with_destructor@plt>

LLVM IR (-O0):
%struct.lnklist = type { i32 }
define void @lnklist_destroy(%struct.lnklist* %0) {
%2 = alloca %struct.lnklist*
store %struct.lnklist* %0, %struct.lnklist** %2
%3 = load %struct.lnklist*, %struct.lnklist** %2
%4 = call i32 @lnklist_destroy_with_destructor(%struct.lnklist* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.lnklist = type { i32 }
define void @lnklist_destroy(%struct.lnklist* %0) {
%2 = tail call i32 @lnklist_destroy_with_destructor(%struct.lnklist* %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x18() {
  Assert_real((isalpha(24) == 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_isalpha.c",
              125, ("isalpha should be 0 for 0x18"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x18>:
push   %rax
mov    $0x18,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x7d,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x18\00"
define void @t_isalpha_0x18() {
%1 = call i64 @isalpha(i32 24)
%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 125, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x18\00"
define void @t_isalpha_0x18() {
%1 = tail call i64 @isalpha(i32 24)
%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 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
main() {
  char c = getchar();
  putchar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call i32 @putchar(i8 signext %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i32 @putchar(i8 signext %1)
ret i32 0
}
void SW7_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SW7_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SW7_IRQHandler+0x9>
jmp    1109 <SW7_IRQHandler+0x9>

x86 assembly (clang, -O2):
<SW7_IRQHandler>:
jmp    1100 <SW7_IRQHandler>

LLVM IR (-O0):
define void @SW7_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SW7_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int rand();
double myrand(double range) {
  double d = rand() % 1000000;
  return range * d / 1000000;
}


x86 assembly (clang, -O0):
<myrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrand>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
divsd  0xeb1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @myrand(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 1000000
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fdiv double %9, 1.000000e+06
ret double %10
}

LLVM IR (-O2):
define double @myrand(double %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 1000000
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
%6 = fdiv double %5, 1.000000e+06
ret double %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ baseCheck();
int main() {
  baseCheck();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <baseCheck@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @baseCheck()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
long tls1_default_timeout(void) { return (60 * 60 * 2); }


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

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

LLVM IR (-O0):
define i64 @tls1_default_timeout() {
ret i64 7200
}

LLVM IR (-O2):
define i64 @tls1_default_timeout() {
ret i64 7200
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned int);
void PrintOut(unsigned int N) {
  if (N >= 10)
    PrintOut(N / 10);
  (putchar((N % 10) + '0'));
}


x86 assembly (clang, -O0):
<PrintOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jb     1148 <PrintOut+0x28>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1040 <PrintOut@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintOut>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%r14d
cmp    $0xa,%edi
jb     1140 <PrintOut+0x20>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <PrintOut@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @PrintOut(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 10
%11 = add i32 %10, 48
%12 = call i32 @putchar(i32 %11)
ret void
}

LLVM IR (-O2):
define void @PrintOut(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = udiv i32 %0, 10
tail call void @PrintOut(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = urem i32 %0, 10
%7 = or i32 %6, 48
%8 = tail call i32 @putchar(i32 %7)
ret void
}
/* Type definitions */
struct cli_val_byte {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cli_val_byte *);
void cli_val_byte_destroy(struct cli_val_byte *v) { free(v); }


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

x86 assembly (clang, -O2):
<cli_val_byte_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.cli_val_byte = type { i32 }
define void @cli_val_byte_destroy(%struct.cli_val_byte* nocapture %0) {
%2 = tail call i32 @free(%struct.cli_val_byte* %0)
ret void
}
int clog_console_uninit_callback_fun(void *args) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clog_console_uninit_callback_fun(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int Q_strncasecmp(char *, char *, int);
int Q_strcasecmp(char *s1, char *s2) { return Q_strncasecmp(s1, s2, 99999); }


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

x86 assembly (clang, -O2):
<Q_strcasecmp>:
mov    $0x1869f,%edx
jmp    1030 <Q_strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @Q_strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @Q_strncasecmp(i8* %0, i8* %1, i32 99999)
ret i32 %3
}
/* Variables and functions */
int sleep(int);
int Sleep(int ms) { return sleep(ms / 1000); }


x86 assembly (clang, -O0):
<Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleep>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define i32 @Sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000
%5 = call i32 @sleep(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Sleep(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = tail call i32 @sleep(i32 %2)
ret i32 %3
}
/* Variables and functions */
int f2(int);
int func(int y, int z) {
  int x;
  x = f2(x);
  return x + y + z;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <f2@plt>
add    %ebx,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @func(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* %5
%7 = call i32 @f2(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = tail call i32 @f2(i32 undef)
%4 = add i32 %1, %0
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, sum;
  scanf("%d %d", &a, &b);
  sum = a + b;
  if (sum > 100) {
    printf("%d\n", sum / 100);
  } else {
    printf("%d\n", sum);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jle    1174 <main+0x54>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x63>
mov    -0x10(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
cmp    $0x65,%esi
jl     114e <main+0x2e>
mov    %esi,%eax
imul   $0x51eb851f,%rax,%rsi
shr    $0x25,%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 100
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 100
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %18
15: ; preds = %0
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = icmp sgt i32 %8, 100
%10 = udiv i32 %8, 100
%11 = select i1 %9, i32 %10, i32 %8
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mrpd(int);
int /*<<< orphan*/ putc(char);
void mprintd(int x) {
  if (x == 0)
    putc('0');
  else if (x < 0) {
    putc('-');
    mrpd(-x);
  } else
    mrpd(x);
  putc(' ');
}


x86 assembly (clang, -O0):
<mprintd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1144 <mprintd+0x24>
mov    $0x30,%edi
call   1030 <putc@plt>
jmp    1174 <mprintd+0x54>
cmpl   $0x0,-0x4(%rbp)
jge    1167 <mprintd+0x47>
mov    $0x2d,%edi
call   1030 <putc@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1040 <mrpd@plt>
jmp    116f <mprintd+0x4f>
mov    -0x4(%rbp),%edi
call   1040 <mrpd@plt>
jmp    1174 <mprintd+0x54>
mov    $0x20,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mprintd>:
push   %rbx
test   %edi,%edi
je     113e <mprintd+0x1e>
mov    %edi,%ebx
jns    1135 <mprintd+0x15>
mov    $0x2d,%edi
call   1030 <putc@plt>
neg    %ebx
mov    %ebx,%edi
call   1040 <mrpd@plt>
jmp    1148 <mprintd+0x28>
mov    $0x30,%edi
call   1030 <putc@plt>
mov    $0x20,%edi
pop    %rbx
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @mprintd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putc(i8 signext 48)
br label %19
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 @putc(i8 signext 45)
%12 = load i32, i32* %2
%13 = sub nsw i32 0, %12
%14 = call i32 @mrpd(i32 %13)
br label %18
15: ; preds = %7
%16 = load i32, i32* %2
%17 = call i32 @mrpd(i32 %16)
br label %18
18: ; preds = %15, %10
br label %19
19: ; preds = %18, %5
%20 = call i32 @putc(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @mprintd(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putc(i8 signext 48)
br label %13
5: ; preds = %1
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = tail call i32 @putc(i8 signext 45)
%9 = sub nsw i32 0, %0
%10 = tail call i32 @mrpd(i32 %9)
br label %13
11: ; preds = %5
%12 = tail call i32 @mrpd(i32 %0)
br label %13
13: ; preds = %7, %11, %3
%14 = tail call i32 @putc(i8 signext 32)
ret void
}
/* Variables and functions */
double const dot_product(double const *, double const *, int);
double cosine_distance(const double *u, const double *v, int n, const double nu,
                       const double nv) {
  return 1.0 - (dot_product(u, v, n) / (nu * nv));
}


x86 assembly (clang, -O0):
<cosine_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <dot_product@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeaa(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosine_distance>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <dot_product@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @cosine_distance(double* %0, double* %1, i32 %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = load i32, i32* %8
%14 = call double @dot_product(double* %11, double* %12, i32 %13)
%15 = load double, double* %9
%16 = load double, double* %10
%17 = fmul double %15, %16
%18 = fdiv double %14, %17
%19 = fsub double 1.000000e+00, %18
ret double %19
}

LLVM IR (-O2):
define double @cosine_distance(double* %0, double* %1, i32 %2, double %3, double %4) {
%6 = tail call double @dot_product(double* %0, double* %1, i32 %2)
%7 = fmul double %3, %4
%8 = fdiv double %6, %7
%9 = fsub double 1.000000e+00, %8
ret double %9
}
/* Variables and functions */
int atoi(char *);
char *strtok(int /*<<< orphan*/, char *);
int /*<<< orphan*/ test_for_garbage_at_eol();
void parseNumberFlag(char *buffer, char *name, int *flag) {
  (void)name;
  if ((buffer = strtok(0, " \t"))) {
    *flag = atoi(buffer);
    test_for_garbage_at_eol();
  } else
    *flag = 1;
}


x86 assembly (clang, -O0):
<parseNumberFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
lea    0xeb3(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     117d <parseNumberFlag+0x4d>
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <test_for_garbage_at_eol@plt>
jmp    1187 <parseNumberFlag+0x57>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseNumberFlag>:
push   %rbx
mov    %rdx,%rbx
lea    0xec5(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     1159 <parseNumberFlag+0x29>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
jmp    1030 <test_for_garbage_at_eol@plt>
movl   $0x1,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define void @parseNumberFlag(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture writeonly %2) {
%4 = tail call i8* @strtok(i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
store i32 %7, i32* %2
%8 = tail call i32 (...) @test_for_garbage_at_eol()
br label %10
9: ; preds = %3
store i32 1, i32* %2
br label %10
10: ; preds = %9, %6
ret void
}
void foo_1_2_1_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_2_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ change_array(int *);
int /*<<< orphan*/ create_array(int *);
int /*<<< orphan*/ print_array(int, int *);
main() {
  int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int x = 0;
  change_array(arr);
  print_array(5, arr);
  create_array(arr);
  print_array(10, arr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <change_array@plt>
lea    -0x30(%rbp),%rsi
mov    $0x5,%edi
call   1040 <print_array@plt>
lea    -0x30(%rbp),%rdi
call   1060 <create_array@plt>
lea    -0x30(%rbp),%rsi
mov    $0xa,%edi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <change_array@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1050 <create_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
store i32 0, i32* %2
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @change_array(i32* %4)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @print_array(i32 5, i32* %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = call i32 @create_array(i32* %8)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%11 = call i32 @print_array(i32 10, i32* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @change_array(i32* %3)
%5 = call i32 @print_array(i32 5, i32* %3)
%6 = call i32 @create_array(i32* %3)
%7 = call i32 @print_array(i32 10, i32* %3)
ret i32 0
}
int isPalindrome(const char *s, int length) {
  if (length <= 1)
    return 1;
  if (s[0] == s[length - 1])
    return isPalindrome(&(s[1]), length - 2);
  else
    return 0;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jg     1135 <isPalindrome+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1177 <isPalindrome+0x67>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1170 <isPalindrome+0x60>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
call   1030 <isPalindrome@plt>
mov    %eax,-0x4(%rbp)
jmp    1177 <isPalindrome+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     112b <isPalindrome+0x2b>
lea    0x2(%rsi),%ecx
add    $0xffffffff,%esi
mov    %esi,%r8d
movzbl (%rdi),%edx
cmp    (%rdi,%r8,1),%dl
jne    112c <isPalindrome+0x2c>
add    $0x1,%rdi
add    $0xfffffffe,%ecx
add    $0xfffffffe,%esi
cmp    $0x3,%ecx
jg     1110 <isPalindrome+0x10>
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @flush_fp_to_thread(%struct.task_struct* nocapture %0) {
ret void
}
void put1c(c, fd) int c, fd;
{
  char sym = c;
  if (write(fd, &sym, 1) != 1)
    ;
}


x86 assembly (clang, -O0):
<put1c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0x1,%eax
je     1145 <put1c+0x35>
jmp    1145 <put1c+0x35>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put1c>:
push   %rax
mov    %esi,%eax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @put1c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32, i32* %4
%9 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %8, i8* %5, i32 1)
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @put1c(i32 %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %1, i8* %3, i32 1)
ret void
}
void anetNonBlock(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               40, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<anetNonBlock>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x28,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetNonBlock>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x28,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetNonBlock = [13 x i8] c"anetNonBlock\00"
define void @anetNonBlock() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.anetNonBlock, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetNonBlock = [13 x i8] c"anetNonBlock\00"
define void @anetNonBlock() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.anetNonBlock, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ v3();
int main(void) {
  v3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @v3()
ret i32 0
}
IR0AR1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*p0) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movzbl 0x43d11(%rcx),%ecx
cmp    %ecx,%eax
jg     1144 <IR0AR1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <IR0AR1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AR1>:
mov    (%r8),%cl
xor    %eax,%eax
cmp    0x43d11(%r9),%cl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 277777
%9 = load i8, i8* %8
%10 = icmp ule i8 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x9a() {
  Assert_real((isbdigit(154) == 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_isbdigit.c",
              775, ("isbdigit should be 0 for 0x9a"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x9a>:
push   %rax
mov    $0x9a,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x307,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x9a\00"
define void @t_isbdigit_0x9a() {
%1 = call i64 @isbdigit(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x9a\00"
define void @t_isbdigit_0x9a() {
%1 = tail call i64 @isbdigit(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}