xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void cb_info(const char *str, void *data) { fprintf(stderr, "%s\n", str); }


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

x86 assembly (clang, -O2):
<cb_info>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @cb_info(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @cb_info(i8* %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int is_right_bracket_char(char c) { return (c == ']'); }


x86 assembly (clang, -O0):
<is_right_bracket_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_right_bracket_char>:
xor    %eax,%eax
cmp    $0x5d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_right_bracket_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 93
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_right_bracket_char(i8 signext %0) {
%2 = icmp eq i8 %0, 93
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/
nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(
    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
extern void
nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41(
    __m128i *in, __m128i *out) {
  nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(in,
                                                                           out);
}


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

x86 assembly (clang, -O2):
<nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41>:
jmp    1030 <nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3@plt>

LLVM IR (-O0):
define void @nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41(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 @nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41(i32* %0, i32* %1) {
%3 = tail call i32 @nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getattribute(char *, int);
float microfacet_roughness(float roughness, float depth_scale) {
  float out = roughness;
  if (depth_scale > 1) {
    int ray_depth;
    getattribute("path:ray_depth", ray_depth);
    if (ray_depth) {
      out = roughness * depth_scale * ray_depth;
    }
  }
  return out;
}


x86 assembly (clang, -O0):
<microfacet_roughness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1178 <microfacet_roughness+0x68>
mov    -0x10(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <getattribute@plt>
cmpl   $0x0,-0x10(%rbp)
je     1173 <microfacet_roughness+0x63>
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1178 <microfacet_roughness+0x68>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microfacet_roughness>:
push   %rax
ucomiss 0xee8(%rip),%xmm1
jbe    1132 <microfacet_roughness+0x22>
lea    0xee3(%rip),%rdi
movss  %xmm0,0x4(%rsp)
call   1030 <getattribute@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"path:ray_depth\00"
define float @microfacet_roughness(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
store float %7, float* %5
%8 = load float, float* %4
%9 = fcmp ogt float %8, 1.000000e+00
br i1 %9, label %10, label %23
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @getattribute(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = load float, float* %3
%17 = load float, float* %4
%18 = fmul float %16, %17
%19 = load i32, i32* %6
%20 = sitofp i32 %19 to float
%21 = fmul float %18, %20
store float %21, float* %5
br label %22
22: ; preds = %15, %10
br label %23
23: ; preds = %22, %2
%24 = load float, float* %5
ret float %24
}

LLVM IR (-O2):
@.str = [15 x i8] c"path:ray_depth\00"
define float @microfacet_roughness(float returned %0, float %1) {
%3 = fcmp ogt float %1, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @getattribute(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 undef)
br label %6
6: ; preds = %4, %2
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ store_nul_mr_ptr_(int *, double *);
void nullify_mr_(int *mr) {
  double *nul_ptr;
  nul_ptr = (double *)NULL;
  store_nul_mr_ptr_(mr, nul_ptr);
  return;
}


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

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

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

LLVM IR (-O2):
define void @nullify_mr_(i32* %0) {
%2 = tail call i32 @store_nul_mr_ptr_(i32* %0, double* null)
ret void
}
unsigned int csum_fold(unsigned int sum) { return ~from32to16(sum); }


x86 assembly (clang, -O0):
<csum_fold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <from32to16@plt>
xor    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @csum_fold(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @from32to16 to i32 (i32, ...)*)(i32 %3)
%5 = xor i32 %4, -1
ret i32 %5
}

LLVM IR (-O2):
define i32 @csum_fold(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @from32to16 to i32 (i32, ...)*)(i32 %0)
%3 = xor i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage(void) { printf("Usage: pwd"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Usage: pwd\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Usage: pwd\00"
define void @printUsage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a;
  int b;
  scanf("%d %d", &a, &b);
  printf("%d", a / b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sdiv i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void btlookup_callback(void *userData, char *key, char *data) {
  printf("LOOKUP FOUND @%p %s : @%p %s\n", key, key, data, data);
}


x86 assembly (clang, -O0):
<btlookup_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btlookup_callback>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdi
mov    %rsi,%rdx
mov    %rcx,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"LOOKUP FOUND @%p %s : @%p %s\0A\00"
define void @btlookup_callback(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"LOOKUP FOUND @%p %s : @%p %s\0A\00"
define void @btlookup_callback(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %1, i8* %2, i8* %2)
ret void
}
/* Variables and functions */
int convert_to_int(char *text) {
  int *p = text;
  return (0x00000000 | *p);
}


x86 assembly (clang, -O0):
<convert_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
or     $0x0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @convert_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = or i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @convert_to_int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int opaque(int x) {
  int y = 0;
  if (x < 10) {
    y = x + 1;
    if (x > 0) {
      y = x + 2;
      if (y * y >= 0) {
        if (x == 3)
          return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<opaque>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1169 <opaque+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1164 <opaque+0x64>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    $0x0,%eax
jl     115f <opaque+0x5f>
cmpl   $0x3,-0x8(%rbp)
jne    115a <opaque+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1170 <opaque+0x70>
jmp    115f <opaque+0x5f>
jmp    1164 <opaque+0x64>
jmp    1169 <opaque+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opaque>:
xor    %eax,%eax
cmp    $0x3,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @opaque(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
extern void gui_ksys_set_title_window(char *title) {
  __asm__ __volatile__("int $0x40" : : "a"(71), "b"(1), "c"(title));
}


x86 assembly (clang, -O0):
<gui_ksys_set_title_window>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x47,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_set_title_window>:
push   %rbx
mov    %rdi,%rcx
mov    $0x47,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gui_ksys_set_title_window(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 71, i32 1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die();
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t size) {
  void *res = malloc(size);
  if (res == NULL) {
    die();
  }
  memset(res, 0, size);
  return res;
}


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    115b <xmalloc+0x2b>
mov    $0x0,%al
call   1050 <die@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <xmalloc+0x1b>
xor    %eax,%eax
call   1050 <die@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @die()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @die()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gp_temp_free(size_t size, void *ptr) {
  if (size > 2048)
    free(ptr);
}


x86 assembly (clang, -O0):
<gp_temp_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x800,-0x8(%rbp)
jbe    1137 <gp_temp_free+0x27>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp_temp_free>:
cmp    $0x801,%rdi
jb     1121 <gp_temp_free+0x11>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @gp_temp_free(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 2048
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @gp_temp_free(i64 %0, i8* nocapture %1) {
%3 = icmp ugt i64 %0, 2048
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
void memfill4scr(unsigned long addr, unsigned long size, unsigned char value,
                 unsigned char cattr) {
  asm("1:stosb;xchg %%bl,%%al;stosb;xchg %%bl,%%al;loop 1b" ::"c"(size),
      "D"(addr), "a"(value), "b"(cattr));
}


x86 assembly (clang, -O0):
<memfill4scr>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %cl,-0x19(%rbp)
mov    %al,-0x1a(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdi
mov    -0x19(%rbp),%al
mov    -0x1a(%rbp),%bl
stos   %al,%es:(%rdi)
xchg   %al,%bl
stos   %al,%es:(%rdi)
xchg   %al,%bl
loop   1125 <memfill4scr+0x25>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<memfill4scr>:
push   %rbx
mov    %ecx,%ebx
mov    %edx,%eax
mov    %rsi,%rcx
stos   %al,%es:(%rdi)
xchg   %al,%bl
stos   %al,%es:(%rdi)
xchg   %al,%bl
loop   1108 <memfill4scr+0x8>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @memfill4scr(i64 %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
tail call void asm sideeffect "1:stosb;xchg %bl,%al;stosb;xchg %bl,%al;loop 1b", "{cx},{di},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %0, i8 %2, i8 %3)
ret void
}
char *strcat(char *s1, char *s2) {
  char *res = s1;
  while (*s1)
    s1++;
  while ((*s1++ = *s2++) != '\0')
    ;
  return res;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <strcat+0x6a>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sys_put_le16(int, int /*<<< orphan*/ *);
void sys_put_le32(uint32_t val, uint8_t dst[4]) {
  sys_put_le16(val, dst);
  sys_put_le16(val >> 16, &dst[2]);
}


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

x86 assembly (clang, -O2):
<sys_put_le32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <sys_put_le16@plt>
sar    $0x10,%ebp
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sys_put_le16@plt>

LLVM IR (-O0):
define void @sys_put_le32(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 @sys_put_le16(i32 %5, i32* %6)
%8 = load i32, i32* %3
%9 = ashr i32 %8, 16
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = call i32 @sys_put_le16(i32 %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @sys_put_le32(i32 %0, i32* %1) {
%3 = tail call i32 @sys_put_le16(i32 %0, i32* %1)
%4 = ashr i32 %0, 16
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = tail call i32 @sys_put_le16(i32 %4, i32* %5)
ret void
}
void xgateThread0(void) {}


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

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

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

LLVM IR (-O2):
define void @xgateThread0() {
ret void
}
int swap_4byte(word4)
int word4;
{
  union {
    unsigned char character[4];
    long integer;
  } swap4byte;
  char temp0;
  char temp1;
  swap4byte.integer = word4;
  temp0 = swap4byte.character[0];
  temp1 = swap4byte.character[1];
  swap4byte.character[0] = swap4byte.character[3];
  swap4byte.character[1] = swap4byte.character[2];
  swap4byte.character[2] = temp1;
  swap4byte.character[3] = temp0;
  return (swap4byte.integer);
}


x86 assembly (clang, -O0):
<swap_4byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_4byte>:
mov    %edi,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @swap_4byte(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ cpu_init();
int /*<<< orphan*/ dcf_init();
int /*<<< orphan*/ i2c_init();
int /*<<< orphan*/ io_init();
int /*<<< orphan*/ timer_init();
int /*<<< orphan*/ usart_init();
int /*<<< orphan*/ ws2812_init();
void hal_init(void) {
  cpu_init();
  io_init();
  usart_init();
  timer_init();
  dcf_init();
  ws2812_init();
  i2c_init();
}


x86 assembly (clang, -O0):
<hal_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <cpu_init@plt>
mov    $0x0,%al
call   1040 <io_init@plt>
mov    $0x0,%al
call   1060 <usart_init@plt>
mov    $0x0,%al
call   1070 <timer_init@plt>
mov    $0x0,%al
call   1090 <dcf_init@plt>
mov    $0x0,%al
call   1080 <ws2812_init@plt>
mov    $0x0,%al
call   1030 <i2c_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hal_init>:
push   %rax
xor    %eax,%eax
call   1050 <cpu_init@plt>
xor    %eax,%eax
call   1040 <io_init@plt>
xor    %eax,%eax
call   1060 <usart_init@plt>
xor    %eax,%eax
call   1070 <timer_init@plt>
xor    %eax,%eax
call   1090 <dcf_init@plt>
xor    %eax,%eax
call   1080 <ws2812_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <i2c_init@plt>

LLVM IR (-O0):
define void @hal_init() {
%1 = call i32 (...) @cpu_init()
%2 = call i32 (...) @io_init()
%3 = call i32 (...) @usart_init()
%4 = call i32 (...) @timer_init()
%5 = call i32 (...) @dcf_init()
%6 = call i32 (...) @ws2812_init()
%7 = call i32 (...) @i2c_init()
ret void
}

LLVM IR (-O2):
define void @hal_init() {
%1 = tail call i32 (...) @cpu_init()
%2 = tail call i32 (...) @io_init()
%3 = tail call i32 (...) @usart_init()
%4 = tail call i32 (...) @timer_init()
%5 = tail call i32 (...) @dcf_init()
%6 = tail call i32 (...) @ws2812_init()
%7 = tail call i32 (...) @i2c_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ basic_daytime(int *, int *, int *, int *);
int basic_seed() {
  int seconds, microseconds, w, d;
  basic_daytime(&seconds, &microseconds, &w, &d);
  return (seconds);
}


x86 assembly (clang, -O0):
<basic_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <basic_daytime@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basic_seed>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <basic_daytime@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @basic_seed() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @basic_daytime(i32* %1, i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @basic_seed() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @basic_daytime(i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
ret i32 %10
}
/* Variables and functions */
int getnum(char const *);
int /*<<< orphan*/ shiftright_(int);
void rolright(const char *s) {
  int ri = getnum(s);
  if (ri == 0 || ri == 128)
    return;
  shiftright_(ri);
}


x86 assembly (clang, -O0):
<rolright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getnum@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114f <rolright+0x2f>
cmpl   $0x80,-0xc(%rbp)
jne    1154 <rolright+0x34>
jmp    115c <rolright+0x3c>
mov    -0xc(%rbp),%edi
call   1040 <shiftright_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rolright>:
push   %rax
call   1030 <getnum@plt>
test   $0xffffff7f,%eax
je     1135 <rolright+0x15>
mov    %eax,%edi
pop    %rax
jmp    1040 <shiftright_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @rolright(i8* %0) {
%2 = tail call i32 @getnum(i8* %0)
%3 = and i32 %2, -129
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @shiftright_(i32 %2)
br label %7
7: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(int errno, const char *message) {
  fprintf(stderr, "Error: %s", message);
  exit(errno);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"Error: %s\00"
define void @error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %3
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"Error: %s\00"
define void @error(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
int gen_label() {
  static int cnt;
  return cnt++;
}


x86 assembly (clang, -O0):
<gen_label>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_label>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@gen_label.cnt = internal global i32 0
define i32 @gen_label() {
%1 = load i32, i32* @gen_label.cnt
%2 = add nsw i32 %1, 1
store i32 %2, i32* @gen_label.cnt
ret i32 %1
}

LLVM IR (-O2):
@gen_label.cnt = internal unnamed_addr global i32 0
define i32 @gen_label() {
%1 = load i32, i32* @gen_label.cnt
%2 = add nsw i32 %1, 1
store i32 %2, i32* @gen_label.cnt
ret i32 %1
}
char *ecvt(value, ndigit, decpt, sign)
double value;
int ndigit, *decpt, *sign;
{ return cvt(value, ndigit, decpt, sign, 1); }


x86 assembly (clang, -O0):
<ecvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecvt>:
push   %rax
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %9, i32 %10, i32* %11, i32* %12, i32 1)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %0, i32 %1, i32* %2, i32* %3, i32 1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
size_t base64_decode_size(size_t);
size_t decode_size_base64(size_t in_len) { return base64_decode_size(in_len); }


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

x86 assembly (clang, -O2):
<decode_size_base64>:
jmp    1030 <base64_decode_size@plt>

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

LLVM IR (-O2):
define i64 @decode_size_base64(i64 %0) {
%2 = tail call i64 @base64_decode_size(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int pin_offset(const char str[5]) {
  int i;
  sscanf(&(str[2]), "%d", &i);
  return i;
}


x86 assembly (clang, -O0):
<pin_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
lea    0xed5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pin_offset>:
push   %rax
add    $0x2,%rdi
lea    0xee4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @pin_offset(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
int Get_Bits_Value(unsigned long val, int highbit, int lowbit) {
  unsigned long data = val;
  int bits = highbit - lowbit + 1;
  if (bits < 64) {
    data >>= lowbit;
    data &= (1ULL << bits) - 1;
  }
  return (data);
}


x86 assembly (clang, -O0):
<Get_Bits_Value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x40,-0x1c(%rbp)
jge    1155 <Get_Bits_Value+0x55>
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
shr    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Bits_Value>:
mov    %rdi,%rax
sub    %edx,%esi
cmp    $0x3e,%esi
jg     1125 <Get_Bits_Value+0x25>
mov    %edx,%ecx
shr    %cl,%rax
add    $0x1,%sil
mov    $0xffffffffffffffff,%rdx
mov    %esi,%ecx
shl    %cl,%rdx
not    %rdx
and    %rdx,%rax
ret

LLVM IR (-O0):
define i32 @Get_Bits_Value(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i64, i64* %4
store i64 %9, i64* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 64
br i1 %15, label %16, label %27
16: ; preds = %3
%17 = load i32, i32* %6
%18 = load i64, i64* %7
%19 = zext i32 %17 to i64
%20 = lshr i64 %18, %19
store i64 %20, i64* %7
%21 = load i32, i32* %8
%22 = zext i32 %21 to i64
%23 = shl i64 1, %22
%24 = sub i64 %23, 1
%25 = load i64, i64* %7
%26 = and i64 %25, %24
store i64 %26, i64* %7
br label %27
27: ; preds = %16, %3
%28 = load i64, i64* %7
%29 = trunc i64 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @Get_Bits_Value(i64 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
%5 = icmp slt i32 %4, 63
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = add nsw i32 %4, 1
%8 = zext i32 %2 to i64
%9 = lshr i64 %0, %8
%10 = zext i32 %7 to i64
%11 = shl nsw i64 -1, %10
%12 = xor i64 %11, -1
%13 = and i64 %9, %12
br label %14
14: ; preds = %6, %3
%15 = phi i64 [ %13, %6 ], [ %0, %3 ]
%16 = trunc i64 %15 to i32
ret i32 %16
}
/* Variables and functions */
int *h();
int *f() { return h(); }


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

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

LLVM IR (-O0):
define i32* @f() {
%1 = call i32* (...) @h()
ret i32* %1
}

LLVM IR (-O2):
define i32* @f() {
%1 = tail call i32* (...) @h()
ret i32* %1
}
/* Variables and functions */
char *realloc(char *, scalar_t__);
char *strcat(char *, char const *);
scalar_t__ strlen(char const *);
char *strcat_dup(char *dest, const char *src) {
  dest = realloc(dest, (dest ? strlen(dest) : 0) + strlen(src) + 1);
  return strcat(dest, src);
}


x86 assembly (clang, -O0):
<strcat_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <strcat_dup+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
jmp    1170 <strcat_dup+0x40>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1170 <strcat_dup+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdi
add    %rax,%rsi
add    $0x1,%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
test   %rdi,%rdi
je     1151 <strcat_dup+0x21>
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
jmp    1156 <strcat_dup+0x26>
mov    $0x1,%ebx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %rax,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <realloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <strcat@plt>

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

LLVM IR (-O2):
define i8* @strcat_dup(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @strlen(i8* %0)
%6 = add i64 %5, 1
br label %7
7: ; preds = %2, %4
%8 = phi i64 [ %6, %4 ], [ 1, %2 ]
%9 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%10 = add i64 %8, %9
%11 = tail call i8* @realloc(i8* %0, i64 %10)
%12 = tail call i8* @strcat(i8* dereferenceable(1) %11, i8* dereferenceable(1) %1)
ret i8* %11
}
void genmtc0() {}


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

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

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

LLVM IR (-O2):
define void @genmtc0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __isoc99_scanf();
int add1(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  int local0;
  int o0;
  __isoc99_scanf();
  o0 = add1(local0);
  printf("Sum = %ld\n", o0);
  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    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <__isoc99_scanf@plt>
mov    -0x1c(%rbp),%edi
call   1040 <add1@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @__isoc99_scanf()
%5 = tail call i32 @add1(i32 undef)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
__attribute__((always_)) int irq_canonicalize(int irq) {
  return ((irq == 2) ? 9 : irq);
}


x86 assembly (clang, -O0):
<irq_canonicalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    111e <irq_canonicalize+0x1e>
mov    $0x9,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <irq_canonicalize+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_canonicalize>:
cmp    $0x2,%edi
mov    $0x9,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @irq_canonicalize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 9, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @irq_canonicalize(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 9, i32 %0
ret i32 %3
}
/* Variables and functions */
unsigned int ft_pop_sign(int, int *);
int /*<<< orphan*/ ft_putchar(unsigned int);
void ft_putnbr(int n) {
  int sign;
  unsigned int num;
  num = ft_pop_sign(n, &sign);
  if (sign)
    ft_putchar('-');
  if (num >= 10)
    ft_putnbr(num / 10);
  ft_putchar((num % 10) + '0');
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <ft_pop_sign@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115e <ft_putnbr+0x2e>
mov    $0x2d,%edi
call   1040 <ft_putchar@plt>
cmpl   $0xa,-0xc(%rbp)
jb     117b <ft_putnbr+0x4b>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1050 <ft_putnbr@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1040 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <ft_pop_sign@plt>
mov    %eax,%ebx
cmpl   $0x0,0x4(%rsp)
je     1151 <ft_putnbr+0x21>
mov    $0x2d,%edi
call   1040 <ft_putchar@plt>
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     116b <ft_putnbr+0x3b>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1050 <ft_putnbr@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
call   1040 <ft_putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @ft_pop_sign(i32 %5, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @ft_putchar(i32 45)
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %4
%13 = icmp uge i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = udiv i32 %15, 10
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %4
%19 = urem i32 %18, 10
%20 = add i32 %19, 48
%21 = call i32 @ft_putchar(i32 %20)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @ft_pop_sign(i32 %0, i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @ft_putchar(i32 45)
br label %9
9: ; preds = %7, %1
%10 = icmp ugt i32 %4, 9
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = udiv i32 %4, 10
br label %13
13: ; preds = %11, %9
%14 = urem i32 %4, 10
%15 = or i32 %14, 48
%16 = call i32 @ft_putchar(i32 %15)
ret void
}