xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  int i, j = 0, m = 0;
  i += 4;
  j += 4;
  printf("i=%d\nj=%d\n", i, j);
  m = j / 3;
  printf("i=%d\nj=%f\n", m, m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"i=%d\0Aj=%d\0A\00"
@.str.1 = [11 x i8] c"i=%d\0Aj=%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 4
store i32 %9, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 4
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32, i32* %6
%16 = sdiv i32 %15, 3
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %7
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"i=%d\0Aj=%d\0A\00"
@.str.1 = [11 x i8] c"i=%d\0Aj=%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 undef, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1)
ret i32 0
}
void gtk_action_set_accel_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_set_accel_path() {
ret void
}
unsigned int bit(unsigned int value, int pos) { return ((value >> pos) & 1); }


x86 assembly (clang, -O0):
<bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void init(int argc, char **argv, char **envp) {
  printf("Loaded Atomic Red Team Library successfully!\n");
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"Loaded Atomic Red Team Library successfully!\0A\00"
define void @init(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"Loaded Atomic Red Team Library successfully!\00"
define void @init(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret void
}
void port_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @port_enable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void revprint(int);
void print(int n) {
  if (n <= 0) {
    printf("%d ", n);
    return revprint(n + 5);
  } else {
    printf("%d ", n);
    print(n - 5);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1164 <print+0x34>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x5,%edi
call   1030 <revprint@plt>
jmp    117e <print+0x4e>
mov    -0x4(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x5,%edi
call   1050 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jle    1156 <print+0x36>
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    -0x5(%rbx),%ebp
cmp    $0x6,%ebx
mov    %ebp,%ebx
jae    1140 <print+0x20>
jmp    1158 <print+0x38>
mov    %ebx,%ebp
lea    0xea1(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
add    $0x5,%ebp
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <revprint@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %7, %1
%4 = phi i32 [ %0, %1 ], [ %10, %7 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, 5
tail call void @revprint(i32 %6)
ret void
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ %0, %1 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nsw i32 %8, -5
%11 = icmp ult i32 %8, 6
br i1 %11, label %3, label %7
}
/* Variables and functions */
int /*<<< orphan*/ IFF_UP;
int tap_clr_flags(char const *, int /*<<< orphan*/);
int tap_bring_down(int fd, const char *dev) {
  return tap_clr_flags(dev, IFF_UP);
}


x86 assembly (clang, -O0):
<tap_bring_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <tap_clr_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tap_bring_down>:
mov    %rsi,%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tap_clr_flags@plt>

LLVM IR (-O0):
@IFF_UP = global i32 0
define i32 @tap_bring_down(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* @IFF_UP
%7 = call i32 @tap_clr_flags(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@IFF_UP = global i32 0
define i32 @tap_bring_down(i32 %0, i8* %1) {
%3 = load i32, i32* @IFF_UP
%4 = tail call i32 @tap_clr_flags(i8* %1, i32 %3)
ret i32 %4
}
int setup_getid(const char *dir) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setup_getid(i8* nocapture readnone %0) {
ret i32 0
}
int func(void) {
  int n = 3;
  int m = 5;
  n - m;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = sub nsw i32 %3, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void processMenu(int value) {
  switch (value) {
  case 1:
    exit(0);
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<processMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    1133 <processMenu+0x23>
jmp    112c <processMenu+0x1c>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1138 <processMenu+0x28>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processMenu>:
cmp    $0x1,%edi
je     1116 <processMenu+0x6>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @processMenu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 1, label %4
]
4: ; preds = %1
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %1
br label %7
7: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @processMenu(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
ret void
}
adrx0adrx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <=
      (((short *)(11111111 & ~(__alignof__(short) - 1)))[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac6,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114d <adrx0adrx1+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <adrx0adrx1+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrx1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac6(%rcx,%rcx,1),%dx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i32, i32* %11
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i16, i16* inttoptr (i64 11111110 to i16*), i64 %22
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
%26 = icmp sle i32 %20, %25
br i1 %26, label %27, label %28
27: ; preds = %6
store i32 1, i32* %7
br label %29
28: ; preds = %6
store i32 0, i32* %7
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %7
ret i32 %30
}

LLVM IR (-O2):
define i32 @adrx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i16, i16* inttoptr (i64 11111110 to i16*), i64 %10
%12 = load i16, i16* %11
%13 = icmp sle i16 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ pioneer_int_to_buf(unsigned char *, int);
int pioneer_send_string(unsigned char *, int);
int pioneer_send_command1(char cmd, int arg1) {
  char buf[256];
  buf[0] = cmd;
  pioneer_int_to_buf((unsigned char *)(buf + 1), arg1);
  return pioneer_send_string((unsigned char *)buf, 4);
}


x86 assembly (clang, -O0):
<pioneer_send_command1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x110(%rbp)
lea    -0x110(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%esi
call   1030 <pioneer_int_to_buf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x4,%esi
call   1040 <pioneer_send_string@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pioneer_send_command1>:
sub    $0x108,%rsp
mov    %dil,(%rsp)
lea    0x1(%rsp),%rdi
call   1030 <pioneer_int_to_buf@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <pioneer_send_string@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @pioneer_send_command1(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca [256 x i8]
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i8, i8* %3
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i32, i32* %4
%11 = call i32 @pioneer_int_to_buf(i8* %9, i32 %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = call i32 @pioneer_send_string(i8* %12, i32 4)
ret i32 %13
}

LLVM IR (-O2):
define i32 @pioneer_send_command1(i8 signext %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %4
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 1
%6 = call i32 @pioneer_int_to_buf(i8* %5, i32 %1)
%7 = call i32 @pioneer_send_string(i8* %4, i32 4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void err(char *msg) {
  printf("ERROR: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int _gettimeofday(struct timeval *tp __attribute__((unused)),
                  struct timezone *tzp __attribute__((unused))) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.timeval = type opaque
%struct.timezone = type opaque
define i32 @_gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type opaque
%struct.timezone = type opaque
define i32 @_gettimeofday(%struct.timeval* nocapture readnone %0, %struct.timezone* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ baz();
int foo(long long int a, long long int a2, int b) {
  if (a < 0 || b)
    baz();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1138 <foo+0x28>
cmpl   $0x0,-0x1c(%rbp)
je     113f <foo+0x2f>
mov    $0x0,%al
call   1030 <baz@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %rdi,%rdi
js     111a <foo+0xa>
test   %edx,%edx
jne    111a <foo+0xa>
ret
push   %rax
xor    %eax,%eax
call   1030 <baz@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @foo(i64 %0, i64 %1, i32 %2) {
%4 = icmp slt i64 %0, 0
%5 = icmp ne i32 %2, 0
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (...) @baz()
br label %9
9: ; preds = %3, %7
ret i32 undef
}
int foo() {
  int a[3] = {1, 2, 3};
  return a[0] + a[1] + a[2];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xef3(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.foo.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @foo() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ reinv_str(unsigned char *, unsigned char *);
unsigned char *inv_str(unsigned char *r) {
  unsigned char *p = (unsigned char *)r;
  while (*p)
    p--;
  reinv_str(p, r);
  return p;
}


x86 assembly (clang, -O0):
<inv_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <inv_str+0x32>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <inv_str+0x14>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <reinv_str@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_str>:
push   %rbx
mov    %rdi,%rsi
lea    0x1(%rdi),%rbx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,-0x1(%rbx)
lea    -0x1(%rbx),%rbx
jne    1120 <inv_str+0x10>
mov    %rbx,%rdi
call   1030 <reinv_str@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @inv_str(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 -1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @reinv_str(i8* %3, i8* %0)
ret i8* %3
}
void vmcall(void) {
  __asm__ __volatile__("push %%rbp; vmcall; pop %%rbp"
                       :
                       :
                       : "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "r8", "r9",
                         "r10", "r11", "r12", "r13", "r14", "r15");
}


x86 assembly (clang, -O0):
<vmcall>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rbp
vmcall
pop    %rbp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmcall>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rbp
vmcall
pop    %rbp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @vmcall() {
tail call void asm sideeffect "push %rbp; vmcall; pop %rbp", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void srp_prepare_pm(void *info) { return; }


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

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

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

LLVM IR (-O2):
define void @srp_prepare_pm(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _send_char_report(int, int, int);
void send_char_ascii_report(int ch, int mod) { _send_char_report(ch, mod, 1); }


x86 assembly (clang, -O0):
<send_char_ascii_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <_send_char_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_char_ascii_report>:
mov    $0x1,%edx
jmp    1030 <_send_char_report@plt>

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

LLVM IR (-O2):
define void @send_char_ascii_report(i32 %0, i32 %1) {
%3 = tail call i32 @_send_char_report(i32 %0, i32 %1, i32 1)
ret void
}
int main() {
  1 < 2;
  3 > 4;
  5 <= 6;
  7 >= 8;
  9 == 10;
  11 != 12;
  13 && 0;
  15 || 0;
  !0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ strtol(char *, char **, int);
uint8_t converter_string_base(char *string) {
  if (!string)
    return 0;
  uint8_t base = strtol(string, &string, 10);
  return *string == '\0' ? base : 0;
}


x86 assembly (clang, -O0):
<converter_string_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <converter_string_base+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1173 <converter_string_base+0x63>
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1163 <converter_string_base+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    116d <converter_string_base+0x5d>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    116d <converter_string_base+0x5d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<converter_string_base>:
push   %rax
mov    %rdi,(%rsp)
test   %rdi,%rdi
je     1137 <converter_string_base+0x27>
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    (%rsp),%rdx
xor    %eax,%eax
cmpb   $0x0,(%rdx)
cmove  %ecx,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @converter_string_base(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strtol(i8* %9, i8** %3, i32 10)
store i32 %10, i32* %4
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = load i32, i32* %4
br label %18
17: ; preds = %8
br label %18
18: ; preds = %17, %15
%19 = phi i32 [ %16, %15 ], [ 0, %17 ]
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @converter_string_base(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = call i32 @strtol(i8* %0, i8** %2, i32 10)
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i32 %5, i32 0
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %9, %4 ], [ 0, %1 ]
ret i32 %11
}
void fa14(void) {
a:
  ({
    p01A:
      goto p01A;
      goto a;
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


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

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

LLVM IR (-O0):
define void @fa14() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %0
br label %8
8: ; preds = %8, %7
br label %8
9: ; preds = %9
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa14() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int change_count(int val, int count) {
  if ((val > 2) && (val < 7)) {
    count++;
  } else if (val == 10) {
    count--;
  }
  printf("Current count: %i\n", count);
}


x86 assembly (clang, -O0):
<change_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1140 <change_count+0x30>
cmpl   $0x7,-0x8(%rbp)
jge    1140 <change_count+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <change_count+0x48>
cmpl   $0xa,-0x8(%rbp)
jne    1153 <change_count+0x43>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <change_count+0x48>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_count>:
lea    -0x3(%rdi),%eax
xor    %ecx,%ecx
cmp    $0xa,%edi
sete   %cl
neg    %ecx
cmp    $0x4,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
add    %eax,%esi
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Current count: %i\0A\00"
define i32 @change_count(i32 %0, i32 %1) {
%3 = add i32 %0, -3
%4 = icmp ult i32 %3, 4
%5 = icmp eq i32 %0, 10
%6 = sext i1 %5 to i32
%7 = select i1 %4, i32 1, i32 %6
%8 = add nsw i32 %7, %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 undef
}
long myrandom(long num, long nrange) {
  long i;
  i = (num * 401 + 673) % nrange;
  return (i);
}


x86 assembly (clang, -O0):
<myrandom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x191,-0x8(%rbp),%rax
add    $0x2a1,%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrandom>:
imul   $0x191,%rdi,%rax
add    $0x2a1,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1122 <myrandom+0x22>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @myrandom(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = mul nsw i64 %6, 401
%8 = add nsw i64 %7, 673
%9 = load i64, i64* %4
%10 = srem i64 %8, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @myrandom(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 401
%4 = add nsw i64 %3, 673
%5 = srem i64 %4, %1
ret i64 %5
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf_verbose(char *);
int clock_settime(clockid_t clk_id, const struct timespec *tp) {
  printf_verbose("clock_settime(...) = BLOCKED;");
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<clock_settime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf_verbose@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_settime>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf_verbose@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    0x2eb3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [30 x i8] c"clock_settime(...) = BLOCKED;\00"
@EPERM = global i32 0
@errno = global i32 0
define i32 @clock_settime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = call i32 @printf_verbose(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EPERM
store i32 %6, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@.str = [30 x i8] c"clock_settime(...) = BLOCKED;\00"
@EPERM = global i32 0
@errno = global i32 0
define i32 @clock_settime(i32 %0, %struct.timespec* nocapture readnone %1) {
%3 = tail call i32 @printf_verbose(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EPERM
store i32 %4, i32* @errno
ret i32 -1
}
void gtk_scrolled_window_set_placement() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scrolled_window_set_placement() {
ret void
}
void isr_hard_fault(void) {
  while (1) {
    asm("nop");
  }
}


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

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

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

LLVM IR (-O2):
define void @isr_hard_fault() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
int rand();
int irandomn(int n) { return rand() % n; }


x86 assembly (clang, -O0):
<irandomn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irandomn>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @irandomn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @irandomn(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
char *strchr(char *, char);
char *get_pointer_to_arg_ptr(char *start_ptr, int arg) {
  for (int i = 0; i < arg; ++i) {
    start_ptr = strchr(start_ptr, ' ') + 1;
  }
  return start_ptr;
}


x86 assembly (clang, -O0):
<get_pointer_to_arg_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <get_pointer_to_arg_ptr+0x46>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <get_pointer_to_arg_ptr+0x16>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pointer_to_arg_ptr>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
jle    1136 <get_pointer_to_arg_ptr+0x26>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
add    $0xffffffff,%ebx
jne    1120 <get_pointer_to_arg_ptr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_pointer_to_arg_ptr(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi i8* [ %0, %2 ], [ %10, %6 ]
ret i8* %5
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ 0, %2 ]
%8 = phi i8* [ %10, %6 ], [ %0, %2 ]
%9 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 32)
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %4, label %6
}
void ignoreCh(char ch) {}


x86 assembly (clang, -O0):
<ignoreCh>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ignoreCh(i8 signext %0) {
ret void
}
int lookup1(int i) {
  int a[] = {0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
             16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
  return a[i];
}


x86 assembly (clang, -O0):
<lookup1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xed4(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
movslq -0x4(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup1>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.lookup1.a = [32 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31]
define i32 @lookup1(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i32]
store i32 %0, i32* %2
%4 = bitcast [32 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
@__const.lookup1.a = [32 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31]
define i32 @lookup1(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [32 x i32], [32 x i32]* @__const.lookup1.a, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void check(char const *type, int align) {
  if ((align & -align) != align) {
    abort();
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
and    %ecx,%eax
cmp    -0xc(%rbp),%eax
je     1139 <check+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
lea    -0x1(%rsi),%eax
test   %eax,%esi
jne    1118 <check+0x8>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 0, %6
%8 = and i32 %5, %7
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @check(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @llvm.ctpop.i32(i32 %1)
%4 = icmp ult i32 %3, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
int _is_leap_year(int y) {
  if ((0 == y % 4)) {
    if (0 == y % 100)
      return (0 == y % 400);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    115c <_is_leap_year+0x5c>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1150 <_is_leap_year+0x50>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <_is_leap_year+0x63>
movl   $0x1,-0x4(%rbp)
jmp    1163 <_is_leap_year+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <_is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <_is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @_is_leap_year(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 0, %5
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp eq i32 0, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 0, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %2
br label %18
16: ; preds = %7
store i32 1, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @_is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %4, %7
%12 = phi i32 [ %10, %7 ], [ 1, %4 ], [ 0, %1 ]
ret i32 %12
}
__attribute__((weak)) void RTT_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @RTT_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
void efclose(FILE *fp) {
  if (fclose(fp) < 0)
    fatal("fclose");
}


x86 assembly (clang, -O0):
<efclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
jge    114b <efclose+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efclose>:
push   %rax
call   1030 <fclose@plt>
test   %rax,%rax
js     112d <efclose+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <fatal@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"fclose\00"
define void @efclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @fatal(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"fclose\00"
define void @efclose(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_max_subsquare(int **);
void main() {
  int a[6][5] = {{0, 1, 1, 0, 1}, {1, 1, 0, 1, 0}, {0, 1, 1, 1, 0},
                 {1, 1, 1, 1, 0}, {1, 1, 1, 1, 1}, {0, 0, 0, 0, 0}};
  print_max_subsquare(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x78,%edx
call   1040 <memcpy@plt>
lea    -0x80(%rbp),%rdi
call   1030 <print_max_subsquare@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
mov    0xf55(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0xf39(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf1d(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <print_max_subsquare@plt>
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [6 x [5 x i32]] [[5 x i32] [i32 0, i32 1, i32 1, i32 0, i32 1], [5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0], [5 x i32] [i32 0, i32 1, i32 1, i32 1, i32 0], [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 0], [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1], [5 x i32] zeroinitializer]
define void @main() {
%1 = alloca [6 x [5 x i32]]
%2 = bitcast [6 x [5 x i32]]* %1 to i8*
%3 = getelementptr inbounds [6 x [5 x i32]], [6 x [5 x i32]]* %1, i64 0, i64 0
%4 = bitcast [5 x i32]* %3 to i32**
%5 = call i32 @print_max_subsquare(i32** %4)
ret void
}

LLVM IR (-O2):
@__const.main.a = [6 x [5 x i32]] [[5 x i32] [i32 0, i32 1, i32 1, i32 0, i32 1], [5 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0], [5 x i32] [i32 0, i32 1, i32 1, i32 1, i32 0], [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 0], [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1], [5 x i32] zeroinitializer]
define void @main() {
%1 = alloca [6 x [5 x i32]]
%2 = bitcast [6 x [5 x i32]]* %1 to i8*
%3 = bitcast [6 x [5 x i32]]* %1 to i32**
%4 = call i32 @print_max_subsquare(i32** %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printusage(FILE *out) {
  fprintf(out, "Usage: ls [-Radfiloru] [file...]\n");
}


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

x86 assembly (clang, -O2):
<printusage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: ls [-Radfiloru] [file...]\0A\00"
define void @printusage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: ls [-Radfiloru] [file...]\0A\00"
define void @printusage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 33, i64 1, i32* %0)
ret void
}
long NET_configure(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @NET_configure() {
ret i64 0
}

LLVM IR (-O2):
define i64 @NET_configure() {
ret i64 0
}