xunge/DecIR huggingface dataset:
int ld_blg_mm2(long double *a1, long double *a2) {
  return !(__builtin_islessgreater(*a1, *a2));
}


x86 assembly (clang, -O0):
<ld_blg_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blg_mm2>:
fldt   (%rdi)
fldt   (%rsi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ld_blg_mm2(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp ueq x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
scalar_t__ _get_u32(int /*<<< orphan*/ const *);
uint64_t _get_u64(const uint8_t *p) {
  return (uint64_t)_get_u32(p) | ((uint64_t)_get_u32(p + 4) << 32);
}


x86 assembly (clang, -O0):
<_get_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_u32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <_get_u32@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_u64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <_get_u32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <_get_u32@plt>

LLVM IR (-O0):
define i32 @_get_u64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @_get_u32(i32* %3)
%5 = trunc i64 %4 to i32
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = call i64 @_get_u32(i32* %7)
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 32
%11 = or i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_get_u64(i32* %0) {
%2 = tail call i64 @_get_u32(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i64 @_get_u32(i32* %3)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ nokia_lcd_clear();
int /*<<< orphan*/ nokia_lcd_render();
int /*<<< orphan*/ nokia_lcd_set_cursor(int, int);
int /*<<< orphan*/ nokia_lcd_write_string(char *, int);
int /*<<< orphan*/ snake_show_score();
void print_lose() {
  nokia_lcd_clear();
  snake_show_score();
  nokia_lcd_set_cursor(10, 15);
  nokia_lcd_write_string("Lose!!", 2);
  nokia_lcd_render();
}


x86 assembly (clang, -O0):
<print_lose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <nokia_lcd_clear@plt>
mov    $0x0,%al
call   1030 <snake_show_score@plt>
mov    $0xa,%edi
mov    $0xf,%esi
call   1050 <nokia_lcd_set_cursor@plt>
lea    0xe88(%rip),%rdi
mov    $0x2,%esi
call   1070 <nokia_lcd_write_string@plt>
mov    $0x0,%al
call   1040 <nokia_lcd_render@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_lose>:
push   %rax
xor    %eax,%eax
call   1060 <nokia_lcd_clear@plt>
xor    %eax,%eax
call   1030 <snake_show_score@plt>
mov    $0xa,%edi
mov    $0xf,%esi
call   1050 <nokia_lcd_set_cursor@plt>
lea    0xe8b(%rip),%rdi
mov    $0x2,%esi
call   1070 <nokia_lcd_write_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <nokia_lcd_render@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Lose!!\00"
define void @print_lose() {
%1 = call i32 (...) @nokia_lcd_clear()
%2 = call i32 (...) @snake_show_score()
%3 = call i32 @nokia_lcd_set_cursor(i32 10, i32 15)
%4 = call i32 @nokia_lcd_write_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = call i32 (...) @nokia_lcd_render()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Lose!!\00"
define void @print_lose() {
%1 = tail call i32 (...) @nokia_lcd_clear()
%2 = tail call i32 (...) @snake_show_score()
%3 = tail call i32 @nokia_lcd_set_cursor(i32 10, i32 15)
%4 = tail call i32 @nokia_lcd_write_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 (...) @nokia_lcd_render()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t notset(uint8_t val, uint8_t mask) { return !(val & mask); }


x86 assembly (clang, -O0):
<notset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<notset>:
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @notset(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 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @notset(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void process_function_graph(struct pevent *pevent,
                            struct pevent_record *record) {}


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

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

LLVM IR (-O0):
%struct.pevent = type opaque
%struct.pevent_record = type opaque
define void @process_function_graph(%struct.pevent* %0, %struct.pevent_record* %1) {
%3 = alloca %struct.pevent*
%4 = alloca %struct.pevent_record*
store %struct.pevent* %0, %struct.pevent** %3
store %struct.pevent_record* %1, %struct.pevent_record** %4
ret void
}

LLVM IR (-O2):
%struct.pevent = type opaque
%struct.pevent_record = type opaque
define void @process_function_graph(%struct.pevent* nocapture %0, %struct.pevent_record* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/"
             "LibFontConfig/src/fc-cat/.libs/lt-fc-cat.c",
             311, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x137,%esi
lea    0xf4d(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf68(%rip),%rdx
mov    $0x137,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibFontConfig/src/fc-cat/.libs/lt-fc-cat.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibFontConfig/src/fc-cat/.libs/lt-fc-cat.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
unsigned Cyc_Position_segment_join(unsigned s1, unsigned s2) {
  if (s1 == (unsigned)0)
    return s2;
  if (s2 == (unsigned)0)
    return s1;
  return s1;
}


x86 assembly (clang, -O0):
<Cyc_Position_segment_join>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <Cyc_Position_segment_join+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <Cyc_Position_segment_join+0x3a>
cmpl   $0x0,-0xc(%rbp)
jne    1134 <Cyc_Position_segment_join+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <Cyc_Position_segment_join+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Position_segment_join>:
mov    %esi,%eax
test   %edi,%edi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Cyc_Position_segment_join(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int TimeCompare(const void *a, const void *b) {
  int timea, timeb;
  timea = *(int *)a;
  timeb = *(int *)b;
  if (timea < timeb)
    return -1;
  else if (timea > timeb)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<TimeCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <TimeCompare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <TimeCompare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <TimeCompare+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <TimeCompare+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeCompare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @TimeCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int test_imm_D1int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xD1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D1int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 897648164864
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int avail_in;
  int /*<<< orphan*/ *next_in;
};
typedef TYPE_1__ z_stream;
typedef int /*<<< orphan*/ Bytef;

/* Variables and functions */
void streaming_commons_set_avail_in(z_stream *stream, char *buff,
                                    unsigned int avail) {
  stream->next_in = (Bytef *)buff;
  stream->avail_in = avail;
}


x86 assembly (clang, -O0):
<streaming_commons_set_avail_in>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<streaming_commons_set_avail_in>:
mov    %rsi,0x8(%rdi)
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32* }
define void @streaming_commons_set_avail_in(%struct.TYPE_3__* %0, i8* %1, i32 %2) {
%4 = alloca %struct.TYPE_3__*
%5 = alloca i8*
%6 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = bitcast i8* %7 to i32*
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
store i32* %8, i32** %10
%11 = load i32, i32* %6
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32* }
define void @streaming_commons_set_avail_in(%struct.TYPE_3__* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%5 = bitcast i32** %4 to i8**
store i8* %1, i8** %5
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %2, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ select(int, int);
main() { select(10, 20); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <select@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <select@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @select(i32 10, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @select(i32 10, i32 20)
ret i32 0
}
/* Variables and functions */
char *strcpy(int /*<<< orphan*/, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ xmalloc(scalar_t__);
char *xstrdup(char *s) { return strcpy(xmalloc(strlen(s) + 1), s); }


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @xmalloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @xmalloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
double millimetresToCentimetres(double millimetres) {
  return millimetres / 10.0;
}


x86 assembly (clang, -O0):
<millimetresToCentimetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<millimetresToCentimetres>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @millimetresToCentimetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @millimetresToCentimetres(double %0) {
%2 = fdiv double %0, 1.000000e+01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void divide() { printf("OK ate aqui\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"OK ate aqui\0A\00"
define void @divide() {
%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"OK ate aqui\00"
define void @divide() {
%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 /*<<< orphan*/ test_dup_string();
int /*<<< orphan*/ test_trim();
int /*<<< orphan*/ test_trim_left();
int /*<<< orphan*/ test_trim_right();
int /*<<< orphan*/ test_trim_trailing_newline();
void test_strings(void) {
  test_trim_right();
  test_trim_left();
  test_trim();
  test_trim_trailing_newline();
  test_dup_string();
}


x86 assembly (clang, -O0):
<test_strings>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_trim_right@plt>
mov    $0x0,%al
call   1060 <test_trim_left@plt>
mov    $0x0,%al
call   1070 <test_trim@plt>
mov    $0x0,%al
call   1040 <test_trim_trailing_newline@plt>
mov    $0x0,%al
call   1050 <test_dup_string@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strings>:
push   %rax
xor    %eax,%eax
call   1030 <test_trim_right@plt>
xor    %eax,%eax
call   1060 <test_trim_left@plt>
xor    %eax,%eax
call   1070 <test_trim@plt>
xor    %eax,%eax
call   1040 <test_trim_trailing_newline@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_dup_string@plt>

LLVM IR (-O0):
define void @test_strings() {
%1 = call i32 (...) @test_trim_right()
%2 = call i32 (...) @test_trim_left()
%3 = call i32 (...) @test_trim()
%4 = call i32 (...) @test_trim_trailing_newline()
%5 = call i32 (...) @test_dup_string()
ret void
}

LLVM IR (-O2):
define void @test_strings() {
%1 = tail call i32 (...) @test_trim_right()
%2 = tail call i32 (...) @test_trim_left()
%3 = tail call i32 (...) @test_trim()
%4 = tail call i32 (...) @test_trim_trailing_newline()
%5 = tail call i32 (...) @test_dup_string()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int /*<<< orphan*/);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 4, 0);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
call   1030 <sprintf@plt>
lea    0x2eee(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 0)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 0)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
void test1(char *s) {
  s[0] = 'a';
  s[1] = 'b';
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x62,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
movw   $0x6261,(%rdi)
ret

LLVM IR (-O0):
define void @test1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 97, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 98, i8* %6
ret void
}

LLVM IR (-O2):
define void @test1(i8* nocapture writeonly %0) {
store i8 97, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 98, i8* %2
ret void
}
main() {
  int x = 4, y = 5;
  if (x > 1) {
    if (x < 6) {
      int y = 10;
      printf(y);
    }
  }
  printf(y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1158 <main+0x48>
cmpl   $0x6,-0x8(%rbp)
jge    1153 <main+0x43>
movl   $0xa,-0x10(%rbp)
movslq -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1158 <main+0x48>
movslq -0xc(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 10 to i8*))
%2 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 5 to i8*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_5706() {
  Assert_real((isqrt(5706) == 75),
              "/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/stdlib/isqrt.c",
              1390, ("Integer square root of 5706 should be 75"));
}


x86 assembly (clang, -O0):
<t_sqrt_5706>:
push   %rbp
mov    %rsp,%rbp
mov    $0x164a,%edi
call   1030 <isqrt@plt>
cmp    $0x4b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x56e,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_5706>:
push   %rax
mov    $0x164a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x4b,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x56e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 5706 should be 75\00"
define void @t_sqrt_5706() {
%1 = call i32 @isqrt(i32 5706)
%2 = icmp eq i32 %1, 75
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1390, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 5706 should be 75\00"
define void @t_sqrt_5706() {
%1 = tail call i32 @isqrt(i32 5706)
%2 = icmp eq i32 %1, 75
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1390, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ processChild();
int /*<<< orphan*/ processParent();
int main(int argc, const char *argv[]) {
  int pid;
  pid = fork();
  if (pid != 0)
    processParent();
  else
    processChild();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1166 <main+0x36>
mov    $0x0,%al
call   1040 <processParent@plt>
jmp    116d <main+0x3d>
mov    $0x0,%al
call   1030 <processChild@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     1145 <main+0x15>
xor    %eax,%eax
call   1040 <processParent@plt>
jmp    114c <main+0x1c>
xor    %eax,%eax
call   1030 <processChild@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @processParent()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @processChild()
br label %9
9: ; preds = %7, %5
ret i32 0
}
void osd_signal_(int i) {}


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

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

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

LLVM IR (-O2):
define void @osd_signal_(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int, float, char, char *);
int main(void) {
  char ch = 'c';
  char *chptr = &ch;
  int i = 20;
  int *intptr = &i;
  float f = 1.20000;
  float *fptr = &f;
  char *ptr = "I am a string";
  printf("\n [%c], [%d], [%f], [%c], [%s]\n", *chptr, *intptr, *fptr, *ptr,
         ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x63,-0x5(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xeae(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x38(%rbp),%rax
mov    (%rax),%al
mov    -0x38(%rbp),%r8
lea    0xe93(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefa(%rip),%rdi
lea    0xee5(%rip),%r8
movss  0xed9(%rip),%xmm0
mov    $0x63,%esi
mov    $0x14,%edx
mov    $0x49,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"I am a string\00"
@.str.1 = [32 x i8] c"\0A [%c], [%d], [%f], [%c], [%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca float
%7 = alloca float*
%8 = alloca i8*
store i32 0, i32* %1
store i8 99, i8* %2
store i8* %2, i8** %3
store i32 20, i32* %4
store i32* %4, i32** %5
store float 0x3FF3333340000000, float* %6
store float* %6, float** %7
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = load i8*, i8** %8
%16 = load i8, i8* %15
%17 = load i8*, i8** %8
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 signext %10, i32 %12, float %14, i8 signext %16, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"I am a string\00"
@.str.1 = [32 x i8] c"\0A [%c], [%d], [%f], [%c], [%s]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 signext 99, i32 20, float 0x3FF3333340000000, i8 signext 73, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned char owTouchByte(int);
unsigned char owReadByte(void) { return owTouchByte(0xFF); }


x86 assembly (clang, -O0):
<owReadByte>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <owTouchByte@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<owReadByte>:
mov    $0xff,%edi
jmp    1030 <owTouchByte@plt>

LLVM IR (-O0):
define zeroext i8 @owReadByte() {
%1 = call zeroext i8 @owTouchByte(i32 255)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @owReadByte() {
%1 = tail call zeroext i8 @owTouchByte(i32 255)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ wNotYet(char *);
void wBuiltinInsertAt() { wNotYet("InsertAt"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"InsertAt\00"
define void @wBuiltinInsertAt() {
%1 = call i32 @wNotYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"InsertAt\00"
define void @wBuiltinInsertAt() {
%1 = tail call i32 @wNotYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isIF_T(const char *comm) { return strcmp(comm, "if_t") == 0; }


x86 assembly (clang, -O0):
<isIF_T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isIF_T>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"if_t\00"
define i32 @isIF_T(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"if_t\00"
define i32 @isIF_T(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char, int);
int /*<<< orphan*/ uart_tx(char);
void puthexdig(int hex) {
  char hexletters[] = "0123456789abcdef";
  if (hex > 15)
    return;
  putchar(hexletters[hex], 0x0A);
  uart_tx(hexletters[hex]);
  return;
}


x86 assembly (clang, -O0):
<puthexdig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x10(%rbp)
cmpl   $0xf,-0x4(%rbp)
jle    1159 <puthexdig+0x39>
jmp    117a <puthexdig+0x5a>
movslq -0x4(%rbp),%rax
mov    $0xa,%esi
movsbl -0x20(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
movslq -0x4(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%edi
call   1040 <uart_tx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthexdig>:
cmp    $0xf,%edi
jle    1126 <puthexdig+0x6>
ret
push   %rbx
movslq %edi,%rax
lea    0xecf(%rip),%rcx
movsbl (%rax,%rcx,1),%ebx
mov    %ebx,%edi
mov    $0xa,%esi
call   1030 <putchar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <uart_tx@plt>

LLVM IR (-O0):
@__const.puthexdig.hexletters = [17 x i8] c"0123456789abcdef\00"
define void @puthexdig(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i8]
store i32 %0, i32* %2
%4 = bitcast [17 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 15
br i1 %6, label %7, label %8
7: ; preds = %1
br label %19
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = call i32 @putchar(i8 signext %12, i32 10)
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @uart_tx(i8 signext %17)
br label %19
19: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@__const.puthexdig.hexletters = [17 x i8] c"0123456789abcdef\00"
define void @puthexdig(i32 %0) {
%2 = icmp sgt i32 %0, 15
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.puthexdig.hexletters, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @putchar(i8 signext %6, i32 10)
%8 = tail call i32 @uart_tx(i8 signext %6)
br label %9
9: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_clearsilver_template_comment_entities();
int /*<<< orphan*/ test_clearsilver_template_comments();
void all_clearsilver_template_tests() {
  test_clearsilver_template_comments();
  test_clearsilver_template_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_clearsilver_template_tests() {
%1 = call i32 (...) @test_clearsilver_template_comments()
%2 = call i32 (...) @test_clearsilver_template_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_clearsilver_template_tests() {
%1 = tail call i32 (...) @test_clearsilver_template_comments()
%2 = tail call i32 (...) @test_clearsilver_template_comment_entities()
ret void
}
int mystery(int *ptra, int *ptrb) {
  int *temp;
  temp = ptrb;
  ptrb = ptra;
  ptra = temp;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @mystery(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
unsigned int INT_MAX;
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
unsigned sleep(unsigned seconds) {
  struct timespec rqt;
  struct timespec rmt;
  if (seconds > INT_MAX) {
    seconds = INT_MAX;
  }
  rqt.tv_sec = seconds;
  rqt.tv_nsec = 0;
  (void)nanosleep(&rqt, &rmt);
  return (unsigned)rmt.tv_sec;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jbe    1139 <sleep+0x29>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
sub    $0x28,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
cmp    %edi,%eax
cmovb  %eax,%edi
mov    %edi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
mov    0x18(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@INT_MAX = global i32 0
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @INT_MAX
%7 = icmp ugt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @INT_MAX
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %11, i32* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %13
%14 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@INT_MAX = global i32 0
define i32 @sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = load i32, i32* @INT_MAX
%7 = icmp ult i32 %6, %0
%8 = select i1 %7, i32 %6, i32 %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %10
%11 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%13 = load i32, i32* %12
ret i32 %13
}
/* Variables and functions */
unsigned int page_start(const void *address) {
  return (((intptr_t)address) / 4096);
}


x86 assembly (clang, -O0):
<page_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1000,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_start>:
lea    0xfff(%rdi),%rax
test   %rdi,%rdi
cmovns %rdi,%rax
shr    $0xc,%rax
ret

LLVM IR (-O0):
define i32 @page_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = sdiv i64 %4, 4096
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @page_start(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = sdiv i64 %2, 4096
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
void abort_safe(void) {
  struct sigaction sa = {.sa_handler = SIG_DFL};
  sigaction(SIGABRT, &sa, NULL);
  abort();
  exit(1);
  kill(getpid(), SIGKILL);
}


x86 assembly (clang, -O0):
<abort_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <sigaction@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<abort_safe>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1040 <sigaction@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGABRT = global i32 0
@SIGKILL = global i32 0
define void @abort_safe() {
%1 = alloca %struct.sigaction
%2 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
%3 = load i32, i32* @SIG_DFL
store i32 %3, i32* %2
%4 = load i32, i32* @SIGABRT
%5 = call i32 @sigaction(i32 %4, %struct.sigaction* %1, i32* null)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGABRT = global i32 0
@SIGKILL = global i32 0
define void @abort_safe() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
%4 = load i32, i32* @SIG_DFL
store i32 %4, i32* %3
%5 = load i32, i32* @SIGABRT
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32* null)
%7 = call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void BeginRegion(pthread_mutex_t mutex) { pthread_mutex_lock(&mutex); }


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

x86 assembly (clang, -O2):
<BeginRegion>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <pthread_mutex_lock@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @BeginRegion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pthread_mutex_lock(i32* %2)
ret void
}
/* Variables and functions */
int fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
void sgi_flush6_(void) {
  int return_code;
  return_code = fflush(stdout);
  if (return_code == 0)
    return;
  (void)perror("Error detected in sgi_flush6:");
}


x86 assembly (clang, -O0):
<sgi_flush6_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <sgi_flush6_+0x28>
jmp    1154 <sgi_flush6_+0x34>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgi_flush6_>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
test   %eax,%eax
jne    1135 <sgi_flush6_+0x15>
pop    %rax
ret
lea    0xec4(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [30 x i8] c"Error detected in sgi_flush6:\00"
define void @sgi_flush6_() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [30 x i8] c"Error detected in sgi_flush6:\00"
define void @sgi_flush6_() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
ret void
}
int client_whandle(int fd, void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @client_whandle(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *strstr(char *, char *);
long get_body_start(char *request) {
  char *ptr = strstr(request, "\r\n\r\n");
  return (ptr == NULL) ? -1 : (ptr + 4) - request;
}


x86 assembly (clang, -O0):
<get_body_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <get_body_start+0x3b>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    115e <get_body_start+0x4e>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_body_start>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
add    $0x4,%rcx
cmp    $0x1,%rax
sbb    %rax,%rax
or     %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define i64 @get_body_start(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %16
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = load i8*, i8** %2
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
br label %16
16: ; preds = %9, %8
%17 = phi i64 [ -1, %8 ], [ %15, %9 ]
ret i64 %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define i64 @get_body_start(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 4
%5 = ptrtoint i8* %4 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %3, i64 -1, i64 %7
ret i64 %8
}