xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int sumOfSquares = 0;
  int squareOfSum = 0;
  for (int i = 1; i <= 100; i++) {
    sumOfSquares += i * i;
    squareOfSum += i;
  }
  squareOfSum *= squareOfSum;
  printf("Sum of squares: %d\nSquare of sum: %d\nDifference: %d\n",
         sumOfSquares, squareOfSum, squareOfSum - sumOfSquares);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jg     1162 <main+0x52>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"Sum of squares: %d\0ASquare of sum: %d\0ADifference: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, %11
store i32 %13, i32* %2
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
%21 = load i32, i32* %3
%22 = load i32, i32* %3
%23 = mul nsw i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = load i32, i32* %3
%27 = load i32, i32* %2
%28 = sub nsw i32 %26, %27
%29 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i32 %28)
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str = [53 x i8] c"Sum of squares: %d\0ASquare of sum: %d\0ADifference: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 338350, i32 25502500, i32 25164150)
ret i32 0
}
int BTSHASP_PopLinenum() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @BTSHASP_PopLinenum() {
ret i32 0
}
void _mcs51_genXINIT() {}


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

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

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

LLVM IR (-O2):
define void @_mcs51_genXINIT() {
ret void
}
void platform_exit(int status __attribute__((unused)),
                   void *cookie __attribute__((unused))) {
  const char msg[] = "Solo5: Halted\n";
  platform_puts(msg, strlen(msg));
  __asm__ __volatile__("cli; hlt");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<platform_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x1f(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1f(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
mov    $0x0,%al
call   1040 <platform_puts@plt>
cli
hlt
jmp    1178 <platform_exit+0x58>

x86 assembly (clang, -O2):
<platform_exit>:
push   %rbx
sub    $0x10,%rsp
movabs $0xa6465746c6148,%rax
mov    %rax,0x7(%rsp)
movabs $0x48203a356f6c6f53,%rax
3a 20 48
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <platform_puts@plt>
cli
hlt
nopl   0x0(%rax)
jmp    1160 <platform_exit+0x40>

LLVM IR (-O0):
@__const.platform_exit.msg = [15 x i8] c"Solo5: Halted\0A\00"
define void @platform_exit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [15 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast [15 x i8]* %5 to i8*
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%9 = call i64 @strlen(i8* %8)
%10 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @platform_puts to i32 (i8*, i64, ...)*)(i8* %7, i64 %9)
br label %11
11: ; preds = %11, %2
br label %11
}

LLVM IR (-O2):
@__const.platform_exit.msg = [15 x i8] c"Solo5: Halted\0A\00"
define void @platform_exit(i32 %0, i8* nocapture readnone %1) {
%3 = alloca [15 x i8]
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%5 = call i64 @strlen(i8* %4)
%6 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @platform_puts to i32 (i8*, i64, ...)*)(i8* %4, i64 %5)
br label %7
7: ; preds = %7, %2
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ gendep__register_open(char const *, int);
int /*<<< orphan*/ printf(char *, char const *);
int real_open64(char const *, int, int);
int __open64(const char *path, int flag, int mode) {
  int f;
  if (0)
    printf("open64(%s)\n", path);
  f = real_open64(path, flag, mode);
  if (f >= 0) {
    gendep__register_open(path, flag);
  }
  return f;
}


x86 assembly (clang, -O0):
<__open64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <real_open64@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     115a <__open64+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <gendep__register_open@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__open64>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <real_open64@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1140 <__open64+0x20>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <gendep__register_open@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @__open64(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @real_open64(i8* %0, i32 %1, i32 %2)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @gendep__register_open(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SetForExit();
int /*<<< orphan*/ exit(int);
void Exit(int returnCode) {
  SetForExit();
  exit(returnCode);
}


x86 assembly (clang, -O0):
<Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <SetForExit@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <SetForExit@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @SetForExit()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @Exit(i32 %0) {
%2 = tail call i32 (...) @SetForExit()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
int calib_joy(int type) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @calib_joy(i32 %0) {
ret i32 1
}
unsigned Hash(char *name, int hashSize) {
  unsigned hashval;
  for (hashval = 0; *name != '\0'; name++)
    hashval = *name + 31 * hashval;
  return hashval % hashSize;
}


x86 assembly (clang, -O0):
<Hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <Hash+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <Hash+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <Hash+0x29>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <Hash+0x10>
jmp    112b <Hash+0x2b>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul i32 %7, 31
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_token(char const *);
int lookup_set_token(char *);
int parse_single_set(const char *p) {
  int s = -9999;
  char *t = get_token(p);
  if (t) {
    s = lookup_set_token(t);
    free(t);
  }
  return s;
}


x86 assembly (clang, -O0):
<parse_single_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffd8f1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_token@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1170 <parse_single_set+0x40>
mov    -0x18(%rbp),%rdi
call   1040 <lookup_set_token@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_single_set>:
push   %rbp
push   %rbx
push   %rax
call   1050 <get_token@plt>
test   %rax,%rax
je     1156 <parse_single_set+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <lookup_set_token@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115b <parse_single_set+0x2b>
mov    $0xffffd8f1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_single_set(i8* %0) {
%2 = tail call i8* @get_token(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @lookup_set_token(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %5, %4 ], [ -9999, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int pthread_self();
int /*<<< orphan*/ terminateConnection(int);
void analyzeReadError(int acceptedFileDescriptor, int bytesReceived) {
  if (bytesReceived == 0) {
    printf("Client closed connection. Current thread id: %d.\n",
           pthread_self());
  } else {
    printf("Error with receiving information\n");
  }
  terminateConnection(acceptedFileDescriptor);
}


x86 assembly (clang, -O0):
<analyzeReadError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1164 <analyzeReadError+0x34>
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1172 <analyzeReadError+0x42>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <terminateConnection@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<analyzeReadError>:
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
je     1155 <analyzeReadError+0x15>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
jmp    116c <analyzeReadError+0x2c>
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <terminateConnection@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Client closed connection. Current thread id: %d.\0A\00"
@.str.1 = [34 x i8] c"Error with receiving information\0A\00"
define void @analyzeReadError(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 (...) @pthread_self()
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %3
%14 = call i32 @terminateConnection(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Client closed connection. Current thread id: %d.\0A\00"
@str = [33 x i8] c"Error with receiving information\00"
define void @analyzeReadError(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @pthread_self()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
%10 = tail call i32 @terminateConnection(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ parse_number_expression(char *, int *);
int /*<<< orphan*/ srand(int);
void cmd_seed(char *args) {
  int seed;
  if (parse_number_expression(args, &seed)) {
    srand(seed);
  }
}


x86 assembly (clang, -O0):
<cmd_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <parse_number_expression@plt>
cmp    $0x0,%rax
je     114b <cmd_seed+0x2b>
mov    -0xc(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_seed>:
push   %rax
lea    0x4(%rsp),%rsi
call   1040 <parse_number_expression@plt>
test   %rax,%rax
je     1139 <cmd_seed+0x19>
mov    0x4(%rsp),%edi
call   1030 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @cmd_seed(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @parse_number_expression(i8* %4, i32* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @srand(i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @cmd_seed(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @parse_number_expression(i8* %0, i32* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @srand(i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sync();
int main(int argc, char *argv[]) {
  printf("Syncing disks... ");
  sync();
  printf("done.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <sync@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <sync@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Syncing disks... \00"
@.str.1 = [7 x i8] c"done.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @sync()
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Syncing disks... \00"
@str = [6 x i8] c"done.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @sync()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _my_getopt_internal(int, char **, char const *, struct option const *,
                        int *, int /*<<< orphan*/);
int my_getopt_long(int argc, char *argv[], const char *shortopts,
                   const struct option *longopts, int *longind) {
  return _my_getopt_internal(argc, argv, shortopts, longopts, longind, 0);
}


x86 assembly (clang, -O0):
<my_getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <_my_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getopt_long>:
xor    %r9d,%r9d
jmp    1030 <_my_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @my_getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_my_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @my_getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_my_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int arr[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
void Default_I2S_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Default_I2S_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int finite(double x) {
  int hx;
  hx = *(1 + (const int *)&x);
  return (unsigned)((hx & 0x7fffffff) - 0x7ff00000) >> 31;
}


x86 assembly (clang, -O0):
<finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
sub    $0x7ff00000,%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finite>:
movq   %xmm0,%rax
shr    $0x20,%rax
and    $0x7fffffff,%eax
add    $0x80100000,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @finite(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = bitcast double* %2 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 2147483647
%9 = sub nsw i32 %8, 2146435072
%10 = lshr i32 %9, 31
ret i32 %10
}

LLVM IR (-O2):
define i32 @finite(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 2147483647
%6 = add nsw i32 %5, -2146435072
%7 = lshr i32 %6, 31
ret i32 %7
}
void XProcessInternalConnection() {}


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

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

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

LLVM IR (-O2):
define void @XProcessInternalConnection() {
ret void
}
void enterPropSysPatch(void) {}


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

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

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

LLVM IR (-O2):
define void @enterPropSysPatch() {
ret void
}
unsigned char readByteFromPort(unsigned short portNumber) {
  unsigned char readByte;
  asm volatile("inb %1, %0" : "=a"(readByte) : "dN"(portNumber));
  return readByte;
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @readByteFromPort(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
int BAD(int start, char *dest) {
  (void)dest;
  return start;
}


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

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

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

LLVM IR (-O2):
define i32 @BAD(i32 returned %0, i8* nocapture readnone %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ handle_43(int /*<<< orphan*/);
int gen_43(void) {
  handle_43(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_43() {
%1 = call i32 @handle_43(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_43() {
%1 = tail call i32 @handle_43(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void pexit(char const *id) {
  perror(id);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pexit>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @pexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @pexit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int random();
int randint() {
  register int q;
  register int x;
  q = random();
  x = ((q >> 8) & 0xff);
  x = q ^ x;
  return (x);
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
movzbl %ah,%ecx
xor    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randint() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @random()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = xor i32 %7, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @randint() {
%1 = tail call i32 (...) @random()
%2 = lshr i32 %1, 8
%3 = and i32 %2, 255
%4 = xor i32 %3, %1
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ nios_pkt_8x32_unpack(int const *, int *, int *, int *,
                                        int /*<<< orphan*/ *);
void nios_pkt_8x32_resp_unpack(const uint8_t *buf, uint8_t *target, bool *write,
                               uint8_t *addr, uint32_t *data, bool *success) {
  nios_pkt_8x32_unpack(buf, target, write, addr, data);
  if ((buf[2] & (1 << 1)) != 0) {
    *success = true;
  } else {
    *success = false;
  }
}


x86 assembly (clang, -O0):
<nios_pkt_8x32_resp_unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <nios_pkt_8x32_unpack@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     116b <nios_pkt_8x32_resp_unpack+0x5b>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
jmp    1175 <nios_pkt_8x32_resp_unpack+0x65>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_pkt_8x32_resp_unpack>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %rdi,%rbx
call   1030 <nios_pkt_8x32_unpack@plt>
mov    0x8(%rbx),%eax
shr    %eax
and    $0x1,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @nios_pkt_8x32_resp_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* nocapture writeonly %5) {
%7 = tail call i32 @nios_pkt_8x32_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = lshr i32 %9, 1
%11 = and i32 %10, 1
store i32 %11, i32* %5
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ mrand48();
long lrand48(void) { return (long)((uint32_t)mrand48() >> 1); }


x86 assembly (clang, -O0):
<lrand48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mrand48@plt>
sar    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrand48>:
push   %rax
xor    %eax,%eax
call   1030 <mrand48@plt>
sar    %eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @lrand48() {
%1 = call i64 (...) @mrand48()
%2 = trunc i64 %1 to i32
%3 = ashr i32 %2, 1
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @lrand48() {
%1 = tail call i64 (...) @mrand48()
%2 = trunc i64 %1 to i32
%3 = ashr i32 %2, 1
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "uniq"
        " [-c|-d|-u][-f fields][-s char][input_file [output_file]]\n  "
        "-c	Precede each output line with a count of the repetitions for "
        "the line\n  -d	Suppress the writing of lines that are not repeated\n  "
        "-s	Ignore the first char characters when doing comparisons\n  "
        "-u	Suppress the writing of lines that are repeated\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [316 x i8] c"Usage: uniq [-c|-d|-u][-f fields][-s char][input_file [output_file]]\0A -c\09Precede each output line with a count of the repetitions for the line\0A -d\09Suppress the writing of lines that are not repeated\0A -s\09Ignore the first char characters when doing comparisons\0A -u\09Suppress the writing of lines that are repeated\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [316 x i8] c"Usage: uniq [-c|-d|-u][-f fields][-s char][input_file [output_file]]\0A -c\09Precede each output line with a count of the repetitions for the line\0A -d\09Suppress the writing of lines that are not repeated\0A -s\09Ignore the first char characters when doing comparisons\0A -u\09Suppress the writing of lines that are repeated\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
unsigned int scan_ulong(register const char *s, register unsigned long *u) {
  register unsigned int pos = 0;
  register unsigned long result = 0;
  register unsigned long c;
  while ((c = (unsigned long)(unsigned char)(s[pos] - '0')) < 10) {
    result = result * 10 + c;
    ++pos;
  }
  *u = result;
  return pos;
}


x86 assembly (clang, -O0):
<scan_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
movzbl %al,%eax
mov    %rax,-0x28(%rbp)
cmp    $0xa,%rax
jae    1155 <scan_ulong+0x55>
imul   $0xa,-0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <scan_ulong+0x1b>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_ulong>:
mov    (%rdi),%dl
add    $0xd0,%dl
cmp    $0x9,%dl
ja     112e <scan_ulong+0x2e>
xor    %eax,%eax
xor    %ecx,%ecx
xchg   %ax,%ax
movzbl %dl,%edx
lea    (%rcx,%rcx,4),%rcx
lea    (%rdx,%rcx,2),%rcx
add    $0x1,%eax
movzbl (%rdi,%rax,1),%edx
add    $0xd0,%dl
cmp    $0xa,%dl
jb     1110 <scan_ulong+0x10>
mov    %rcx,(%rsi)
ret
xor    %ecx,%ecx
xor    %eax,%eax
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @scan_ulong(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %19
6: ; preds = %2, %6
%7 = phi i8 [ %17, %6 ], [ %4, %2 ]
%8 = phi i32 [ %13, %6 ], [ 0, %2 ]
%9 = phi i64 [ %12, %6 ], [ 0, %2 ]
%10 = zext i8 %7 to i64
%11 = mul i64 %9, 10
%12 = add i64 %11, %10
%13 = add i32 %8, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = add i8 %16, -48
%18 = icmp ult i8 %17, 10
br i1 %18, label %6, label %19
19: ; preds = %6, %2
%20 = phi i64 [ 0, %2 ], [ %12, %6 ]
%21 = phi i32 [ 0, %2 ], [ %13, %6 ]
store i64 %20, i64* %1
ret i32 %21
}
/* Variables and functions */
int f1();
int main() {
  int y;
  y = f1();
  return (0);
ERROR:
  return (-1);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @f1()
store i32 %3, i32* %2
store i32 0, i32* %1
br label %5
4: ; No predecessors!
store i32 -1, i32* %1
br label %5
5: ; preds = %4, %0
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
ret i32 0
}
int checkForComments(char *line) {
  int moveon = 0;
  if (line[0] == '#') {
    moveon = 1;
  } else if (line[0] == '%') {
    moveon = 1;
  } else if (line[0] == '\n') {
    moveon = 1;
  }
  return moveon;
}


x86 assembly (clang, -O0):
<checkForComments>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    112b <checkForComments+0x2b>
movl   $0x1,-0xc(%rbp)
jmp    1168 <checkForComments+0x68>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    1147 <checkForComments+0x47>
movl   $0x1,-0xc(%rbp)
jmp    1163 <checkForComments+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    115e <checkForComments+0x5e>
movl   $0x1,-0xc(%rbp)
jmp    1163 <checkForComments+0x63>
jmp    1168 <checkForComments+0x68>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkForComments>:
movzbl (%rdi),%ecx
cmp    $0x25,%rcx
ja     111f <checkForComments+0x1f>
mov    $0x1,%eax
movabs $0x2800000400,%rdx
bt     %rcx,%rdx
jae    111f <checkForComments+0x1f>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @checkForComments(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 35, label %4
i8 37, label %4
i8 10, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3
%5 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 0, %3 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int INT_MAX;
void *realloc(void *, unsigned int);
void *av_realloc(void *ptr, unsigned int size) {
  if (size > (INT_MAX - 16))
    return NULL;
  return realloc(ptr, size);
}


x86 assembly (clang, -O0):
<av_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x10,%ecx
cmp    %ecx,%eax
jbe    1143 <av_realloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1153 <av_realloc+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_realloc>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
add    $0xfffffff0,%eax
cmp    %esi,%eax
jae    1123 <av_realloc+0x13>
xor    %eax,%eax
ret
jmp    1030 <realloc@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i8* @av_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* @INT_MAX
%8 = sub nsw i32 %7, 16
%9 = icmp ugt i32 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i8* @realloc(i8* %12, i32 %13)
store i8* %14, i8** %3
br label %15
15: ; preds = %11, %10
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i8* @av_realloc(i8* %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = add nsw i32 %3, -16
%5 = icmp ult i32 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i32 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
void gtk_image_new_from_stock() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_new_from_stock() {
ret void
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int get_serial_nr();
int wrap_get_serial_nr(struct activity *a) {
  int n = 0;
  if ((n = get_serial_nr()) > 0)
    return n + 2;
  return 0;
}


x86 assembly (clang, -O0):
<wrap_get_serial_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <get_serial_nr@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    1144 <wrap_get_serial_nr+0x34>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <wrap_get_serial_nr+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_get_serial_nr>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_serial_nr@plt>
lea    0x2(%rax),%ecx
test   %eax,%eax
cmovle %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.activity = type { i32 }
define i32 @wrap_get_serial_nr(%struct.activity* %0) {
%2 = alloca i32
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 0, i32* %4
%5 = call i32 (...) @get_serial_nr()
store i32 %5, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 2
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define i32 @wrap_get_serial_nr(%struct.activity* nocapture readnone %0) {
%2 = tail call i32 (...) @get_serial_nr()
%3 = icmp sgt i32 %2, 0
%4 = add nsw i32 %2, 2
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *);
void printStrAt(WINDOW *window, int xloc, int yloc, char *str) {
  mvwprintw(window, yloc, xloc, str);
}


x86 assembly (clang, -O0):
<printStrAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <mvwprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStrAt>:
mov    %esi,%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <mvwprintw@plt>

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

LLVM IR (-O2):
define void @printStrAt(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @mvwprintw(i32* %0, i32 %2, i32 %1, i8* %3)
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzAdapt_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
void BrzAdapt_ackdown(struct comp *comp, int port) {
  struct BrzAdapt_ *c = (struct BrzAdapt_ *)comp;
  SEND_ACKDOWN_DELAYED(0, 0);
}


x86 assembly (clang, -O0):
<BrzAdapt_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzAdapt_ackdown>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <SEND_ACKDOWN_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzAdapt_ = type { i32 }
define void @BrzAdapt_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzAdapt_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzAdapt_*
store %struct.BrzAdapt_* %7, %struct.BrzAdapt_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzAdapt_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
ret void
}