xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_cursor_offset();
int get_offset_col(int);
int get_offset_row(int);
int /*<<< orphan*/ print_char(int, int, int, int);
void display_backspace() {
  int offset = get_cursor_offset() - 2;
  int row = get_offset_row(offset);
  int col = get_offset_col(offset);
  print_char(0x08, col, row, 0x0f);
}


x86 assembly (clang, -O0):
<display_backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_cursor_offset@plt>
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <get_offset_row@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_offset_col@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x8,%edi
mov    $0xf,%ecx
call   1050 <print_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_backspace>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <get_cursor_offset@plt>
lea    -0x2(%rax),%ebx
mov    %ebx,%edi
call   1060 <get_offset_row@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <get_offset_col@plt>
mov    $0x8,%edi
mov    %eax,%esi
mov    %ebp,%edx
mov    $0xf,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <print_char@plt>

LLVM IR (-O0):
define void @display_backspace() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @get_cursor_offset()
%5 = sub nsw i32 %4, 2
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @get_offset_row(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = call i32 @get_offset_col(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = call i32 @print_char(i32 8, i32 %10, i32 %11, i32 15)
ret void
}

LLVM IR (-O2):
define void @display_backspace() {
%1 = tail call i32 (...) @get_cursor_offset()
%2 = add nsw i32 %1, -2
%3 = tail call i32 @get_offset_row(i32 %2)
%4 = tail call i32 @get_offset_col(i32 %2)
%5 = tail call i32 @print_char(i32 8, i32 %4, i32 %3, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SBC_(int);
int /*<<< orphan*/ c64_memZero();
void SBC_zp(void) {
  c64_memZero();
  SBC_(1);
}


x86 assembly (clang, -O0):
<SBC_zp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c64_memZero@plt>
mov    $0x1,%edi
call   1040 <SBC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SBC_zp>:
push   %rax
xor    %eax,%eax
call   1030 <c64_memZero@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <SBC_@plt>

LLVM IR (-O0):
define void @SBC_zp() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 @SBC_(i32 1)
ret void
}

LLVM IR (-O2):
define void @SBC_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 @SBC_(i32 1)
ret void
}
void destroy_gothmog() { return; }


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

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

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

LLVM IR (-O2):
define void @destroy_gothmog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: chat [-esSvV] [-f chat-file] [-r report-file] [-t timeout]\n"
          "            [-T phone-number] [-U phone-number2] [chat-script]\n"
          "where chat-script has the form:\n"
          "            [...[[expect[-send[-expect...]] send "
          "expect[-send[-expect]] ...]]]\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 = [241 x i8] c"Usage: chat [-esSvV] [-f chat-file] [-r report-file] [-t timeout]\0A [-T phone-number] [-U phone-number2] [chat-script]\0Awhere chat-script has the form:\0A [...[[expect[-send[-expect...]] send expect[-send[-expect]] ...]]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([241 x i8], [241 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [241 x i8] c"Usage: chat [-esSvV] [-f chat-file] [-r report-file] [-t timeout]\0A [-T phone-number] [-U phone-number2] [chat-script]\0Awhere chat-script has the form:\0A [...[[expect[-send[-expect...]] send expect[-send[-expect]] ...]]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([241 x i8], [241 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int g(int a, int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int get_file_size(FILE *fp) {
  assert(fp != NULL);
  int original = ftell(fp);
  fseek(fp, 0, SEEK_END);
  int size = ftell(fp);
  fseek(fp, original, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e50(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%r14d
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%ebp
mov    0x2e64(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1050 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @get_file_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %2
%10 = call i32 @ftell(i32* %9)
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = load i32, i32* @SEEK_END
%13 = call i32 @fseek(i32* %11, i32 0, i32 %12)
%14 = load i32*, i32** %2
%15 = call i32 @ftell(i32* %14)
store i32 %15, i32* %4
%16 = load i32*, i32** %2
%17 = load i32, i32* %3
%18 = load i32, i32* @SEEK_SET
%19 = call i32 @fseek(i32* %16, i32 %17, i32 %18)
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @get_file_size(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_END
%7 = tail call i32 @fseek(i32* %0, i32 0, i32 %6)
%8 = tail call i32 @ftell(i32* %0)
%9 = load i32, i32* @SEEK_SET
%10 = tail call i32 @fseek(i32* %0, i32 %5, i32 %9)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *cmd) {
  printf("Usage:\n"
         "\t%s <n>{s,m,h,D,M,Y} ...\n",
         cmd);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage:\0A\09%s <n>{s,m,h,D,M,Y} ...\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage:\0A\09%s <n>{s,m,h,D,M,Y} ...\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double MRtoSH(double MR) {
  double SH = MR / 1 + MR;
  return SH;
}


x86 assembly (clang, -O0):
<MRtoSH>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MRtoSH>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @MRtoSH(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.000000e+00
%6 = load double, double* %2
%7 = fadd double %5, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @MRtoSH(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
int getlinex(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = getlinex(line, 1000)) > 0) {
    if (len > 80) {
      printf("%s", line);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <getlinex@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <getlinex@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <getlinex@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getlinex(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getlinex(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
void rop3_0_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = 0;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_0_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_0_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i8 0, i8* %7
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = and i32 %20, %22
%24 = or i32 %17, %23
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = or i32 %24, %30
%32 = trunc i32 %31 to i8
%33 = load i8*, i8** %4
store i8 %32, i8* %33
ret void
}

LLVM IR (-O2):
define void @rop3_0_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Bubble(int);
int main() {
  int i;
  for (i = 0; i < 100; i++)
    Bubble(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <Bubble@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <Bubble@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @Bubble(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int is_valid_in_PreAllocGrp(size_t __tag) {
  switch (__tag) {
  case 79:
  case 661:
  case 736:
  case 467:
  case 539:
  case 80:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_in_PreAllocGrp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
add    $0xffffffffffffffb1,%rax
sub    $0x2,%rax
jb     1177 <is_valid_in_PreAllocGrp+0x77>
jmp    1123 <is_valid_in_PreAllocGrp+0x23>
mov    -0x18(%rbp),%rax
sub    $0x1d3,%rax
je     1177 <is_valid_in_PreAllocGrp+0x77>
jmp    1138 <is_valid_in_PreAllocGrp+0x38>
mov    -0x18(%rbp),%rax
sub    $0x21b,%rax
je     1177 <is_valid_in_PreAllocGrp+0x77>
jmp    114d <is_valid_in_PreAllocGrp+0x4d>
mov    -0x18(%rbp),%rax
sub    $0x295,%rax
je     1177 <is_valid_in_PreAllocGrp+0x77>
jmp    1162 <is_valid_in_PreAllocGrp+0x62>
mov    -0x18(%rbp),%rax
sub    $0x2e0,%rax
jne    1183 <is_valid_in_PreAllocGrp+0x83>
jmp    1177 <is_valid_in_PreAllocGrp+0x77>
movl   $0x1,-0x4(%rbp)
jmp    118a <is_valid_in_PreAllocGrp+0x8a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_in_PreAllocGrp>:
mov    $0x1,%eax
cmp    $0x21a,%rdi
jg     1119 <is_valid_in_PreAllocGrp+0x19>
lea    -0x4f(%rdi),%rcx
cmp    $0x2,%rcx
jae    1136 <is_valid_in_PreAllocGrp+0x36>
ret
cmp    $0x21b,%rdi
je     1118 <is_valid_in_PreAllocGrp+0x18>
cmp    $0x295,%rdi
je     1118 <is_valid_in_PreAllocGrp+0x18>
cmp    $0x2e0,%rdi
je     1118 <is_valid_in_PreAllocGrp+0x18>
jmp    113f <is_valid_in_PreAllocGrp+0x3f>
cmp    $0x1d3,%rdi
je     1118 <is_valid_in_PreAllocGrp+0x18>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_in_PreAllocGrp(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %6 [
i64 79, label %5
i64 661, label %5
i64 736, label %5
i64 467, label %5
i64 539, label %5
i64 80, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_valid_in_PreAllocGrp(i64 %0) {
switch i64 %0, label %2 [
i64 79, label %3
i64 661, label %3
i64 736, label %3
i64 467, label %3
i64 539, label %3
i64 80, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *to_chinese(int);
char *to_english(int);
int main(void) {
  printf("%s\n", to_chinese(3));
  printf("%s\n", to_english(3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <to_chinese@plt>
mov    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <to_english@plt>
mov    %rax,%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1040 <to_chinese@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <to_english@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = call i8* @to_chinese(i32 3)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i8* @to_english(i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @to_chinese(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @to_english(i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ z_stream;

/* Variables and functions */
int /*<<< orphan*/ Z_FULL_FLUSH;
int deflate(int /*<<< orphan*/ *, int /*<<< orphan*/);
int streaming_commons_call_deflate_full_flush(z_stream *stream) {
  return deflate(stream, Z_FULL_FLUSH);
}


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

x86 assembly (clang, -O2):
<streaming_commons_call_deflate_full_flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <deflate@plt>

LLVM IR (-O0):
@Z_FULL_FLUSH = global i32 0
define i32 @streaming_commons_call_deflate_full_flush(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @Z_FULL_FLUSH
%5 = call i32 @deflate(i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@Z_FULL_FLUSH = global i32 0
define i32 @streaming_commons_call_deflate_full_flush(i32* %0) {
%2 = load i32, i32* @Z_FULL_FLUSH
%3 = tail call i32 @deflate(i32* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fwd();
void move_forward() { fwd(); }


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

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

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

LLVM IR (-O2):
define void @move_forward() {
%1 = tail call i32 (...) @fwd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutBitmapString(void *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, double);
void glutBitmapDouble(void *fontface, double i) {
  char buf[64];
  snprintf(buf, 64, "%.2g", i);
  glutBitmapString(fontface, buf);
}


x86 assembly (clang, -O0):
<glutBitmapDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    $0x40,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <glutBitmapString@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutBitmapDouble>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <glutBitmapString@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.2g\00"
define void @glutBitmapDouble(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [64 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @glutBitmapString(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2g\00"
define void @glutBitmapDouble(i8* %0, double %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %1)
%6 = call i32 @glutBitmapString(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *ft_memalloc(size_t size) {
  void *ans;
  if (!(ans = malloc(size)))
    return (NULL);
  while (size-- > 0)
    *((unsigned char *)(ans + size)) = 0;
  return (ans);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1140 <ft_memalloc+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1177 <ft_memalloc+0x67>
jmp    1145 <ft_memalloc+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    116f <ft_memalloc+0x5f>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1145 <ft_memalloc+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1146 <ft_memalloc+0x26>
test   %r14,%r14
je     1146 <ft_memalloc+0x26>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_memalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* null, i8** %2
br label %20
9: ; preds = %1
br label %10
10: ; preds = %14, %9
%11 = load i64, i64* %3
%12 = add i64 %11, -1
store i64 %12, i64* %3
%13 = icmp ugt i64 %11, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = load i64, i64* %3
%17 = getelementptr i8, i8* %15, i64 %16
store i8 0, i8* %17
br label %10
18: ; preds = %10
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %8
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @ft_memalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp eq i64 %0, 0
%5 = or i1 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %1
br label %7
7: ; preds = %6, %1
ret i8* %2
}
int cycapsense_reset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cycapsense_reset() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void exitLogError() {
  printf("%sLog file error, shutting down.\n%s", "\e[1;31m", "\e[0m");
  exit(0);
}


x86 assembly (clang, -O0):
<exitLogError>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xef3(%rip),%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitLogError>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef5(%rip),%rsi
lea    0xef6(%rip),%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"%sLog file error, shutting down.\0A%s\00"
@.str.1 = [8 x i8] c"\1B[1;31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @exitLogError() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [36 x i8] c"%sLog file error, shutting down.\0A%s\00"
@.str.1 = [8 x i8] c"\1B[1;31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @exitLogError() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __fcntl(int fd, int cmd) {
  if (fd < 0) {
    __set_errno(EBADF);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__fcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1142 <__fcntl+0x32>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <__fcntl+0x47>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fcntl>:
push   %rax
test   %edi,%edi
jns    111e <__fcntl+0xe>
mov    0x2ebc(%rip),%rax
jmp    1125 <__fcntl+0x15>
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @__fcntl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EBADF
%10 = call i32 @__set_errno(i32 %9)
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* @ENOSYS
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @__fcntl(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = load i32, i32* @EBADF
%5 = load i32, i32* @ENOSYS
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
void start_score() {}


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

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

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

LLVM IR (-O2):
define void @start_score() {
ret void
}
int nextchar(char *a, int i) {
  while (a[i] == ' ' || a[i] == '\t')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<nextchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     113a <nextchar+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <nextchar+0x4a>
jmp    1158 <nextchar+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <nextchar+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextchar>:
mov    %esi,%eax
movslq %esi,%rcx
add    %rdi,%rcx
jmp    1117 <nextchar+0x17>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x20,%dl
je     1110 <nextchar+0x10>
cmp    $0x9,%dl
je     1110 <nextchar+0x10>
ret

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

LLVM IR (-O2):
define i32 @nextchar(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %8, %2
%5 = phi i64 [ %9, %8 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %10 [
i8 32, label %8
i8 9, label %8
]
8: ; preds = %4, %4
%9 = add i64 %5, 1
br label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Variables and functions */
int tswitch();
int ktswitch() { return tswitch(); }


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

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

LLVM IR (-O0):
define i32 @ktswitch() {
%1 = call i32 (...) @tswitch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @ktswitch() {
%1 = tail call i32 (...) @tswitch()
ret i32 %1
}
/* Variables and functions */
scalar_t__ getmem(size_t, int);
float *rgetmem(const int leng) {
  return ((float *)getmem((size_t)leng, sizeof(float)));
}


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

x86 assembly (clang, -O2):
<rgetmem>:
movslq %edi,%rdi
mov    $0x4,%esi
jmp    1030 <getmem@plt>

LLVM IR (-O0):
define float* @rgetmem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = call i64 @getmem(i64 %4, i32 4)
%6 = inttoptr i64 %5 to float*
ret float* %6
}

LLVM IR (-O2):
define float* @rgetmem(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 @getmem(i64 %2, i32 4)
%4 = inttoptr i64 %3 to float*
ret float* %4
}
/* Variables and functions */
void CL_ConsolePrint(char *txt) {}


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

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

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

LLVM IR (-O2):
define void @CL_ConsolePrint(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char const *gai_strerror(int);
char const *strerror(int);
const char *os_strerror(int error) {
  if (error & (1 << 16))
    return gai_strerror(-(error & ~(1 << 16)));
  return strerror(error);
}


x86 assembly (clang, -O0):
<os_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1156 <os_strerror+0x36>
mov    -0xc(%rbp),%eax
and    $0xfffeffff,%eax
xor    %edi,%edi
sub    %eax,%edi
call   1030 <gai_strerror@plt>
mov    %rax,-0x8(%rbp)
jmp    1162 <os_strerror+0x42>
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_strerror>:
test   $0x10000,%edi
jne    112d <os_strerror+0xd>
jmp    1040 <strerror@plt>
and    $0xfffeffff,%edi
neg    %edi
jmp    1030 <gai_strerror@plt>

LLVM IR (-O0):
define i8* @os_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 65536
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, -65537
%10 = sub nsw i32 0, %9
%11 = call i8* @gai_strerror(i32 %10)
store i8* %11, i8** %2
br label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i8* @strerror(i32 %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %7
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @os_strerror(i32 %0) {
%2 = and i32 %0, 65536
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = and i32 %0, -65537
%6 = sub nsw i32 0, %5
%7 = tail call i8* @gai_strerror(i32 %6)
br label %10
8: ; preds = %1
%9 = tail call i8* @strerror(i32 %0)
br label %10
10: ; preds = %8, %4
%11 = phi i8* [ %7, %4 ], [ %9, %8 ]
ret i8* %11
}
void psi_set_uint16_be(void *buf, unsigned idx, unsigned val) {
  unsigned char *tmp;
  tmp = (unsigned char *)buf + idx;
  tmp[0] = (val >> 8) & 0xff;
  tmp[1] = val & 0xff;
}


x86 assembly (clang, -O0):
<psi_set_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_set_uint16_be>:
mov    %esi,%eax
rol    $0x8,%dx
mov    %dx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @psi_set_uint16_be(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
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 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8* %11, i8** %7
%12 = load i32, i32* %6
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
%18 = load i32, i32* %6
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
ret void
}

LLVM IR (-O2):
define void @psi_set_uint16_be(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = lshr i32 %2, 8
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = trunc i32 %2 to i8
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %9
ret void
}
/* Variables and functions */
scalar_t__ is_divisible_by_all_to(long, int);
int /*<<< orphan*/ printf(char *, long);
int problem5(void) {
  long i;
  for (i = 20; is_divisible_by_all_to(i, 20) == 0; i += 20)
    ;
  printf("The smallest number divisible by all numbers from 1 to 20 is %ld\n",
         i);
  return 0;
}


x86 assembly (clang, -O0):
<problem5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x14,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x14,%esi
call   1040 <is_divisible_by_all_to@plt>
cmp    $0x0,%rax
jne    115e <problem5+0x3e>
jmp    114d <problem5+0x2d>
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <problem5+0x10>
mov    -0x8(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem5>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x14,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <is_divisible_by_all_to@plt>
test   %rax,%rax
je     1130 <problem5+0x10>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [66 x i8] c"The smallest number divisible by all numbers from 1 to 20 is %ld\0A\00"
define i32 @problem5() {
%1 = alloca i64
store i64 20, i64* %1
br label %2
2: ; preds = %7, %0
%3 = load i64, i64* %1
%4 = call i64 @is_divisible_by_all_to(i64 %3, i32 20)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = load i64, i64* %1
%9 = add nsw i64 %8, 20
store i64 %9, i64* %1
br label %2
10: ; preds = %2
%11 = load i64, i64* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i64 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [66 x i8] c"The smallest number divisible by all numbers from 1 to 20 is %ld\0A\00"
define i32 @problem5() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 20, %0 ], [ %5, %1 ]
%3 = tail call i64 @is_divisible_by_all_to(i64 %2, i32 20)
%4 = icmp eq i64 %3, 0
%5 = add nuw nsw i64 %2, 20
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void checkMalloc(void *ptr) {
  if (ptr == NULL) {
    perror("Malloc failed");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <checkMalloc+0x31>
lea    0xec2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkMalloc>:
test   %rdi,%rdi
je     1126 <checkMalloc+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Malloc failed\00"
@EXIT_FAILURE = global i32 0
define void @checkMalloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Malloc failed\00"
@EXIT_FAILURE = global i32 0
define void @checkMalloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
void __DELETE_org_apache_harmony_niochar_CharsetProviderImpl(
    void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_org_apache_harmony_niochar_CharsetProviderImpl(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_niochar_CharsetProviderImpl(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void lowercase(char *s) {
  int c;
  while ((c = *s++))
    if (c >= 'A' && c <= 'Z')
      *(s - 1) = c + 'a' - 'A';
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1151 <lowercase+0x51>
cmpl   $0x41,-0xc(%rbp)
jl     114c <lowercase+0x4c>
cmpl   $0x5a,-0xc(%rbp)
jg     114c <lowercase+0x4c>
mov    -0xc(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,-0x1(%rax)
jmp    1108 <lowercase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
mov    (%rdi),%al
test   %al,%al
je     112a <lowercase+0x2a>
add    $0x1,%rdi
jmp    111b <lowercase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <lowercase+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <lowercase+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <lowercase+0x10>
ret

LLVM IR (-O0):
define void @lowercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %23, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %4
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 97
%19 = sub nsw i32 %18, 65
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 -1
store i8 %20, i8* %22
br label %23
23: ; preds = %16, %13, %10
br label %4
24: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %13, %12 ], [ %2, %1 ]
%6 = phi i8* [ %7, %12 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i8 %5, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = add nuw nsw i8 %5, 32
store i8 %11, i8* %6
br label %12
12: ; preds = %10, %4
%13 = load i8, i8* %7
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %12, %1
ret void
}
int iwl3945_led_register(struct iwl_priv *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define i32 @iwl3945_led_register(%struct.iwl_priv* nocapture readnone %0) {
ret i32 0
}
int lg2(int i) {
  int r = 0;
  while ((i >>= 1) != 0)
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<lg2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <lg2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <lg2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lg2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <lg2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <lg2+0x10>
ret

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

LLVM IR (-O2):
define i32 @lg2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ access_filesystem();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unaddr_open();
int /*<<< orphan*/ uninit_open(int);
int main(void) {
  access_filesystem();
  unaddr_open();
  uninit_open(1);
  uninit_open(0);
  printf("done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <access_filesystem@plt>
mov    $0x0,%al
call   1060 <unaddr_open@plt>
mov    $0x1,%edi
call   1040 <uninit_open@plt>
xor    %edi,%edi
call   1040 <uninit_open@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <access_filesystem@plt>
xor    %eax,%eax
call   1060 <unaddr_open@plt>
mov    $0x1,%edi
call   1040 <uninit_open@plt>
xor    %edi,%edi
call   1040 <uninit_open@plt>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"done\00"
define i32 @main() {
%1 = tail call i32 (...) @access_filesystem()
%2 = tail call i32 (...) @unaddr_open()
%3 = tail call i32 @uninit_open(i32 1)
%4 = tail call i32 @uninit_open(i32 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}