xunge/DecIR huggingface dataset:
int fib(int n) { return (n < 2) ? 1 : (fib(n - 1) + fib(n - 2)); }


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1132 <fib+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <fib+0x45>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
struct io_buf_handle {
  int dummy;
};
struct fsm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ io_error();
struct fsm *io_net_read(struct io_buf_handle *iobh, char **net_name) {
  io_error();
  return NULL;
}


x86 assembly (clang, -O0):
<io_net_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <io_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fsm = type { i32 }
%struct.io_buf_handle = type { i32 }
define %struct.fsm* @io_net_read(%struct.io_buf_handle* %0, i8** %1) {
%3 = alloca %struct.io_buf_handle*
%4 = alloca i8**
store %struct.io_buf_handle* %0, %struct.io_buf_handle** %3
store i8** %1, i8*** %4
%5 = call i32 (...) @io_error()
ret %struct.fsm* null
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
%struct.io_buf_handle = type { i32 }
define noalias %struct.fsm* @io_net_read(%struct.io_buf_handle* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @io_error()
ret %struct.fsm* null
}
int test_imm_4Duint8_reg(unsigned char val) {
  return ((val) & (0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Duint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x4d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Duint8_reg>:
test   $0x4d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Duint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 77
%6 = icmp ne i32 %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_4Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 77
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
Fspace() { putchar(' '); }


x86 assembly (clang, -O0):
<Fspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fspace>:
mov    $0x20,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @Fspace() {
%1 = alloca i32
%2 = call i32 @putchar(i8 signext 32)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Fspace() {
%1 = tail call i32 @putchar(i8 signext 32)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print_timestamp_ext(char *, char *);
void print_timestamp_done(char *message) {
  print_timestamp_ext(message, "DONE");
}


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

x86 assembly (clang, -O2):
<print_timestamp_done>:
lea    0xee9(%rip),%rsi
jmp    1030 <print_timestamp_ext@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"DONE\00"
define void @print_timestamp_done(i8* %0) {
%2 = tail call i32 @print_timestamp_ext(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ __builtin_y0l(long double);
int /*<<< orphan*/ link_failure_builtin_y0l();
void test_builtin_y0l(long double ld) {
  if (__builtin_y0l(ld) != __builtin_y0l(ld))
    link_failure_builtin_y0l();
}


x86 assembly (clang, -O0):
<test_builtin_y0l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_y0l@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_y0l@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_y0l+0x43>
mov    $0x0,%al
call   1040 <link_failure_builtin_y0l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_y0l>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_y0l@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_y0l@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_y0l+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_y0l@plt>

LLVM IR (-O0):
define void @test_builtin_y0l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @__builtin_y0l(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @__builtin_y0l(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_y0l()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_y0l(x86_fp80 %0) {
%2 = tail call i64 @__builtin_y0l(x86_fp80 %0)
%3 = tail call i64 @__builtin_y0l(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_y0l()
br label %7
7: ; preds = %5, %1
ret void
}
int test_imm_4Fuint32_mem(unsigned int *val) {
  return ((*val) & (0x4F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Fuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 79
%6 = icmp ne i32 %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_4Fuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 79
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int strlen(s)
char *s;
{
  char *original = s;
  while (*s != 0)
    s++;
  return (s - original);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(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 = %10, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %5
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @strlen(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 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int is_numeric(char *w) {
  int i;
  for (i = 0; w[i]; i++) {
    if (!isdigit(w[i]))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116e <is_numeric+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115b <is_numeric+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1175 <is_numeric+0x65>
jmp    1160 <is_numeric+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <is_numeric+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_numeric+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <is_numeric+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_numeric+0x20>
jmp    114b <is_numeric+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_numeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = tail call i32 @isdigit(i8 signext %10)
%12 = icmp eq i32 %11, 0
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void imprimePontos() {
  int i = 0;
  for (i = 0; i < 3; i++) {
    printf(" * ");
  }
}


x86 assembly (clang, -O0):
<imprimePontos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    114a <imprimePontos+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <imprimePontos+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimePontos>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" * \00"
define void @imprimePontos() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char const *const);
void print_text_and_exit(const char *const *text, int exitcode) {
  assert(text);
  for (; *text; text++)
    puts(*text);
  exit(exitcode);
}


x86 assembly (clang, -O0):
<print_text_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1173 <print_text_and_exit+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <print_text_and_exit+0x18>
mov    -0xc(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_text_and_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1161 <print_text_and_exit+0x31>
add    $0x8,%rbx
nopl   0x0(%rax)
call   1030 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1150 <print_text_and_exit+0x20>
mov    %ebp,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define void @print_text_and_exit(i8** %0, i32 %1) {
%3 = tail call i32 @assert(i8** %0)
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %4, %2 ]
%8 = phi i8** [ %10, %6 ], [ %0, %2 ]
%9 = tail call i32 @puts(i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *xmalloc_(size_t, char const *, int, char const *);
void *xmemdup_(const void *src, size_t size, const char *file, int line,
               const char *func) {
  void *p = xmalloc_(size, file, line, func);
  memcpy(p, src, size);
  return p;
}


x86 assembly (clang, -O0):
<xmemdup_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <xmalloc_@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemdup_>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8,%rcx
call   1030 <xmalloc_@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xmemdup_(i8* %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i8* @xmalloc_(i64 %12, i8* %13, i32 %14, i8* %15)
store i8* %16, i8** %11
%17 = load i8*, i8** %11
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
%21 = load i8*, i8** %11
ret i8* %21
}

LLVM IR (-O2):
define i8* @xmemdup_(i8* %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i8* @xmalloc_(i64 %1, i8* %2, i32 %3, i8* %4)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %1)
ret i8* %6
}
float ftoc(int fahr) { return (5.0 / 9.0) * (fahr - 32.0); }


x86 assembly (clang, -O0):
<ftoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xef4(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftoc>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @ftoc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @ftoc(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int close(int);
int i2c_close(int fd) { return (close(fd)); }


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

x86 assembly (clang, -O2):
<i2c_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @i2c_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f3() { printf("Hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define void @f3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mc146818_read(int);
int nvram_read(int r) { return mc146818_read(r) | (mc146818_read(r + 1) << 8); }


x86 assembly (clang, -O0):
<nvram_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mc146818_read@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <mc146818_read@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_read>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <mc146818_read@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <mc146818_read@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nvram_read(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mc146818_read(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @mc146818_read(i32 %6)
%8 = shl i32 %7, 8
%9 = or i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @nvram_read(i32 %0) {
%2 = tail call i32 @mc146818_read(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 @mc146818_read(i32 %3)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
float sq(float v) { return v * v; }


x86 assembly (clang, -O0):
<sq>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sq(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @sq(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int fdt_property_placeholder(void *, char const *, int, void **);
int /*<<< orphan*/ memcpy(void *, void const *, int);
int fdt_property(void *fdt, const char *name, const void *val, int len) {
  void *ptr;
  int ret;
  ret = fdt_property_placeholder(fdt, name, len, &ptr);
  if (ret)
    return ret;
  memcpy(ptr, val, len);
  return 0;
}


x86 assembly (clang, -O0):
<fdt_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    -0x30(%rbp),%rcx
call   1040 <fdt_property_placeholder@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1163 <fdt_property+0x43>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <fdt_property+0x5a>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_property>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%ebx
mov    %rdx,%r14
lea    0x8(%rsp),%rcx
mov    %ebx,%edx
call   1040 <fdt_property_placeholder@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    114e <fdt_property+0x2e>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fdt_property(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %9
%15 = call i32 @fdt_property_placeholder(i8* %12, i8* %13, i32 %14, i8** %10)
store i32 %15, i32* %11
%16 = load i32, i32* %11
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = load i32, i32* %11
store i32 %19, i32* %5
br label %25
20: ; preds = %4
%21 = load i8*, i8** %10
%22 = load i8*, i8** %8
%23 = load i32, i32* %9
%24 = call i32 @memcpy(i8* %21, i8* %22, i32 %23)
store i32 0, i32* %5
br label %25
25: ; preds = %20, %18
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @fdt_property(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call i32 @fdt_property_placeholder(i8* %0, i8* %1, i32 %3, i8** %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i8*, i8** %5
%11 = call i32 @memcpy(i8* %10, i8* %2, i32 %3)
br label %12
12: ; preds = %4, %9
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
void none(evutil_socket_t sock, short ev, void *data) {
  (void)sock;
  (void)ev;
  (void)data;
}


x86 assembly (clang, -O0):
<none>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @none(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i16, i16* %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @none(i32 %0, i16 signext %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ writen(int, int *, int);
ssize_t write_int(int fd, int v) { return writen(fd, &v, sizeof(int)); }


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

x86 assembly (clang, -O2):
<write_int>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <writen@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @write_int(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @writen(i32 %0, i32* %3, i32 4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, j = 3;
  i = --j;
  j += !(i % 2);
  printf("%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, -1
store i32 %5, i32* %3
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int g(int, int);
int f(int t, int c) {
  int d = 0;
  int e = 0;
  if (t) {
    d = 1;
    e = t;
  } else
    d = 0, e = 0;
  return g(e, d);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1148 <f+0x38>
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <f+0x46>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %esi,%esi
test   %edi,%edi
setne  %sil
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @g(i32 %0, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_srcptr;
typedef int /*<<< orphan*/ mpfr_ptr;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int mpfr_pow_si(int /*<<< orphan*/, int /*<<< orphan*/, int,
                int /*<<< orphan*/);
int p1788_fwd_pown(mpfr_ptr rop, mpfr_srcptr op, const void *env) {
  int p = *((int *)env);
  return mpfr_pow_si(rop, op, p, MPFR_RNDN);
}


x86 assembly (clang, -O0):
<p1788_fwd_pown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
call   1030 <mpfr_pow_si@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1788_fwd_pown>:
mov    (%rdx),%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <mpfr_pow_si@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_pown(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = load i32, i32* @MPFR_RNDN
%15 = call i32 @mpfr_pow_si(i32 %11, i32 %12, i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_pown(i32 %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* @MPFR_RNDN
%7 = tail call i32 @mpfr_pow_si(i32 %0, i32 %1, i32 %5, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int lower(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Lower case: %c\n", lower(getchar()));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%edi
call   1050 <lower@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Lower case: %c\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @lower(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_test_reset_child_memory(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_test_reset_child_memory() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_test_reset_child_memory() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Type definitions */
struct hiena_frag {
  int dummy;
};
struct frag_curs {
  int dummy;
};

/* Variables and functions */
struct hiena_frag *frag_curs_find_deepest_has_room(struct frag_curs *,
                                                   int /*<<< orphan*/);
struct hiena_frag *frag_curs_find_deepest(struct frag_curs *fc) {
  return frag_curs_find_deepest_has_room(fc, 0);
}


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

x86 assembly (clang, -O2):
<frag_curs_find_deepest>:
xor    %esi,%esi
jmp    1030 <frag_curs_find_deepest_has_room@plt>

LLVM IR (-O0):
%struct.hiena_frag = type { i32 }
%struct.frag_curs = type { i32 }
define %struct.hiena_frag* @frag_curs_find_deepest(%struct.frag_curs* %0) {
%2 = alloca %struct.frag_curs*
store %struct.frag_curs* %0, %struct.frag_curs** %2
%3 = load %struct.frag_curs*, %struct.frag_curs** %2
%4 = call %struct.hiena_frag* @frag_curs_find_deepest_has_room(%struct.frag_curs* %3, i32 0)
ret %struct.hiena_frag* %4
}

LLVM IR (-O2):
%struct.hiena_frag = type { i32 }
%struct.frag_curs = type { i32 }
define %struct.hiena_frag* @frag_curs_find_deepest(%struct.frag_curs* %0) {
%2 = tail call %struct.hiena_frag* @frag_curs_find_deepest_has_room(%struct.frag_curs* %0, i32 0)
ret %struct.hiena_frag* %2
}
void main() {
  int i, j;
  struct point {
    int x;
    int y;
  } * l1;
  struct point p, p1 = {20, 21};
  l1 = &p1;
  print("p1 20 21");
  printid(p1);
  p1.y = 5;
  l1->y = 6;
  l1->x = 7;
  print("7 6");
  print(*l1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <printid@plt>
movl   $0x5,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x6,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x7,(%rax)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
movabs $0x1500000014,%rdi
xor    %eax,%eax
call   1040 <printid@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
movabs $0x600000007,%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <print@plt>

LLVM IR (-O0):
%struct.point = type { i32, i32 }
@__const.main.p1 = %struct.point { i32 20, i32 21 }
@.str = [9 x i8] c"p1 20 21\00"
@.str.1 = [4 x i8] c"7 6\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.point*
%4 = alloca %struct.point
%5 = alloca %struct.point
%6 = bitcast %struct.point* %5 to i8*
store %struct.point* %5, %struct.point** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = bitcast %struct.point* %5 to i64*
%9 = load i64, i64* %8
%10 = call i32 (i64, ...) bitcast (i32 (...)* @printid to i32 (i64, ...)*)(i64 %9)
%11 = getelementptr inbounds %struct.point, %struct.point* %5, i32 0, i32 1
store i32 5, i32* %11
%12 = load %struct.point*, %struct.point** %3
%13 = getelementptr inbounds %struct.point, %struct.point* %12, i32 0, i32 1
store i32 6, i32* %13
%14 = load %struct.point*, %struct.point** %3
%15 = getelementptr inbounds %struct.point, %struct.point* %14, i32 0, i32 0
store i32 7, i32* %15
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = load %struct.point*, %struct.point** %3
%18 = bitcast %struct.point* %17 to i64*
%19 = load i64, i64* %18
%20 = call i32 (i64, ...) bitcast (i32 (...)* @print to i32 (i64, ...)*)(i64 %19)
ret void
}

LLVM IR (-O2):
%struct.point = type { i32, i32 }
@.str = [9 x i8] c"p1 20 21\00"
@.str.1 = [4 x i8] c"7 6\00"
define void @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i64, ...) bitcast (i32 (...)* @printid to i32 (i64, ...)*)(i64 90194313236)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @print to i32 (i64, ...)*)(i64 25769803783)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawBmpfile(int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ sleep(int);
void readyFace() {
  drawBmpfile(0, 127, "Black eye");
  sleep(2000);
}


x86 assembly (clang, -O0):
<readyFace>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x7f,%esi
lea    0xece(%rip),%rdx
call   1030 <drawBmpfile@plt>
mov    $0x7d0,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<readyFace>:
push   %rax
lea    0xed8(%rip),%rdx
xor    %edi,%edi
mov    $0x7f,%esi
call   1030 <drawBmpfile@plt>
mov    $0x7d0,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Black eye\00"
define void @readyFace() {
%1 = call i32 @drawBmpfile(i32 0, i32 127, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 2000)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Black eye\00"
define void @readyFace() {
%1 = tail call i32 @drawBmpfile(i32 0, i32 127, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 2000)
ret void
}
/* Variables and functions */
int EOF;
scalar_t__ WEOF;
scalar_t__ putwchar(int);
int outchar(int c) { return (putwchar(c) != WEOF ? c : EOF); }


x86 assembly (clang, -O0):
<outchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putwchar@plt>
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
je     113e <outchar+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114a <outchar+0x3a>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <putwchar@plt>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%rax
jne    112d <outchar+0x1d>
mov    0x2ebd(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@WEOF = global i64 0
@EOF = global i32 0
define i32 @outchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @putwchar(i32 %3)
%5 = load i64, i64* @WEOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* @EOF
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
@WEOF = global i64 0
@EOF = global i32 0
define i32 @outchar(i32 %0) {
%2 = tail call i64 @putwchar(i32 %0)
%3 = load i64, i64* @WEOF
%4 = icmp eq i64 %2, %3
%5 = load i32, i32* @EOF
%6 = select i1 %4, i32 %5, i32 %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ print_unit_info();
int /*<<< orphan*/ printf(char *, char *);
void print_usage() {
  printf("%s\n", "usage: tc <temperature> <input unit> <output unit>");
  print_unit_info();
  return;
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_unit_info@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [51 x i8] c"usage: tc <temperature> <input unit> <output unit>\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @print_unit_info()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [51 x i8] c"usage: tc <temperature> <input unit> <output unit>\00"
define void @print_usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @print_unit_info()
ret void
}
/* Type definitions */
struct nlattr {
  unsigned int nla_len;
};

/* Variables and functions */
unsigned int nla_len(const struct nlattr *nla) {
  return nla->nla_len - sizeof(struct nlattr);
}


x86 assembly (clang, -O0):
<nla_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_len>:
mov    (%rdi),%eax
add    $0xfffffffc,%eax
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_len(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
%7 = sub i64 %6, 4
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_len(%struct.nlattr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = add i32 %3, -4
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void my_timespec_from_double(double seconds, struct timespec *ts) {
  ts->tv_sec = (time_t)seconds;
  ts->tv_nsec = (long)((seconds - ((int)seconds)) * 1E9);
}


x86 assembly (clang, -O0):
<my_timespec_from_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xecb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_timespec_from_double>:
cvttsd2si %xmm0,%rax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xee7(%rip),%xmm0
mov    %rax,0x8(%rdi)
cvttsd2si %xmm0,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @my_timespec_from_double(double %0, %struct.timespec* %1) {
%3 = alloca double
%4 = alloca %struct.timespec*
store double %0, double* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load double, double* %3
%6 = fptosi double %5 to i64
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i64 %6, i64* %8
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fptosi double %10 to i32
%12 = sitofp i32 %11 to double
%13 = fsub double %9, %12
%14 = fmul double %13, 1.000000e+09
%15 = fptosi double %14 to i64
%16 = load %struct.timespec*, %struct.timespec** %4
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 0
store i64 %15, i64* %17
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @my_timespec_from_double(double %0, %struct.timespec* nocapture writeonly %1) {
%3 = fptosi double %0 to i64
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 %3, i64* %4
%5 = fptosi double %0 to i32
%6 = sitofp i32 %5 to double
%7 = fsub double %0, %6
%8 = fmul double %7, 1.000000e+09
%9 = fptosi double %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i64 %9, i64* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t reg16_read(volatile uint16_t *reg) { return *reg; }


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

x86 assembly (clang, -O2):
<reg16_read>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @reg16_read(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int _get_create_buttons(float);
int get_create_advance_button(float lag) {
  int b = _get_create_buttons(lag);
  if (b > 100000)
    return (b);
  return ((b >> 2) & 0x1);
}


x86 assembly (clang, -O0):
<get_create_advance_button>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <_get_create_buttons@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jle    1142 <get_create_advance_button+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <get_create_advance_button+0x3e>
mov    -0xc(%rbp),%eax
sar    $0x2,%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_create_advance_button>:
push   %rax
call   1030 <_get_create_buttons@plt>
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
cmp    $0x186a1,%eax
cmovl  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_create_advance_button(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = call i32 @_get_create_buttons(float %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 100000
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %4
%13 = ashr i32 %12, 2
%14 = and i32 %13, 1
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_create_advance_button(float %0) {
%2 = tail call i32 @_get_create_buttons(float %0)
%3 = icmp sgt i32 %2, 100000
%4 = lshr i32 %2, 2
%5 = and i32 %4, 1
%6 = select i1 %3, i32 %2, i32 %5
ret i32 %6
}