xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_begin_write() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_begin_write"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_stream_begin_write\0A\00"
define i32 @pa_stream_begin_write() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_stream_begin_write\00"
define i32 @pa_stream_begin_write() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int WC_Main(int, char **);
int main(int argc, char **argv) { return WC_Main(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <WC_Main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <WC_Main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @WC_Main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @WC_Main(i32 %0, i8** %1)
ret i32 %3
}
OP(fd, a7) { op_a7(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a7()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ cmd_8042(int);
char read_8042();
char read_8042_cmd_byte(void) {
  cmd_8042(0x20);
  return read_8042();
}


x86 assembly (clang, -O0):
<read_8042_cmd_byte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <cmd_8042@plt>
mov    $0x0,%al
call   1040 <read_8042@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_8042_cmd_byte>:
push   %rax
mov    $0x20,%edi
call   1030 <cmd_8042@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <read_8042@plt>

LLVM IR (-O0):
define signext i8 @read_8042_cmd_byte() {
%1 = call i32 @cmd_8042(i32 32)
%2 = call signext i8 (...) @read_8042()
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @read_8042_cmd_byte() {
%1 = tail call i32 @cmd_8042(i32 32)
%2 = tail call signext i8 (...) @read_8042()
ret i8 %2
}
/* Variables and functions */
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void flush_RX_FIFO_pointer() {
  short int temp;
  temp = read_ZIGBEE_short(0x0D);
  temp = temp | 0x01;
  write_ZIGBEE_short(0x0D, temp);
}


x86 assembly (clang, -O0):
<flush_RX_FIFO_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xd,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
or     $0x1,%eax
mov    %ax,-0x2(%rbp)
mov    $0xd,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_RX_FIFO_pointer>:
push   %rax
mov    $0xd,%edi
call   1030 <read_ZIGBEE_short@plt>
or     $0x1,%eax
movswl %ax,%esi
mov    $0xd,%edi
pop    %rax
jmp    1040 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @flush_RX_FIFO_pointer() {
%1 = alloca i16
%2 = call signext i16 @read_ZIGBEE_short(i32 13)
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = or i32 %4, 1
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @write_ZIGBEE_short(i32 13, i16 signext %7)
ret void
}

LLVM IR (-O2):
define void @flush_RX_FIFO_pointer() {
%1 = tail call signext i16 @read_ZIGBEE_short(i32 13)
%2 = or i16 %1, 1
%3 = tail call i32 @write_ZIGBEE_short(i32 13, i16 signext %2)
ret void
}
/* Variables and functions */
int factorial(unsigned short);
int product(int, int);
int choose(int n, unsigned short k) {
  if (k > n - k)
    k = n - k;
  return product(n - k + 1, n) / factorial(k);
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
mov    -0x4(%rbp),%ecx
movzwl -0x6(%rbp),%edx
sub    %edx,%ecx
cmp    %ecx,%eax
jle    1154 <choose+0x34>
mov    -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movzwl -0x6(%rbp),%eax
sub    %eax,%edi
add    $0x1,%edi
mov    -0x4(%rbp),%esi
call   1040 <product@plt>
mov    %eax,-0xc(%rbp)
movzwl -0x6(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%eax
mov    %edi,%ecx
sub    %esi,%ecx
cmp    %esi,%ecx
cmovge %esi,%ecx
movzwl %cx,%ebx
sub    %ebx,%edi
add    $0x1,%edi
mov    %eax,%esi
call   1040 <product@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @choose(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = load i32, i32* %3
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = icmp sgt i32 %6, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = sub nsw i32 %13, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %4
br label %18
18: ; preds = %12, %2
%19 = load i32, i32* %3
%20 = load i16, i16* %4
%21 = zext i16 %20 to i32
%22 = sub nsw i32 %19, %21
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %3
%25 = call i32 @product(i32 %23, i32 %24)
%26 = load i16, i16* %4
%27 = call i32 @factorial(i16 zeroext %26)
%28 = sdiv i32 %25, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @choose(i32 %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = sub nsw i32 %0, %3
%5 = icmp slt i32 %4, %3
%6 = trunc i32 %4 to i16
%7 = select i1 %5, i16 %6, i16 %1
%8 = zext i16 %7 to i32
%9 = add i32 %0, 1
%10 = sub i32 %9, %8
%11 = tail call i32 @product(i32 %10, i32 %0)
%12 = tail call i32 @factorial(i16 zeroext %7)
%13 = sdiv i32 %11, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ print_error_msg(char *, char *, int, int);
void print_few_args_before(char *name, int before, int defined) {
  print_error_msg(
      "function '%s' was previously called with less "
      "arguments that it is defined here (previous %d, defined %d)!",
      name, before, defined);
}


x86 assembly (clang, -O0):
<print_few_args_before>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rdi
call   1030 <print_error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_few_args_before>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
jmp    1030 <print_error_msg@plt>

LLVM IR (-O0):
@.str = [107 x i8] c"function '%s' was previously called with less arguments that it is defined here (previous %d, defined %d)!\00"
define void @print_few_args_before(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @print_error_msg(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [107 x i8] c"function '%s' was previously called with less arguments that it is defined here (previous %d, defined %d)!\00"
define void @print_few_args_before(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @print_error_msg(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
ret void
}
int av_stop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_stop() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("May 29, 2013 Wednesday\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"May 29, 2013 Wednesday\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"May 29, 2013 Wednesday\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *strchr(char *, char);
int main() {
  double y = 0.0;
  char abuf[1024];
  sprintf(abuf, "%A", y);
  exit(strchr(abuf, 'P') == (char *)0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xea3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
mov    $0x50,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <strchr@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [1024 x i8]
store i32 0, i32* %1
store double 0.000000e+00, double* %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load double, double* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i8* @strchr(i8* %7, i8 signext 80)
%9 = icmp eq i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
%4 = call i8* @strchr(i8* %2, i8 signext 80)
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @exit(i32 %6)
unreachable
}
void virtual_to_machine() {}


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

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

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

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

/* Variables and functions */
struct constant *constant_str_integer(char const *);
struct constant *constant_dec_integer(const char *string) {
  return constant_str_integer(string);
}


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

x86 assembly (clang, -O2):
<constant_dec_integer>:
jmp    1030 <constant_str_integer@plt>

LLVM IR (-O0):
%struct.constant = type { i32 }
define %struct.constant* @constant_dec_integer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.constant* @constant_str_integer(i8* %3)
ret %struct.constant* %4
}

LLVM IR (-O2):
%struct.constant = type { i32 }
define %struct.constant* @constant_dec_integer(i8* %0) {
%2 = tail call %struct.constant* @constant_str_integer(i8* %0)
ret %struct.constant* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *,
                           char *);
void stack_help(FILE *file, char *basename, char *cmd) {
  fprintf(
      file,
      "Usage: %s %s [options] [file...]\n\n"
      "Options:\n"
      "    -o <output>         Output filename template (default: %s)\n"
      "    -e <stop>           Bracket EV (specify for multiple times)\n"
      "    -t <begin>:<end>    Treat file name as template, e.g. '%%08d.JPG'\n"
      "\n",
      basename, cmd, "stack_%05d.hdr");
}


x86 assembly (clang, -O0):
<stack_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
lea    0xfb4(%rip),%r8
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_help>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
lea    0xfce(%rip),%r8
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [242 x i8] c"Usage: %s %s [options] [file...]\0A\0AOptions:\0A -o <output> Output filename template (default: %s)\0A -e <stop> Bracket EV (specify for multiple times)\0A -t <begin>:<end> Treat file name as template, e.g. '%%08d.JPG'\0A\0A\00"
@.str.1 = [15 x i8] c"stack_%05d.hdr\00"
define void @stack_help(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [242 x i8] c"Usage: %s %s [options] [file...]\0A\0AOptions:\0A -o <output> Output filename template (default: %s)\0A -e <stop> Bracket EV (specify for multiple times)\0A -t <begin>:<end> Treat file name as template, e.g. '%%08d.JPG'\0A\0A\00"
@.str.1 = [15 x i8] c"stack_%05d.hdr\00"
define void @stack_help(i32* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ go_down(int);
int /*<<< orphan*/ go_up(int);
void go_vert(int n) {
  if (n > 0) {
    go_down(n);
  } else if (n < 0) {
    go_up(-n);
  }
}


x86 assembly (clang, -O0):
<go_vert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1142 <go_vert+0x22>
mov    -0x4(%rbp),%edi
call   1040 <go_down@plt>
jmp    115b <go_vert+0x3b>
cmpl   $0x0,-0x4(%rbp)
jge    1156 <go_vert+0x36>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1030 <go_up@plt>
jmp    115b <go_vert+0x3b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_vert>:
test   %edi,%edi
jle    1129 <go_vert+0x9>
jmp    1040 <go_down@plt>
js     112c <go_vert+0xc>
ret
neg    %edi
jmp    1030 <go_up@plt>

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

LLVM IR (-O2):
define void @go_vert(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @go_down(i32 %0)
br label %10
5: ; preds = %1
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = sub nsw i32 0, %0
%9 = tail call i32 @go_up(i32 %8)
br label %10
10: ; preds = %5, %7, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t *_vr_strrchr(uint8_t *p, uint8_t *start, uint8_t c) {
  while (p >= start) {
    if (*p == c) {
      return p;
    }
    p--;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<_vr_strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     114d <_vr_strrchr+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jne    113c <_vr_strrchr+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <_vr_strrchr+0x55>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_vr_strrchr+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vr_strrchr>:
cmp    %rsi,%rdi
jb     111e <_vr_strrchr+0x1e>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %rdx,(%rax)
je     1120 <_vr_strrchr+0x20>
add    $0xfffffffffffffff8,%rax
cmp    %rsi,%rax
jae    1110 <_vr_strrchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @_vr_strrchr(i64* %0, i64* readnone %1, i64 %2) {
%4 = icmp ult i64* %0, %1
br i1 %4, label %12, label %5
5: ; preds = %3, %9
%6 = phi i64* [ %10, %9 ], [ %0, %3 ]
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, %2
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %6, i64 -1
%11 = icmp ult i64* %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %9, %3
%13 = phi i64* [ null, %3 ], [ null, %9 ], [ %6, %5 ]
ret i64* %13
}
/* Variables and functions */
int /*<<< orphan*/ do_timing_big(int);
int /*<<< orphan*/ do_timing_small(int);
int /*<<< orphan*/ test_alignment();
int /*<<< orphan*/ test_deltas(int);
int /*<<< orphan*/ test_pieces();
int /*<<< orphan*/ test_results();
int main(int argc, const char **argv) {
  test_results();
  test_alignment();
  test_pieces();
  do_timing_big(argc);
  do_timing_small(argc);
  test_deltas(argc);
  return 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)
mov    $0x0,%al
call   1070 <test_results@plt>
mov    $0x0,%al
call   1050 <test_alignment@plt>
mov    $0x0,%al
call   1030 <test_pieces@plt>
mov    -0x8(%rbp),%edi
call   1060 <do_timing_big@plt>
mov    -0x8(%rbp),%edi
call   1040 <do_timing_small@plt>
mov    -0x8(%rbp),%edi
call   1080 <test_deltas@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1070 <test_results@plt>
xor    %eax,%eax
call   1050 <test_alignment@plt>
xor    %eax,%eax
call   1030 <test_pieces@plt>
mov    %ebx,%edi
call   1060 <do_timing_big@plt>
mov    %ebx,%edi
call   1040 <do_timing_small@plt>
mov    %ebx,%edi
call   1080 <test_deltas@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 (...) @test_results()
%7 = call i32 (...) @test_alignment()
%8 = call i32 (...) @test_pieces()
%9 = load i32, i32* %4
%10 = call i32 @do_timing_big(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @do_timing_small(i32 %11)
%13 = load i32, i32* %4
%14 = call i32 @test_deltas(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_results()
%4 = tail call i32 (...) @test_alignment()
%5 = tail call i32 (...) @test_pieces()
%6 = tail call i32 @do_timing_big(i32 %0)
%7 = tail call i32 @do_timing_small(i32 %0)
%8 = tail call i32 @test_deltas(i32 %0)
ret i32 0
}
/* Type definitions */
struct input_event {
  int dummy;
};

/* Variables and functions */
int fread(struct input_event *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int read_event(struct input_event *event) {
  return fread(event, sizeof(struct input_event), 1, stdin) == 1;
}


x86 assembly (clang, -O0):
<read_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_event>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.input_event = type { i32 }
@stdin = global i32 0
define i32 @read_event(%struct.input_event* %0) {
%2 = alloca %struct.input_event*
store %struct.input_event* %0, %struct.input_event** %2
%3 = load %struct.input_event*, %struct.input_event** %2
%4 = load i32, i32* @stdin
%5 = call i32 @fread(%struct.input_event* %3, i32 4, i32 1, i32 %4)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.input_event = type { i32 }
@stdin = global i32 0
define i32 @read_event(%struct.input_event* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @fread(%struct.input_event* %0, i32 4, i32 1, i32 %2)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int volatile int32_t;

/* Variables and functions */
int32_t ADCSequenceOverflow(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ;
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000010))) &
          (1 << ui32SequenceNum));
}


x86 assembly (clang, -O0):
<ADCSequenceOverflow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceOverflow>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %edi,%rcx
and    0x10(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @ADCSequenceOverflow(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 = add nsw i32 %5, 16
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = and i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ADCSequenceOverflow(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 16
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = shl nuw i32 1, %1
%8 = and i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ H(int /*<<< orphan*/);
int /*<<< orphan*/ ae(int);
void Z(int e) {
  ae(49465);
  H(0);
  ae(15);
  ae(e + 144);
  ae(192);
}


x86 assembly (clang, -O0):
<Z>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xc139,%edi
call   1040 <ae@plt>
xor    %edi,%edi
call   1030 <H@plt>
mov    $0xf,%edi
call   1040 <ae@plt>
mov    -0x4(%rbp),%edi
add    $0x90,%edi
call   1040 <ae@plt>
mov    $0xc0,%edi
call   1040 <ae@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Z>:
push   %rbx
mov    %edi,%ebx
mov    $0xc139,%edi
call   1040 <ae@plt>
xor    %edi,%edi
call   1030 <H@plt>
mov    $0xf,%edi
call   1040 <ae@plt>
add    $0x90,%ebx
mov    %ebx,%edi
call   1040 <ae@plt>
mov    $0xc0,%edi
pop    %rbx
jmp    1040 <ae@plt>

LLVM IR (-O0):
define void @Z(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ae(i32 49465)
%4 = call i32 @H(i32 0)
%5 = call i32 @ae(i32 15)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 144
%8 = call i32 @ae(i32 %7)
%9 = call i32 @ae(i32 192)
ret void
}

LLVM IR (-O2):
define void @Z(i32 %0) {
%2 = tail call i32 @ae(i32 49465)
%3 = tail call i32 @H(i32 0)
%4 = tail call i32 @ae(i32 15)
%5 = add nsw i32 %0, 144
%6 = tail call i32 @ae(i32 %5)
%7 = tail call i32 @ae(i32 192)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printChar(char);
void ln() { printChar('\n'); }


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

x86 assembly (clang, -O2):
<ln>:
mov    $0xa,%edi
jmp    1030 <printChar@plt>

LLVM IR (-O0):
define void @ln() {
%1 = call i32 @printChar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ln() {
%1 = tail call i32 @printChar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int leer(FILE *fp, int *seek) {
  fseek(fp, *seek, SEEK_SET);
  int c = fgetc(fp);
  *seek = ftell(fp);
  return c;
}


x86 assembly (clang, -O0):
<leer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leer>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rsi),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,(%r14)
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @leer(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* @SEEK_SET
%10 = call i32 @fseek(i32* %6, i32 %8, i32 %9)
%11 = load i32*, i32** %3
%12 = call i32 @fgetc(i32* %11)
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = call i32 @ftell(i32* %13)
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @leer(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i32 %3, i32 %4)
%6 = tail call i32 @fgetc(i32* %0)
%7 = tail call i32 @ftell(i32* %0)
store i32 %7, i32* %1
ret i32 %6
}
unsigned long crb_set_term_ctl(long unit, long ctb) {
  return 0x8000000000000000ul;
}


x86 assembly (clang, -O0):
<crb_set_term_ctl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x8000000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crb_set_term_ctl>:
movabs $0x8000000000000000,%rax
ret

LLVM IR (-O0):
define i64 @crb_set_term_ctl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i64 -9223372036854775808
}

LLVM IR (-O2):
define i64 @crb_set_term_ctl(i64 %0, i64 %1) {
ret i64 -9223372036854775808
}
void byteswap(char *buf, int from, int to) {
  int i;
  for (i = from; i <= to; i += 2) {
    char b1 = buf[i];
    buf[i] = buf[i + 1];
    buf[i + 1] = b1;
  }
}


x86 assembly (clang, -O0):
<byteswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     116a <byteswap+0x6a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x15(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <byteswap+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap>:
cmp    %edx,%esi
jg     111e <byteswap+0x1e>
movslq %esi,%rax
movslq %edx,%rcx
nopw   0x0(%rax,%rax,1)
rolw   $0x8,(%rdi,%rax,1)
add    $0x2,%rax
cmp    %rcx,%rax
jle    1110 <byteswap+0x10>
ret

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

LLVM IR (-O2):
define void @byteswap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %6, %5 ], [ %15, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = add nsw i64 %9, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %10
store i8 %11, i8* %13
%15 = add nsw i64 %9, 2
%16 = icmp sgt i64 %15, %7
br i1 %16, label %17, label %8
17: ; preds = %8, %3
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fisError(char *);
void *fisCalloc(int num_of_x, int size_of_x) {
  void *ptr;
  if (num_of_x == 0)
    ptr = NULL;
  else {
    ptr = calloc(num_of_x, size_of_x);
    if (ptr == NULL)
      fisError("Could not allocate memory in calloc function call.");
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<fisCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1145 <fisCalloc+0x25>
movq   $0x0,-0x10(%rbp)
jmp    1170 <fisCalloc+0x50>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <fisCalloc+0x4b>
lea    0xe9a(%rip),%rdi
call   1030 <fisError@plt>
jmp    1170 <fisCalloc+0x50>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisCalloc>:
push   %rax
test   %edi,%edi
je     113d <fisCalloc+0x1d>
call   1040 <calloc@plt>
test   %rax,%rax
je     1131 <fisCalloc+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1030 <fisError@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Could not allocate memory in calloc function call.\00"
define i8* @fisCalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i8* null, i8** %5
br label %18
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i8* @calloc(i32 %10, i32 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @fisError(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %9
br label %18
18: ; preds = %17, %8
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [51 x i8] c"Could not allocate memory in calloc function call.\00"
define noalias i8* @fisCalloc(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i8* @calloc(i32 %0, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @fisError(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %4, %7
%10 = phi i8* [ null, %7 ], [ %5, %4 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
void rl_bind_key(int key, void (*fun)(void)) {}


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

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

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

LLVM IR (-O2):
define void @rl_bind_key(i32 %0, void ()* nocapture %1) {
ret void
}
int cmp(const void *pa, const void *pb) {
  char a = *(const char *)pa;
  char b = *(const char *)pb;
  int res = a < b ? -1 : a == b ? 0 : 1;
  *(char *)pa = 100;
  return res;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jge    113b <cmp+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <cmp+0x52>
movsbl -0x11(%rbp),%edx
movsbl -0x12(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x64,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
movb   $0x64,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp ne i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
store i8 100, i8* %0
ret i32 %8
}
/* Variables and functions */
int pathconN_nm3_f0(double const **, double **, int *, double *, int);
int pathconN_nm3(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return pathconN_nm3_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<pathconN_nm3>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <pathconN_nm3_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm3>:
jmp    1030 <pathconN_nm3_f0@plt>

LLVM IR (-O0):
define i32 @pathconN_nm3(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @pathconN_nm3_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @pathconN_nm3(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @pathconN_nm3_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ChipInfo_ChipFamilyIs_CC13x2_CC26x2();
int /*<<< orphan*/ ChipInfo_HwRevisionIs_GTEQ_2_0();
void NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated(void) {
  if ((!ChipInfo_ChipFamilyIs_CC13x2_CC26x2()) ||
      (!ChipInfo_HwRevisionIs_GTEQ_2_0())) {
    while (1) {
    }
  }
}


x86 assembly (clang, -O0):
<NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ChipInfo_ChipFamilyIs_CC13x2_CC26x2@plt>
cmp    $0x0,%eax
je     1144 <NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated+0x24>
mov    $0x0,%al
call   1030 <ChipInfo_HwRevisionIs_GTEQ_2_0@plt>
cmp    $0x0,%eax
jne    114e <NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated+0x2e>
jmp    1149 <NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated+0x29>
jmp    1149 <NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated>:
push   %rax
xor    %eax,%eax
call   1040 <ChipInfo_ChipFamilyIs_CC13x2_CC26x2@plt>
test   %eax,%eax
je     1140 <NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated+0x20>
xor    %eax,%eax
call   1030 <ChipInfo_HwRevisionIs_GTEQ_2_0@plt>
test   %eax,%eax
je     1140 <NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated+0x20>
pop    %rax
ret
nopl   0x0(%rax)
jmp    1140 <NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated+0x20>

LLVM IR (-O0):
define void @NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated() {
%1 = call i32 (...) @ChipInfo_ChipFamilyIs_CC13x2_CC26x2()
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @ChipInfo_HwRevisionIs_GTEQ_2_0()
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %6, %7
br label %7
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @NOROM_ThisLibraryIsFor_CC13x2_CC26x2_HwRev20AndLater_HaltIfViolated() {
%1 = tail call i32 (...) @ChipInfo_ChipFamilyIs_CC13x2_CC26x2()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @ChipInfo_HwRevisionIs_GTEQ_2_0()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %0
br label %7
7: ; preds = %6, %7
br label %7
8: ; preds = %3
ret void
}
void execute_num_f() {}


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

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

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

LLVM IR (-O2):
define void @execute_num_f() {
ret void
}
int main(void) {
  int *te, a;
  a = 3;
  te = &a;
  printf("%d", te);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double pi = 3.14159, raio, area;
  scanf("%lf", &raio);
  area = raio * raio * pi;
  printf("A=%.4f\n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xebf(%rip),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"A=%.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %2
%10 = fmul double %8, %9
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"A=%.4f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %5, 3.141590e+00
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int f(void) {
  printf("hi\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"hi\00"
define i32 @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
size_t adts_digits_decimal(int32_t val) {
  size_t digits = 0;
  while (val) {
    val /= 10;
    digits++;
  }
  return digits;
}


x86 assembly (clang, -O0):
<adts_digits_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <adts_digits_decimal+0x38>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <adts_digits_decimal+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_digits_decimal>:
xor    %eax,%eax
test   %edi,%edi
je     1133 <adts_digits_decimal+0x33>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%rax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <adts_digits_decimal+0x10>
ret

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

LLVM IR (-O2):
define i64 @adts_digits_decimal(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add i64 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ dologout(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
void sigquit(int signo) {
  syslog(LOG_ERR, "got signal %d", signo);
  dologout(1);
}


x86 assembly (clang, -O0):
<sigquit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x1,%edi
call   1030 <dologout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigquit>:
push   %rax
mov    %edi,%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <dologout@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [14 x i8] c"got signal %d\00"
define void @sigquit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_ERR
%4 = load i32, i32* %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @dologout(i32 1)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [14 x i8] c"got signal %d\00"
define void @sigquit(i32 %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @dologout(i32 1)
ret void
}