xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__5__IO__clr();
void Msp430GpioC__12__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__5__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__12__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__5__IO__clr()
ret void
}
int do_291() { return 291; }


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

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

LLVM IR (-O0):
define i32 @do_291() {
ret i32 291
}

LLVM IR (-O2):
define i32 @do_291() {
ret i32 291
}
void gtk_menu_item_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_item_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int version_string(int *, char *);
void greetings(void) {
  int fail, n;
  char s[40];
  fail = version_string(&n, s);
  printf("Running %s ...\n", s);
}


x86 assembly (clang, -O0):
<greetings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1040 <version_string@plt>
mov    %eax,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greetings>:
push   %rbx
sub    $0x40,%rsp
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <version_string@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Running %s ...\0A\00"
define void @greetings() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%5 = call i32 @version_string(i32* %2, i8* %4)
store i32 %5, i32* %1
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Running %s ...\0A\00"
define void @greetings() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @version_string(i32* %1, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ostr_putc(void *, char const);
void ostr_putstr(void *data, const char *str) {
  while (*str) {
    ostr_putc(data, str[0]);
    ++str;
  }
}


x86 assembly (clang, -O0):
<ostr_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <ostr_putstr+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <ostr_putc@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <ostr_putstr+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ostr_putstr>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <ostr_putstr+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <ostr_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ostr_putstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ostr_putstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = call i32 @ostr_putc(i8* %10, i8 signext %13)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ostr_putstr(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 @ostr_putc(i8* %0, i8 signext %6)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CursorXY(int, int);
int /*<<< orphan*/ puts(char *);
int strlen(char *);
void Center(int y, char *s) {
  CursorXY((80 - strlen(s)) / 2 + 1, y);
  puts(s);
}


x86 assembly (clang, -O0):
<Center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x1,%edi
mov    -0x4(%rbp),%esi
call   1040 <CursorXY@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Center>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1050 <strlen@plt>
mov    $0x50,%ecx
sub    %eax,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
add    %ecx,%edi
sar    %edi
add    $0x1,%edi
mov    %ebp,%esi
call   1040 <CursorXY@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @Center(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 80, %6
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %3
%11 = call i32 @CursorXY(i32 %9, i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @puts(i8* %12)
ret void
}

LLVM IR (-O2):
define void @Center(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = sub nsw i32 80, %3
%5 = sdiv i32 %4, 2
%6 = add nsw i32 %5, 1
%7 = tail call i32 @CursorXY(i32 %6, i32 %0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %1)
ret void
}
int console_record_readline(char *str, int maxlen) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_record_readline(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surfflag_data(int *);
void fgmvwrite_surfflag_data_(int flagdata[]) {
  gmvwrite_surfflag_data(flagdata);
}


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

x86 assembly (clang, -O2):
<fgmvwrite_surfflag_data_>:
jmp    1030 <gmvwrite_surfflag_data@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_surfflag_data_(i32* %0) {
%2 = tail call i32 @gmvwrite_surfflag_data(i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_spaces(char *buf) {
  char *p = buf;
  if (!p)
    return 0;
  while (isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113c <skip_spaces+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1170 <skip_spaces+0x60>
jmp    1141 <skip_spaces+0x31>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1168 <skip_spaces+0x58>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <skip_spaces+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
test   %rdi,%rdi
je     1134 <skip_spaces+0x24>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_spaces+0x10>
jmp    1136 <skip_spaces+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World!\n");
  return EXIT_SUCCESS;
}


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>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void Help() {
  printf("usage: ./bit_cmp [options] [size]\n");
  printf("-h                 : this help\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<Help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"usage: ./bit_cmp [options] [size]\0A\00"
@.str.1 = [32 x i8] c"-h : this help\0A\00"
define void @Help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [34 x i8] c"usage: ./bit_cmp [options] [size]\00"
@str.2 = [31 x i8] c"-h : this help\00"
define void @Help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ debug_flush();
int /*<<< orphan*/ hal_spi_init();
void spi_init(void) {
  debug("spi: init\n");
  debug_flush();
  hal_spi_init();
}


x86 assembly (clang, -O0):
<spi_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <debug@plt>
mov    $0x0,%al
call   1030 <debug_flush@plt>
mov    $0x0,%al
call   1050 <hal_spi_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_init>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <debug@plt>
xor    %eax,%eax
call   1030 <debug_flush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <hal_spi_init@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"spi: init\0A\00"
define void @spi_init() {
%1 = call i32 @debug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @debug_flush()
%3 = call i32 (...) @hal_spi_init()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"spi: init\0A\00"
define void @spi_init() {
%1 = tail call i32 @debug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @debug_flush()
%3 = tail call i32 (...) @hal_spi_init()
ret void
}
long grib_op_ne(long a, long b) { return a != b; }


x86 assembly (clang, -O0):
<grib_op_ne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_ne>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i64 @grib_op_ne(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @grib_op_ne(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
int f10(struct S { enum E10 { a, b, c } f; } e) { return a == b; }


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

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

LLVM IR (-O0):
%struct.S = type { i32 }
define i32 @f10(i32 %0) {
%2 = alloca %struct.S
%3 = getelementptr inbounds %struct.S, %struct.S* %2, i32 0, i32 0
store i32 %0, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @f10(i32 %0) {
ret i32 0
}
int main() {
  int *sizes = (int[5]){6, 5, 3, 5, 4};
  int **ragged = createRaggedArray(5, sizes);
  printf("%d", ragged[1][3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2efa(%rip),%rax
mov    %rax,-0x24(%rbp)
mov    0x2ef7(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0x2ef5(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <createRaggedArray@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
mov    0xc(%rax),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movups 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <createRaggedArray@plt>
cltq
mov    0x8(%rax),%rax
mov    0xc(%rax),%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@constinit = private global [5 x i32] [i32 6, i32 5, i32 3, i32 5, i32 4]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [5 x i32]
%4 = alloca i32**
store i32 0, i32* %1
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @createRaggedArray to i32 (i32, i32*, ...)*)(i32 5, i32* %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32**
store i32** %11, i32*** %4
%12 = load i32**, i32*** %4
%13 = getelementptr inbounds i32*, i32** %12, i64 1
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@constinit = [5 x i32] [i32 6, i32 5, i32 3, i32 5, i32 4]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @createRaggedArray to i32 (i32, i32*, ...)*)(i32 5, i32* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32**
%7 = getelementptr inbounds i32*, i32** %6, i64 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 3
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
void __attribute__((weak)) usbcb_suspend() {}


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

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

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

LLVM IR (-O2):
define weak void @usbcb_suspend() {
ret void
}
void gtk_entry_completion_delete_action() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_delete_action() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ct();
int /*<<< orphan*/ vflush();
void vdterm() {
  vflush();
  ct();
}


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

x86 assembly (clang, -O2):
<vdterm>:
push   %rax
xor    %eax,%eax
call   1040 <vflush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ct@plt>

LLVM IR (-O0):
define void @vdterm() {
%1 = call i32 (...) @vflush()
%2 = call i32 (...) @ct()
ret void
}

LLVM IR (-O2):
define void @vdterm() {
%1 = tail call i32 (...) @vflush()
%2 = tail call i32 (...) @ct()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gptrtp(char *, char *);
int /*<<< orphan*/ gsitp(char *, int);
void g_size_t() {
  gsitp("size_t", sizeof(size_t));
  gptrtp("size_t", "size_t");
}


x86 assembly (clang, -O0):
<g_size_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x8,%esi
call   1040 <gsitp@plt>
lea    0xec4(%rip),%rsi
mov    %rsi,%rdi
call   1030 <gptrtp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_size_t>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <gsitp@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <gptrtp@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"size_t\00"
define void @g_size_t() {
%1 = call i32 @gsitp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = call i32 @gptrtp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"size_t\00"
define void @g_size_t() {
%1 = tail call i32 @gsitp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @gptrtp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
void remove_slash(char *path) {
  int len = strlen(path);
  if (path[len - 1] == '/')
    path[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<remove_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1153 <remove_slash+0x43>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_slash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    1127 <remove_slash+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @remove_slash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br i1 %13, label %14, label %20
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
br label %20
20: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
define void @remove_slash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
int gray(int c) { return ((c << 16) | (c << 8) | c); }


x86 assembly (clang, -O0):
<gray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gray>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @gray(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = or i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @gray(i32 %0) {
%2 = shl i32 %0, 16
%3 = shl i32 %0, 8
%4 = or i32 %3, %0
%5 = or i32 %4, %2
ret i32 %5
}
call1c(ui, ul, uc, us) unsigned int ui;
unsigned long ul;
unsigned char uc;
unsigned short us;
{
  uc = 5;
  us = 6;
  ui = 7;
  ul = 8;
}


x86 assembly (clang, -O0):
<call1c>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
mov    %dl,%cl
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
movb   $0x5,-0x11(%rbp)
movw   $0x6,-0x14(%rbp)
movl   $0x7,-0x8(%rbp)
movq   $0x8,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call1c(i32 %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8
%9 = alloca i16
%10 = trunc i32 %2 to i8
%11 = trunc i32 %3 to i16
store i32 %0, i32* %6
store i64 %1, i64* %7
store i8 %10, i8* %8
store i16 %11, i16* %9
store i8 5, i8* %8
store i16 6, i16* %9
store i32 7, i32* %6
store i64 8, i64* %7
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @call1c(i32 %0, i64 %1, i32 %2, i32 %3) {
ret i32 undef
}
char *get_transfer_mode(char binary_on) {
  return binary_on ? "octet" : "netascii";
}


x86 assembly (clang, -O0):
<get_transfer_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
lea    0xef1(%rip),%rax
lea    0xee4(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_transfer_mode>:
test   %dil,%dil
lea    0xefc(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"octet\00"
@.str.1 = [9 x i8] c"netascii\00"
define i8* @get_transfer_mode(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"octet\00"
@.str.1 = [9 x i8] c"netascii\00"
define i8* @get_transfer_mode(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
const char *handle_command_args(int argc, char **argv) {
  if (argc == 2) {
    return argv[1];
  } else {
    fprintf(stderr, "usage: bracket [filename]\n");
    return NULL;
  }
}


x86 assembly (clang, -O0):
<handle_command_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    113a <handle_command_args+0x2a>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <handle_command_args+0x47>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_command_args>:
push   %rax
cmp    $0x2,%edi
jne    111c <handle_command_args+0xc>
mov    0x8(%rsi),%rax
pop    %rcx
ret
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"usage: bracket [filename]\0A\00"
define i8* @handle_command_args(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %3
br label %15
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %15
15: ; preds = %12, %8
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"usage: bracket [filename]\0A\00"
define i8* @handle_command_args(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %10
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %4
%11 = phi i8* [ %6, %4 ], [ null, %7 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _find_error(char const *message, int ret) {
  fputs("find"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_find_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_find_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"find: \00"
@stderr = global i32 0
define i32 @_find_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"find: \00"
@stderr = global i32 0
define i32 @_find_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
int test_imm_78int64_lowword_mem(long long *val) {
  return ((*val) & (0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x78,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78int64_lowword_mem>:
testb  $0x78,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_78int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 120
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_78int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 120
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x >= 0) {
    y = 1;
    while (y < x) {
      y = y + 1;
    }
    x = x - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     116c <main+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115e <main+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ haskell_function();
int /*<<< orphan*/ printf(char *);
void c_function(void) {
  printf("Hello from c_function\n");
  haskell_function();
}


x86 assembly (clang, -O0):
<c_function>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <haskell_function@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_function>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <haskell_function@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Hello from c_function\0A\00"
define void @c_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @haskell_function()
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Hello from c_function\00"
define void @c_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @haskell_function()
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ onoff_fb(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("error use!\n");
    return -1;
  }
  int onoff = atoi(argv[1]);
  onoff_fb(onoff);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <onoff_fb@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    114a <main+0x1a>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <onoff_fb@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [11 x i8] c"error use!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @onoff_fb(i32 %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int /*<<< orphan*/);
extern struct SN_env *italian_UTF_8_create_env(void) {
  return SN_create_env(0, 3, 0);
}


x86 assembly (clang, -O0):
<italian_UTF_8_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x3,%esi
mov    %edx,%edi
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<italian_UTF_8_create_env>:
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @italian_UTF_8_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 3, i32 0)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @italian_UTF_8_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 3, i32 0)
ret %struct.SN_env* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ _bunyan(int, char *, int);
int /*<<< orphan*/ free(char *);
int vasprintf(char **, char const *, int /*<<< orphan*/);
void vbunyan(int level, const char *fmt, va_list ap) {
  char *s;
  int len;
  len = vasprintf(&s, fmt, ap);
  if (len == -1)
    return;
  _bunyan(level, s, len);
  free(s);
}


x86 assembly (clang, -O0):
<vbunyan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1040 <vasprintf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1164 <vbunyan+0x34>
jmp    117c <vbunyan+0x4c>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1050 <_bunyan@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vbunyan>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
call   1040 <vasprintf@plt>
cmp    $0xffffffff,%eax
je     115e <vbunyan+0x2e>
mov    0x8(%rsp),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1050 <_bunyan@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @vbunyan(i32 %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @vasprintf(i8** %4, i8* %1, i32 %2)
%7 = icmp eq i32 %6, -1
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %4
%10 = call i32 @_bunyan(i32 %0, i8* %9, i32 %6)
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %3, %8
ret void
}
void XtNextEvent() {}


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

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

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

LLVM IR (-O2):
define void @XtNextEvent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
unsigned int char2hex(char c) {
  char string[2] = {c, '\0'};
  unsigned int val;
  sscanf(string, "%x", &val);
  return val;
}


x86 assembly (clang, -O0):
<char2hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
lea    0xecd(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2hex>:
push   %rax
mov    %dil,0x2(%rsp)
movb   $0x0,0x3(%rsp)
lea    0xede(%rip),%rsi
lea    0x2(%rsp),%rdi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @char2hex(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %5
%6 = bitcast i32* %3 to i8*
%7 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
ret i32 %8
}
void gtk_table_attach_defaults() {}


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

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

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

LLVM IR (-O2):
define void @gtk_table_attach_defaults() {
ret void
}
int((forward_call_ind_receive))(struct ss7 *ss7, struct isup_call *c,
                                int messagetype, unsigned char *parm, int len) {
  return 2;
}


x86 assembly (clang, -O0):
<forward_call_ind_receive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @forward_call_ind_receive(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 2
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @forward_call_ind_receive(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
ret i32 2
}
/* Variables and functions */
int arrToNum(int *);
int /*<<< orphan*/ printf(char *, int);
void addArrays(int arr1[], int arr2[], int arr3[]) {
  printf("%d\n", arrToNum(arr1) + arrToNum(arr2) + arrToNum(arr3));
}


x86 assembly (clang, -O0):
<addArrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <arrToNum@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <arrToNum@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <arrToNum@plt>
mov    -0x1c(%rbp),%esi
add    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addArrays>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <arrToNum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <arrToNum@plt>
add    %eax,%ebp
mov    %r14,%rdi
call   1040 <arrToNum@plt>
add    %eax,%ebp
lea    0xeb4(%rip),%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @addArrays(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @arrToNum(i32* %0)
%5 = tail call i32 @arrToNum(i32* %1)
%6 = add nsw i32 %5, %4
%7 = tail call i32 @arrToNum(i32* %2)
%8 = add nsw i32 %6, %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *realloc_wrapped(void *ptr, size_t size,
                      void *UNUSED_data __attribute__((unused))) {
  return realloc(ptr, size);
}


x86 assembly (clang, -O0):
<realloc_wrapped>:
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),%rsi
call   1030 <realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_wrapped>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @realloc_wrapped(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @realloc_wrapped(i8* nocapture %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ parse(char *);
int main(int argc, char **argv) {
  int i = 1;
  if (argc > 1) {
    while (i <= argc) {
      parse(argv[i++]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116d <main+0x5d>
jmp    113c <main+0x2c>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1168 <main+0x58>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <parse@plt>
jmp    113c <main+0x2c>
jmp    116d <main+0x5d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
add    $0x1,%r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
add    $0x1,%rbx
call   1030 <parse@plt>
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = add nuw i32 %0, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %9, %7 ]
%9 = add nuw nsw i64 %8, 1
%10 = getelementptr inbounds i8*, i8** %1, i64 %8
%11 = load i8*, i8** %10
%12 = tail call i32 @parse(i8* %11)
%13 = icmp eq i64 %9, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret i32 0
}
void ptrace_sandbox_permit_getdents(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_getdents(%struct.pt_sandbox* nocapture %0) {
ret void
}