xunge/DecIR huggingface dataset:
unsigned int slen(const char *str) {
  int i = 0;
  while (i < 100) {
    if (str[i++] == 0)
      return i;
  }
  return i - 1;
}


x86 assembly (clang, -O0):
<slen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1148 <slen+0x48>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1143 <slen+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <slen+0x51>
jmp    110f <slen+0xf>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slen>:
mov    $0x3,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x67,%rax
je     1140 <slen+0x40>
cmpb   $0x0,-0x3(%rdi,%rax,1)
je     1146 <slen+0x46>
cmpb   $0x0,-0x2(%rdi,%rax,1)
je     114b <slen+0x4b>
cmpb   $0x0,-0x1(%rdi,%rax,1)
je     114f <slen+0x4f>
lea    0x4(%rax),%rcx
cmpb   $0x0,(%rdi,%rax,1)
mov    %rcx,%rax
jne    1110 <slen+0x10>
add    $0xfffffffffffffffd,%rcx
mov    %rcx,%rax
ret
mov    $0x63,%eax
ret
add    $0xfffffffffffffffe,%rax
ret
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i32 @slen(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 = %19, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = load i32, i32* %4
store i32 %18, i32* %2
br label %23
19: ; preds = %8
br label %5
20: ; preds = %5
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %2
br label %23
23: ; preds = %20, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @slen(i8* nocapture %0) {
br label %2
2: ; preds = %20, %1
%3 = phi i64 [ 0, %1 ], [ %21, %20 ]
%4 = icmp eq i64 %3, 100
br i1 %4, label %28, label %5
5: ; preds = %2
%6 = or i64 %3, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %25, label %10
10: ; preds = %5
%11 = or i64 %3, 2
%12 = getelementptr inbounds i8, i8* %0, i64 %6
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %25, label %15
15: ; preds = %10
%16 = or i64 %3, 3
%17 = getelementptr inbounds i8, i8* %0, i64 %11
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %25, label %20
20: ; preds = %15
%21 = add nuw nsw i64 %3, 4
%22 = getelementptr inbounds i8, i8* %0, i64 %16
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %25, label %2
25: ; preds = %20, %15, %10, %5
%26 = phi i64 [ %6, %5 ], [ %11, %10 ], [ %16, %15 ], [ %21, %20 ]
%27 = trunc i64 %26 to i32
br label %28
28: ; preds = %2, %25
%29 = phi i32 [ %27, %25 ], [ 99, %2 ]
ret i32 %29
}
int pre_ign(struct termp *p, struct mtermp *mt, const struct man_node *n,
            const struct man_meta *meta) {
  return (0);
}


x86 assembly (clang, -O0):
<pre_ign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.termp = type opaque
%struct.mtermp = type opaque
%struct.man_node = type opaque
%struct.man_meta = type opaque
define i32 @pre_ign(%struct.termp* %0, %struct.mtermp* %1, %struct.man_node* %2, %struct.man_meta* %3) {
%5 = alloca %struct.termp*
%6 = alloca %struct.mtermp*
%7 = alloca %struct.man_node*
%8 = alloca %struct.man_meta*
store %struct.termp* %0, %struct.termp** %5
store %struct.mtermp* %1, %struct.mtermp** %6
store %struct.man_node* %2, %struct.man_node** %7
store %struct.man_meta* %3, %struct.man_meta** %8
ret i32 0
}

LLVM IR (-O2):
%struct.termp = type opaque
%struct.mtermp = type opaque
%struct.man_node = type opaque
%struct.man_meta = type opaque
define i32 @pre_ign(%struct.termp* nocapture readnone %0, %struct.mtermp* nocapture readnone %1, %struct.man_node* nocapture readnone %2, %struct.man_meta* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c();
int /*<<< orphan*/ e();
int /*<<< orphan*/ h();
void j() {
  int a;
  e();
  c();
  if (a)
    h();
}


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <e@plt>
mov    $0x0,%al
call   1050 <c@plt>
cmpl   $0x0,-0x4(%rbp)
je     1157 <j+0x27>
mov    $0x0,%al
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @j() {
%1 = alloca i32
%2 = call i32 (...) @e()
%3 = call i32 (...) @c()
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @h()
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @j() {
%1 = tail call i32 (...) @e()
%2 = tail call i32 (...) @c()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int supporting_set_structure(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(110, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<supporting_set_structure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x6e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supporting_set_structure>:
mov    $0x6e,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @supporting_set_structure() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 110, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
scalar_t__ char2int(char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ verbose(int, char *, long);
int parse_size(char *msgbuf, size_t msglen, off_t *size) {
  if (msglen != sizeof(*size))
    exit(1);
  *size = char2int(msgbuf, sizeof(*size));
  verbose(1, "parse_size: size = %ld\n", (long)*size);
  return 0;
}


x86 assembly (clang, -O0):
<parse_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x8,-0x10(%rbp)
je     1159 <parse_size+0x29>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <char2int@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xe7c(%rip),%rsi
call   1040 <verbose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_size>:
push   %rbx
cmp    $0x8,%rsi
jne    115f <parse_size+0x2f>
mov    %rdx,%rbx
mov    $0x8,%esi
call   1030 <char2int@plt>
mov    %rax,(%rbx)
lea    0xeb2(%rip),%rsi
mov    $0x1,%edi
mov    %rax,%rdx
call   1040 <verbose@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"parse_size: size = %ld\0A\00"
define i32 @parse_size(i8* %0, i64 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %5
%8 = icmp ne i64 %7, 8
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i64 @char2int(i8* %12, i32 8)
%14 = load i64*, i64** %6
store i64 %13, i64* %14
%15 = load i64*, i64** %6
%16 = load i64, i64* %15
%17 = call i32 @verbose(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"parse_size: size = %ld\0A\00"
define i32 @parse_size(i8* %0, i64 %1, i64* nocapture writeonly %2) {
%4 = icmp eq i64 %1, 8
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %3
%8 = tail call i64 @char2int(i8* %0, i32 8)
store i64 %8, i64* %2
%9 = tail call i32 @verbose(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ irq_install();
int /*<<< orphan*/ isr_install();
int /*<<< orphan*/ kprint(char *);
int /*<<< orphan*/ kprint_at(char *, int, int /*<<< orphan*/);
void kernel_main() {
  isr_install();
  irq_install();
  clear_screen();
  kprint_at("Project Esperanto", 30, 0);
  kprint("\n> ");
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <isr_install@plt>
mov    $0x0,%al
call   1040 <irq_install@plt>
mov    $0x0,%al
call   1070 <clear_screen@plt>
lea    0xe90(%rip),%rdi
mov    $0x1e,%esi
xor    %edx,%edx
call   1030 <kprint_at@plt>
lea    0xe8f(%rip),%rdi
call   1050 <kprint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1060 <isr_install@plt>
xor    %eax,%eax
call   1040 <irq_install@plt>
xor    %eax,%eax
call   1070 <clear_screen@plt>
lea    0xe93(%rip),%rdi
mov    $0x1e,%esi
xor    %edx,%edx
call   1030 <kprint_at@plt>
lea    0xe92(%rip),%rdi
pop    %rax
jmp    1050 <kprint@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Project Esperanto\00"
@.str.1 = [4 x i8] c"\0A> \00"
define void @kernel_main() {
%1 = call i32 (...) @isr_install()
%2 = call i32 (...) @irq_install()
%3 = call i32 (...) @clear_screen()
%4 = call i32 @kprint_at(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 30, i32 0)
%5 = call i32 @kprint(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Project Esperanto\00"
@.str.1 = [4 x i8] c"\0A> \00"
define void @kernel_main() {
%1 = tail call i32 (...) @isr_install()
%2 = tail call i32 (...) @irq_install()
%3 = tail call i32 (...) @clear_screen()
%4 = tail call i32 @kprint_at(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 30, i32 0)
%5 = tail call i32 @kprint(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA8_DriverIRQHandler();
__attribute__((weak)) void DMA8_IRQHandler(void) { DMA8_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA8_IRQHandler() {
%1 = call i32 (...) @DMA8_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA8_IRQHandler() {
%1 = tail call i32 (...) @DMA8_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ssd1306_write_command(int);
void ssd1306_display_on(void) { ssd1306_write_command(0xAF); }


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

x86 assembly (clang, -O2):
<ssd1306_display_on>:
mov    $0xaf,%edi
jmp    1030 <ssd1306_write_command@plt>

LLVM IR (-O0):
define void @ssd1306_display_on() {
%1 = call i32 @ssd1306_write_command(i32 175)
ret void
}

LLVM IR (-O2):
define void @ssd1306_display_on() {
%1 = tail call i32 @ssd1306_write_command(i32 175)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void p_spaces(int n) {
  while (n-- > 0)
    putchar(' ');
}


x86 assembly (clang, -O0):
<p_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    113e <p_spaces+0x2e>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    111b <p_spaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_spaces>:
push   %rbx
test   %edi,%edi
jle    1132 <p_spaces+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <p_spaces+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @p_spaces(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 32)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @p_spaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 32)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
int min2(int x, int y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min2+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min2+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min2>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min2(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bsd_srand_actual(unsigned int);
int /*<<< orphan*/ srand(unsigned int);
void bsd_srand_wrapper(unsigned seed) {
  bsd_srand_actual(seed);
  srand(seed);
}


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

x86 assembly (clang, -O2):
<bsd_srand_wrapper>:
push   %rbx
mov    %edi,%ebx
call   1040 <bsd_srand_actual@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @bsd_srand_wrapper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bsd_srand_actual(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @srand(i32 %5)
ret void
}

LLVM IR (-O2):
define void @bsd_srand_wrapper(i32 %0) {
%2 = tail call i32 @bsd_srand_actual(i32 %0)
%3 = tail call i32 @srand(i32 %0)
ret void
}
void zterp_os_set_style(int style, const struct color *fg,
                        const struct color *bg) {}


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

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

LLVM IR (-O0):
%struct.color = type opaque
define void @zterp_os_set_style(i32 %0, %struct.color* %1, %struct.color* %2) {
%4 = alloca i32
%5 = alloca %struct.color*
%6 = alloca %struct.color*
store i32 %0, i32* %4
store %struct.color* %1, %struct.color** %5
store %struct.color* %2, %struct.color** %6
ret void
}

LLVM IR (-O2):
%struct.color = type opaque
define void @zterp_os_set_style(i32 %0, %struct.color* nocapture %1, %struct.color* nocapture %2) {
ret void
}
/* Variables and functions */
int leftShift(int, int);
int twoToThePowerOf(int);
int encodeException(int exception, int parameter) {
  if (parameter < 0)
    parameter = parameter + twoToThePowerOf(16);
  return leftShift(exception, 16) + parameter;
}


x86 assembly (clang, -O0):
<encodeException>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1152 <encodeException+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x10,%edi
call   1030 <twoToThePowerOf@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
call   1040 <leftShift@plt>
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeException>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %esi,%esi
jns    1137 <encodeException+0x17>
mov    $0x10,%edi
call   1030 <twoToThePowerOf@plt>
add    %eax,%ebx
mov    %ebp,%edi
mov    $0x10,%esi
call   1040 <leftShift@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @encodeException(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @twoToThePowerOf(i32 16)
%6 = add nsw i32 %5, %1
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ %1, %2 ]
%9 = tail call i32 @leftShift(i32 %0, i32 16)
%10 = add nsw i32 %9, %8
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void op_res(void *_a, void *_b) {
  uint8_t *a = (uint8_t *)_a;
  uint8_t *b = (uint8_t *)_b;
  *a &= ~(1 << *b);
}


x86 assembly (clang, -O0):
<op_res>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x18(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_res>:
mov    (%rsi),%cl
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @op_res(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = shl i32 1, %12
%14 = xor i32 %13, -1
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = and i32 %16, %14
store i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @op_res(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = shl nuw i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = and i32 %8, %7
store i32 %9, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glLineWidth(double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScaled(double, double, double);
int /*<<< orphan*/ glutWireCube(double);
void drawWorldBox(double width, double height, double depth) {
  glPushMatrix();
  glScaled(width, height, depth);
  glLineWidth(2.0);
  glColor3f(1.0, 1.0, 1.0);
  glutWireCube(1.0);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawWorldBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x0,%al
call   1070 <glPushMatrix@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1060 <glScaled@plt>
movsd  0xe6e(%rip),%xmm0
call   1030 <glLineWidth@plt>
movsd  0xe59(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
movsd  0xe46(%rip),%xmm0
call   1080 <glutWireCube@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawWorldBox>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1070 <glPushMatrix@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1060 <glScaled@plt>
movsd  0xe66(%rip),%xmm0
call   1030 <glLineWidth@plt>
movsd  0xe61(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glColor3f@plt>
movsd  0xe4e(%rip),%xmm0
call   1080 <glutWireCube@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawWorldBox(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call i32 (...) @glPushMatrix()
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call i32 @glScaled(double %8, double %9, double %10)
%12 = call i32 @glLineWidth(double 2.000000e+00)
%13 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%14 = call i32 @glutWireCube(double 1.000000e+00)
%15 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawWorldBox(double %0, double %1, double %2) {
%4 = tail call i32 (...) @glPushMatrix()
%5 = tail call i32 @glScaled(double %0, double %1, double %2)
%6 = tail call i32 @glLineWidth(double 2.000000e+00)
%7 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%8 = tail call i32 @glutWireCube(double 1.000000e+00)
%9 = tail call i32 (...) @glPopMatrix()
ret void
}
void foo320(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo320(i32 %0) {
ret void
}
int get_packet_type(unsigned char first_byte) {
  return (first_byte >> 4) & 0x0F;
}


x86 assembly (clang, -O0):
<get_packet_type>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_packet_type>:
shr    $0x4,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @get_packet_type(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_packet_type(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = zext i8 %2 to i32
ret i32 %3
}
long unsigned int gcd(long unsigned int a, long unsigned int b) {
  long unsigned int temp;
  while (b != 0) {
    temp = b;
    b = a % b;
    a = temp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <gcd+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = urem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Variables and functions */
void *malloc(unsigned int);
void *heap_malloc(unsigned int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<heap_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @heap_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
void rl_set_screen_size(rows, cols) int rows, cols;
{ _rl_set_screen_size(rows, cols); }


x86 assembly (clang, -O0):
<rl_set_screen_size>:
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    $0x0,%al
call   1030 <_rl_set_screen_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rl_set_screen_size(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 (i32, i32, ...) bitcast (i32 (...)* @_rl_set_screen_size to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @rl_set_screen_size(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_rl_set_screen_size to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vadd(double *, double *, double *, int);
int main() {
  double a[10], b[10], c[10];
  vadd(a, b, c, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
lea    -0x50(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
mov    $0xa,%ecx
call   1030 <vadd@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xf8,%rsp
lea    0xa0(%rsp),%rdi
lea    0x50(%rsp),%rsi
mov    %rsp,%rdx
mov    $0xa,%ecx
call   1030 <vadd@plt>
xor    %eax,%eax
add    $0xf8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca [10 x double]
%3 = alloca [10 x double]
%4 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%5 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x double], [10 x double]* %3, i64 0, i64 0
%7 = call i32 @vadd(double* %4, double* %5, double* %6, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca [10 x double]
%3 = alloca [10 x double]
%4 = bitcast [10 x double]* %1 to i8*
%5 = bitcast [10 x double]* %2 to i8*
%6 = bitcast [10 x double]* %3 to i8*
%7 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 0
%9 = getelementptr inbounds [10 x double], [10 x double]* %3, i64 0, i64 0
%10 = call i32 @vadd(double* %7, double* %8, double* %9, i32 10)
ret i32 0
}
/* Variables and functions */
char const *remote_s1();
const char *call_remote_s1(void) { return remote_s1() + 1; }


x86 assembly (clang, -O0):
<call_remote_s1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <remote_s1@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_remote_s1>:
push   %rax
xor    %eax,%eax
call   1030 <remote_s1@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_remote_s1() {
%1 = call i8* (...) @remote_s1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_remote_s1() {
%1 = tail call i8* (...) @remote_s1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("You don't input sth. like BBB when compile. Right?\n");
  printf("Input CCC when compile to stop me output this line\n");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"You don't input sth. like BBB when compile. Right?\0A\00"
@.str.1 = [52 x i8] c"Input CCC when compile to stop me output this line\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [51 x i8] c"You don't input sth. like BBB when compile. Right?\00"
@str.2 = [51 x i8] c"Input CCC when compile to stop me output this line\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void lowlevel_gpio_set(int id) {}


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

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

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

LLVM IR (-O2):
define void @lowlevel_gpio_set(i32 %0) {
ret void
}
int rk31sdk_get_sdmmc0_pin_io_voltage(void) {
  int voltage;
  voltage = 3300;
  return voltage;
}


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

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

LLVM IR (-O0):
define i32 @rk31sdk_get_sdmmc0_pin_io_voltage() {
%1 = alloca i32
store i32 3300, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @rk31sdk_get_sdmmc0_pin_io_voltage() {
ret i32 3300
}
/* Variables and functions */
int /*<<< orphan*/ GyroStateHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void GyroStateLogging() { UAVObjLogging(GyroStateHandle()); }


x86 assembly (clang, -O0):
<GyroStateLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GyroStateHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyroStateLogging>:
push   %rax
xor    %eax,%eax
call   1040 <GyroStateHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @GyroStateLogging() {
%1 = call i32 (...) @GyroStateHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GyroStateLogging() {
%1 = tail call i32 (...) @GyroStateHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int RTLD_GLOBAL;
int RTLD_NOW;
int /*<<< orphan*/ SSL_library_init();
void *dlopen(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *open_ssl_library() {
  void *handle;
  SSL_library_init();
  handle = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
  if (!handle) {
    fprintf(stderr, "dlopen failed\n");
    exit(1);
  }
  return handle;
}


x86 assembly (clang, -O0):
<open_ssl_library>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    0x2e89(%rip),%rax
or     (%rax),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <dlopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1198 <open_ssl_library+0x58>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_ssl_library>:
push   %rax
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
mov    0x2e91(%rip),%rax
mov    0x2e92(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
xor    %edi,%edi
call   1040 <dlopen@plt>
test   %rax,%rax
je     1168 <open_ssl_library+0x28>
pop    %rcx
ret
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
@stderr = global i32 0
@.str = [15 x i8] c"dlopen failed\0A\00"
define i8* @open_ssl_library() {
%1 = alloca i8*
%2 = call i32 (...) @SSL_library_init()
%3 = load i32, i32* @RTLD_NOW
%4 = load i32, i32* @RTLD_GLOBAL
%5 = or i32 %3, %4
%6 = call i8* @dlopen(i32* null, i32 %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = icmp ne i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %0
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %0
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
@stderr = global i32 0
@.str = [15 x i8] c"dlopen failed\0A\00"
define i8* @open_ssl_library() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = load i32, i32* @RTLD_NOW
%3 = load i32, i32* @RTLD_GLOBAL
%4 = or i32 %3, %2
%5 = tail call i8* @dlopen(i32* null, i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %0
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int chdir(const char *path) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<chdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdir>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @chdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EACCES
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @chdir(i8* nocapture readnone %0) {
%2 = load i32, i32* @EACCES
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ hook(char *);
void init(void) { hook("init() called inside all-good."); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"init() called inside all-good.\00"
define void @init() {
%1 = call i32 @hook(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"init() called inside all-good.\00"
define void @init() {
%1 = tail call i32 @hook(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
int close(int _fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
ret i32 0
}
void OS_ThreadSleep(int ticks) { (void)ticks; }


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

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

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

LLVM IR (-O2):
define void @OS_ThreadSleep(i32 %0) {
ret void
}
void gtk_container_get_border_width() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_get_border_width() {
ret void
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, unsigned int, unsigned int, void *);
int shim_seccomp(unsigned int operation, unsigned int flags, void *args) {
  return (int)shim_enosys(0, operation, flags, args);
}


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

x86 assembly (clang, -O2):
<shim_seccomp>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_seccomp(i32 %0, i32 %1, i8* %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, i32 %1, i8* %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main(void) {
  printf("kill myself\n");
  raise(SIGKILL);
  printf("should not be here, never\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"kill myself\0A\00"
@SIGKILL = global i32 0
@.str.1 = [27 x i8] c"should not be here, never\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SIGKILL
%4 = call i32 @raise(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@SIGKILL = global i32 0
@str = [12 x i8] c"kill myself\00"
@str.2 = [26 x i8] c"should not be here, never\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @SIGKILL
%3 = tail call i32 @raise(i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("cd /mnt/user/code/MotorDriveTrain/bin && /mnt/user/jvm/java Main");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"cd /mnt/user/code/MotorDriveTrain/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [65 x i8] c"cd /mnt/user/code/MotorDriveTrain/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xb8() {
  Assert_real((isupper(184) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              925, ("isupper should be 0 for 0xb8"));
}


x86 assembly (clang, -O0):
<t_isupper_0xb8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x39d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xb8>:
push   %rax
mov    $0xb8,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x39d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb8\00"
define void @t_isupper_0xb8() {
%1 = call i64 @isupper(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb8\00"
define void @t_isupper_0xb8() {
%1 = tail call i64 @isupper(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MON_9;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_mon_9() { return nl_langinfo(MON_9); }


x86 assembly (clang, -O0):
<langinfo_mon_9>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_mon_9>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@MON_9 = global i32 0
define i8* @langinfo_mon_9() {
%1 = load i32, i32* @MON_9
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@MON_9 = global i32 0
define i8* @langinfo_mon_9() {
%1 = load i32, i32* @MON_9
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
int test_minusOne(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @test_minusOne() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @test_minusOne() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_isneg(int nb) {
  if (nb >= 0) {
    my_putchar('P');
  } else {
    my_putchar('N');
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_isneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1134 <my_isneg+0x24>
mov    $0x50,%edi
call   1030 <my_putchar@plt>
jmp    113e <my_isneg+0x2e>
mov    $0x4e,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isneg>:
push   %rax
not    %edi
shr    $0x1f,%edi
add    %edi,%edi
add    $0x4e,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_isneg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @my_putchar(i8 signext 80)
br label %9
7: ; preds = %1
%8 = call i32 @my_putchar(i8 signext 78)
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
define i32 @my_isneg(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i8 80, i8 78
%4 = tail call i32 @my_putchar(i8 signext %3)
ret i32 0
}