xunge/DecIR huggingface dataset:
/* Type definitions */
struct protoent {
  int p_proto;
};

/* Variables and functions */
int /*<<< orphan*/ endprotoent();
struct protoent *getprotoent();
int /*<<< orphan*/ setprotoent(int);
struct protoent *getprotobynumber(int proto) {
  struct protoent *pe;
  setprotoent(1);
  while ((pe = getprotoent()) != NULL) {
    if (pe->p_proto == proto) {
      break;
    }
  }
  endprotoent();
  return pe;
}


x86 assembly (clang, -O0):
<getprotobynumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <setprotoent@plt>
mov    $0x0,%al
call   1040 <getprotoent@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1173 <getprotobynumber+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    116e <getprotobynumber+0x3e>
jmp    1173 <getprotobynumber+0x43>
jmp    1145 <getprotobynumber+0x15>
mov    $0x0,%al
call   1030 <endprotoent@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getprotobynumber>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
call   1050 <setprotoent@plt>
nop
xor    %eax,%eax
call   1040 <getprotoent@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1153 <getprotobynumber+0x23>
cmp    %ebp,(%rbx)
jne    1140 <getprotobynumber+0x10>
xor    %eax,%eax
call   1030 <endprotoent@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.protoent = type { i32 }
define %struct.protoent* @getprotobynumber(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.protoent*
store i32 %0, i32* %2
%4 = call i32 @setprotoent(i32 1)
br label %5
5: ; preds = %15, %1
%6 = call %struct.protoent* (...) @getprotoent()
store %struct.protoent* %6, %struct.protoent** %3
%7 = icmp ne %struct.protoent* %6, null
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load %struct.protoent*, %struct.protoent** %3
%10 = getelementptr inbounds %struct.protoent, %struct.protoent* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* %2
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %8
br label %16
15: ; preds = %8
br label %5
16: ; preds = %14, %5
%17 = call i32 (...) @endprotoent()
%18 = load %struct.protoent*, %struct.protoent** %3
ret %struct.protoent* %18
}

LLVM IR (-O2):
%struct.protoent = type { i32 }
define %struct.protoent* @getprotobynumber(i32 %0) {
%2 = tail call i32 @setprotoent(i32 1)
br label %3
3: ; preds = %6, %1
%4 = tail call %struct.protoent* (...) @getprotoent()
%5 = icmp eq %struct.protoent* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = getelementptr inbounds %struct.protoent, %struct.protoent* %4, i64 0, i32 0
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %6, %3
%11 = tail call i32 (...) @endprotoent()
ret %struct.protoent* %4
}
int calc_tri_num(int num) {
  int i;
  int tri_num = 0;
  for (i = 1; i <= num; ++i) {
    tri_num += i;
  }
  return tri_num;
}


x86 assembly (clang, -O0):
<calc_tri_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <calc_tri_num+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <calc_tri_num+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_tri_num>:
test   %edi,%edi
jle    1118 <calc_tri_num+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_tri_num(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "usage: clexer [OPTIONS] [FILE]\n\nShow lexical structure of a C source. "
      "When given the --snarfer option,\ndisplay only lexical tokens produced "
      "by Guile snarfer. The output may be\npiped to the `guile-tools "
      "snarf-check-and-output-texi' command.\n\nOPTIONS are:\n  -s, --snarfer  "
      "    filter out Guile docstrings\n  -o, --output=FILE  write output to "
      "FILE\n  -h, --help         show this help summary\n\n");
  printf("Report bugs to <gray+clexer@gnu.org.ua>\n");
}


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

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

LLVM IR (-O0):
@.str = [391 x i8] c"usage: clexer [OPTIONS] [FILE]\0A\0AShow lexical structure of a C source. When given the --snarfer option,\0Adisplay only lexical tokens produced by Guile snarfer. The output may be\0Apiped to the `guile-tools snarf-check-and-output-texi' command.\0A\0AOPTIONS are:\0A -s, --snarfer filter out Guile docstrings\0A -o, --output=FILE write output to FILE\0A -h, --help show this help summary\0A\0A\00"
@.str.1 = [41 x i8] c"Report bugs to <gray+clexer@gnu.org.ua>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [390 x i8] c"usage: clexer [OPTIONS] [FILE]\0A\0AShow lexical structure of a C source. When given the --snarfer option,\0Adisplay only lexical tokens produced by Guile snarfer. The output may be\0Apiped to the `guile-tools snarf-check-and-output-texi' command.\0A\0AOPTIONS are:\0A -s, --snarfer filter out Guile docstrings\0A -o, --output=FILE write output to FILE\0A -h, --help show this help summary\0A\00"
@str.2 = [40 x i8] c"Report bugs to <gray+clexer@gnu.org.ua>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([390 x i8], [390 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serverInit();
void server_init() {
  serverInit();
  return;
}


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

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

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

LLVM IR (-O2):
define void @server_init() {
%1 = tail call i32 (...) @serverInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
void ubloom_destroy(char const *filename) { unlink(filename); }


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

x86 assembly (clang, -O2):
<ubloom_destroy>:
jmp    1030 <unlink@plt>

LLVM IR (-O0):
define void @ubloom_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
ret void
}

LLVM IR (-O2):
define void @ubloom_destroy(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
void DBGFR3AddrSub(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3AddrSub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void lcd_write_data(char c) {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/"
         "mock/lcd.c",
         10);
}


x86 assembly (clang, -O0):
<lcd_write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0xa,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_write_data>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0xa,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_write_data(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_write_data(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor4d(double, double, double, double);
void Color4d(double r, double g, double b, double a) { glColor4d(r, g, b, a); }


x86 assembly (clang, -O0):
<Color4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <glColor4d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Color4d>:
jmp    1030 <glColor4d@plt>

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

LLVM IR (-O2):
define void @Color4d(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @glColor4d(double %0, double %1, double %2, double %3)
ret void
}
int clk_enable_after(void *privdata, int failed) {
  printk("[%s] :%s   failed:%d\n", __func__, privdata, failed);
  return 0;
}


x86 assembly (clang, -O0):
<clk_enable_after>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_enable_after>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"[%s] :%s failed:%d\0A\00"
@__func__.clk_enable_after = [17 x i8] c"clk_enable_after\00"
define i32 @clk_enable_after(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.clk_enable_after, i64 0, i64 0), i8* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"[%s] :%s failed:%d\0A\00"
@__func__.clk_enable_after = [17 x i8] c"clk_enable_after\00"
define i32 @clk_enable_after(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.clk_enable_after, i64 0, i64 0), i8* %0, i32 %1)
ret i32 0
}
int main(void) { int i = 42; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2a,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo269(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo269(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
void testTortureExecute(void) {
  test1();
  test2();
  test3();
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1050 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1050 <test2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test3@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 (...) @test1()
%2 = call i32 (...) @test2()
%3 = call i32 (...) @test3()
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
ret void
}
void led_gpio_bicolor_unregister(struct gpio_bicolor_led *led) {}


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

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

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

LLVM IR (-O2):
%struct.gpio_bicolor_led = type opaque
define void @led_gpio_bicolor_unregister(%struct.gpio_bicolor_led* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int check_upper_case(char *tmp) {
  int ret = 0;
  while (*tmp != '\0') {
    if (*tmp == 'X') {
      ret = -1;
      printf("\nnow tmp is %c\n", *tmp);
      break;
    }
    tmp++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<check_upper_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <check_upper_case+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x58,%eax
jne    1162 <check_upper_case+0x52>
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
lea    0xeab(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
jmp    1173 <check_upper_case+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <check_upper_case+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_upper_case>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
test   %al,%al
je     1131 <check_upper_case+0x21>
cmp    $0x58,%al
je     1135 <check_upper_case+0x25>
add    $0x1,%rdi
jmp    1120 <check_upper_case+0x10>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec4(%rip),%rdi
mov    $0x58,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0Anow tmp is %c\0A\00"
define i32 @check_upper_case(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %8, %7 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %9
i8 88, label %5
]
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext 88)
br label %9
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
9: ; preds = %2, %5
%10 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void mmio_write_64(uintptr_t addr, uint64_t value) {
  *(volatile uint64_t *)addr = value;
}


x86 assembly (clang, -O0):
<mmio_write_64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmio_write_64>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mmio_write_64(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @mmio_write_64(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getNoKill();
int /*<<< orphan*/ shutDown(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ termReset();
void sigUsr2Handler(int signum) {
  termReset();
  shutDown(getNoKill(), 0, 1);
}


x86 assembly (clang, -O0):
<sigUsr2Handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <termReset@plt>
mov    $0x0,%al
call   1030 <getNoKill@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <shutDown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigUsr2Handler>:
push   %rax
xor    %eax,%eax
call   1050 <termReset@plt>
xor    %eax,%eax
call   1030 <getNoKill@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x1,%edx
pop    %rax
jmp    1040 <shutDown@plt>

LLVM IR (-O0):
define void @sigUsr2Handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @termReset()
%4 = call i32 (...) @getNoKill()
%5 = call i32 @shutDown(i32 %4, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @sigUsr2Handler(i32 %0) {
%2 = tail call i32 (...) @termReset()
%3 = tail call i32 (...) @getNoKill()
%4 = tail call i32 @shutDown(i32 %3, i32 0, i32 1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_start_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(267, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_start_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x10b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_start_solutions_to_container>:
mov    $0x10b,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_start_solutions_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 267, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_start_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 267, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int log_nbits(uint64_t x) {
  int i;
  uint64_t z;
  for (i = 0; i < 64; i++) {
    z = 1 << i;
    if (x < z) {
      break;
    }
  }
  return (i);
}


x86 assembly (clang, -O0):
<log_nbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    1149 <log_nbits+0x49>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1136 <log_nbits+0x36>
jmp    1149 <log_nbits+0x49>
jmp    113b <log_nbits+0x3b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <log_nbits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_nbits>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x3f,%ecx
ja     1123 <log_nbits+0x23>
cmp    %edi,%eax
jle    1110 <log_nbits+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @log_nbits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = shl i32 1, %9
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %8
br label %19
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %14, %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @log_nbits(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = icmp ugt i32 %3, 63
%5 = shl nuw i32 1, %3
%6 = icmp sgt i32 %5, %0
%7 = select i1 %4, i1 true, i1 %6
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
int security_shm_shmat(struct shmid_kernel *shp, int shmid, char *shmaddr,
                       int shmflg) {
  return 0;
}


x86 assembly (clang, -O0):
<security_shm_shmat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.shmid_kernel = type opaque
define i32 @security_shm_shmat(%struct.shmid_kernel* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.shmid_kernel*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.shmid_kernel* %0, %struct.shmid_kernel** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.shmid_kernel = type opaque
define i32 @security_shm_shmat(%struct.shmid_kernel* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
unsigned char inb(unsigned short port) {
  unsigned char value;
  asm("inb %w1, %0" : "=a"(value) : "Nd"(port));
  return value;
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm "inb ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
volatile uint32_t *__bb_addr(volatile void *address, uint32_t bit,
                             uint32_t bb_base, uint32_t bb_ref) {
  return (volatile uint32_t *)(bb_base + ((uint32_t)address - bb_ref) * 32 +
                               bit * 4);
}


x86 assembly (clang, -O0):
<__bb_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
sub    -0x14(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bb_addr>:
sub    %ecx,%edi
shl    $0x5,%edi
lea    (%rdx,%rsi,4),%eax
add    %edi,%eax
cltq
ret

LLVM IR (-O0):
define i32* @__bb_addr(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %10 to i32
%12 = load i32, i32* %8
%13 = sub nsw i32 %11, %12
%14 = mul nsw i32 %13, 32
%15 = add nsw i32 %9, %14
%16 = load i32, i32* %6
%17 = mul nsw i32 %16, 4
%18 = add nsw i32 %15, %17
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
ret i32* %20
}

LLVM IR (-O2):
define i32* @__bb_addr(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = ptrtoint i8* %0 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %6, %3
%8 = shl nsw i32 %7, 5
%9 = shl nsw i32 %1, 2
%10 = add i32 %9, %2
%11 = add i32 %10, %8
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
ret i32* %13
}
void UARTModuleReset(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x54)))) |= ((0x00000002u));
  while (!((*((volatile unsigned int *)(baseAdd + (0x58)))) & (0x00000001u)))
    ;
}


x86 assembly (clang, -O0):
<UARTModuleReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x58,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <UARTModuleReset+0x38>
jmp    113d <UARTModuleReset+0x3d>
jmp    1116 <UARTModuleReset+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModuleReset>:
lea    0x54(%rdi),%eax
orl    $0x2,(%rax)
add    $0x58,%edi
nopl   0x0(%rax)
testl  $0x1,(%rdi)
je     1110 <UARTModuleReset+0x10>
ret

LLVM IR (-O0):
define void @UARTModuleReset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 84
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
br label %9
9: ; preds = %18, %1
%10 = load i32, i32* %2
%11 = add i32 %10, 88
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %18, label %19
18: ; preds = %9
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @UARTModuleReset(i32 %0) {
%2 = add i32 %0, 84
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
%7 = add i32 %0, 88
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
br label %10
10: ; preds = %10, %1
%11 = load volatile i32, i32* %9
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
ret void
}
int d_ge_mm2(double *a1, double *a2) { return !(((*a1) >= (*a2))); }


x86 assembly (clang, -O0):
<d_ge_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_mm2>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @d_ge_mm2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp oge double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_ge_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ult double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float sinf(float);
float back_ease_out(float p) {
  float f = (1.0f - p);
  return 1.0f - (f * f * f - f * sinf(f * 3.1415926536f));
}


x86 assembly (clang, -O0):
<back_ease_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeaa(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <sinf@plt>
movss  -0x14(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0xc(%rbp),%xmm0
mulss  %xmm3,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  0xe69(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_ease_out>:
push   %rax
movss  0xee7(%rip),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xecd(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
movss  (%rsp),%xmm2
mulss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm2,%xmm1
subss  %xmm0,%xmm1
movss  0xea1(%rip),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @back_ease_out(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float 1.000000e+00, %4
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fmul float %11, 0x400921FB60000000
%13 = call float @sinf(float %12)
%14 = fmul float %10, %13
%15 = fneg float %14
%16 = call float @llvm.fmuladd.f32(float %8, float %9, float %15)
%17 = fsub float 1.000000e+00, %16
ret float %17
}

LLVM IR (-O2):
define float @back_ease_out(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fmul float %2, %2
%4 = fmul float %2, 0x400921FB60000000
%5 = tail call float @sinf(float %4)
%6 = fneg float %2
%7 = fmul float %5, %6
%8 = tail call float @llvm.fmuladd.f32(float %3, float %2, float %7)
%9 = fsub float 1.000000e+00, %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printBinary(int num) {
  int i;
  for (i = 0; i < 32; i++) {
    if (num & (1 << (31 - i))) {
      printf("1");
    } else {
      printf("0");
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    117b <printBinary+0x6b>
mov    -0x4(%rbp),%eax
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115c <printBinary+0x4c>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <printBinary+0x58>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <printBinary+0x5d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printBinary+0x12>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBinary>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
mov    %ebp,%ecx
shl    %cl,%eax
and    $0x80000000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x20,%ebp
jne    1120 <printBinary+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printBinary(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = lshr i32 -2147483648, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 48, i32 49
%8 = tail call i32 @putchar(i32 %7)
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ back_sub();
int /*<<< orphan*/ guass_seq();
int /*<<< orphan*/ print_data();
int /*<<< orphan*/ print_result();
int /*<<< orphan*/ printf(char *);
void sequential() {
  printf("\tExecuting sequentially.\n");
  guass_seq();
  print_data();
  back_sub();
  print_result();
}


x86 assembly (clang, -O0):
<sequential>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <guass_seq@plt>
mov    $0x0,%al
call   1060 <print_data@plt>
mov    $0x0,%al
call   1070 <back_sub@plt>
mov    $0x0,%al
call   1050 <print_result@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequential>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <guass_seq@plt>
xor    %eax,%eax
call   1060 <print_data@plt>
xor    %eax,%eax
call   1070 <back_sub@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <print_result@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\09Executing sequentially.\0A\00"
define void @sequential() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @guass_seq()
%3 = call i32 (...) @print_data()
%4 = call i32 (...) @back_sub()
%5 = call i32 (...) @print_result()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\09Executing sequentially.\00"
define void @sequential() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @guass_seq()
%3 = tail call i32 (...) @print_data()
%4 = tail call i32 (...) @back_sub()
%5 = tail call i32 (...) @print_result()
ret void
}
/* Variables and functions */
int get_sum(int, int, int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int x, y, z, sum;
  scanf("%d %d %d", &x, &y, &z);
  sum = get_sum(x, y, z);
  printf("%d+%d+%d = %d\n", x, y, z, sum);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <get_sum@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe96(%rip),%rdi
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [15 x i8] c"%d+%d+%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @get_sum(i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %11)
ret i32 0
}
int compare_char(const char a, const char b) { return a - b; }


x86 assembly (clang, -O0):
<compare_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare_char(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
struct ts_platform_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ disable_irq_wake(unsigned int);
void board_disable_irq_wake(const struct ts_platform_data *pdata,
                            unsigned int irq) {
  disable_irq_wake(irq);
}


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

x86 assembly (clang, -O2):
<board_disable_irq_wake>:
mov    %esi,%edi
jmp    1030 <disable_irq_wake@plt>

LLVM IR (-O0):
%struct.ts_platform_data = type { i32 }
define void @board_disable_irq_wake(%struct.ts_platform_data* %0, i32 %1) {
%3 = alloca %struct.ts_platform_data*
%4 = alloca i32
store %struct.ts_platform_data* %0, %struct.ts_platform_data** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @disable_irq_wake(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.ts_platform_data = type { i32 }
define void @board_disable_irq_wake(%struct.ts_platform_data* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @disable_irq_wake(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "DEMO semigroup Lindeberg convolution  \n");
  fprintf(stderr, " gaussconv_lindeberg in sigma gamma(laplacian scheme) "
                  "N(iterations) out  \n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xeef(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef9(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"DEMO semigroup Lindeberg convolution \0A\00"
@.str.1 = [75 x i8] c" gaussconv_lindeberg in sigma gamma(laplacian scheme) N(iterations) out \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"DEMO semigroup Lindeberg convolution \0A\00"
@.str.1 = [75 x i8] c" gaussconv_lindeberg in sigma gamma(laplacian scheme) N(iterations) out \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printb(int);
int /*<<< orphan*/ printd(int);
void left(int a, int b) {
  printb(a);
  print(" << ");
  printd(b);
  print(" -> ");
  printb(a << b);
  print("\r\n");
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printb@plt>
lea    0xeb3(%rip),%rdi
call   1050 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printd@plt>
lea    0xea4(%rip),%rdi
call   1050 <print@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
shl    %cl,%edi
call   1030 <printb@plt>
lea    0xe90(%rip),%rdi
call   1050 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <printb@plt>
lea    0xebd(%rip),%rdi
call   1050 <print@plt>
mov    %ebx,%edi
call   1040 <printd@plt>
lea    0xeaf(%rip),%rdi
call   1050 <print@plt>
mov    %ebx,%ecx
shl    %cl,%ebp
mov    %ebp,%edi
call   1030 <printb@plt>
lea    0xe9d(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <print@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" << \00"
@.str.1 = [5 x i8] c" -> \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @left(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 = call i32 @printb(i32 %5)
%7 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @printd(i32 %8)
%10 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = shl i32 %11, %12
%14 = call i32 @printb(i32 %13)
%15 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" << \00"
@.str.1 = [5 x i8] c" -> \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @left(i32 %0, i32 %1) {
%3 = tail call i32 @printb(i32 %0)
%4 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printd(i32 %1)
%6 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = shl i32 %0, %1
%8 = tail call i32 @printb(i32 %7)
%9 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int link(char const *, char const *);
int /*<<< orphan*/ perror(char *);
void do_link(const char *old, const char *new) {
  int rc = link(old, new);
  if (rc < 0) {
    perror("link");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<do_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <link@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1170 <do_link+0x40>
lea    0xe9f(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_link>:
push   %rax
call   1040 <link@plt>
test   %eax,%eax
js     113c <do_link+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"link\00"
define void @do_link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @link(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"link\00"
define void @do_link(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}