xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print_timestamp_ext(char *, char *);
void print_timestamp_time(char *message) {
  print_timestamp_ext(message, "TIME");
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"TIME\00"
define void @print_timestamp_time(i8* %0) {
%2 = tail call i32 @print_timestamp_ext(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_handler(int signum) { printf("Signal received\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Signal received\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Signal received\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void reverse(int *p) {
  int i;
  for (i = 5; i > 0; i--) {
    printf("%3d", *(--p));
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1159 <reverse+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
mov    -0x4(%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <reverse+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    -0x4(%rdi),%esi
lea    0xedf(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    -0x8(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    -0xc(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    -0x10(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    -0x14(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%3d\00"
define void @reverse(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i32, i32* %0, i64 -2
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 -3
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds i32, i32* %0, i64 -4
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds i32, i32* %0, i64 -5
%15 = load i32, i32* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x5a() {
  Assert_real((isgraph(90)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              455, ("isgraph should be 1 for Z"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x5a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5a,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1c7,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x5a>:
push   %rax
mov    $0x5a,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1c7,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for Z\00"
define void @t_isgraph_0x5a() {
%1 = call i32 @isgraph(i32 90)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 455, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for Z\00"
define void @t_isgraph_0x5a() {
%1 = tail call i32 @isgraph(i32 90)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 455, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int swap(int *x, int *y) {
  int z;
  z = *x;
  *x = *y;
  *y = z;
  return 0;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @swap(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** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char const *strerror(int /*<<< orphan*/);
void bail(const char *on_what) {
  fputs(strerror(errno), stderr);
  fputs(": ", stderr);
  fputs(on_what, stderr);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
lea    0xe85(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<bail>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    0x2e84(%rip),%rbx
mov    (%rbx),%esi
mov    %rax,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xe91(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [3 x i8] c": \00"
define void @bail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @errno
%4 = call i8* @strerror(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* %4, i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fputc(i8 signext 10, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [3 x i8] c": \00"
define void @bail(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* %0, i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputc(i8 signext 10, i32 %10)
%12 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
signed int mem_get_sle32_aligned_as_int(const void *vmem) {
  const int32_t *mem = (const int32_t *)vmem;
  return *mem;
}


x86 assembly (clang, -O0):
<mem_get_sle32_aligned_as_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
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mem_get_sle32_aligned_as_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
ret i32 %7
}

LLVM IR (-O2):
define i32 @mem_get_sle32_aligned_as_int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
XStoreBuffer() {}


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

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

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

LLVM IR (-O2):
define i32 @XStoreBuffer() {
ret i32 undef
}
/* Variables and functions */
int mt19937_genrand_int32();
double mt19937_genrand_res53(void) {
  unsigned long a = mt19937_genrand_int32() >> 5,
                b = mt19937_genrand_int32() >> 6;
  return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<mt19937_genrand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <mt19937_genrand_int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <mt19937_genrand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt19937_genrand_res53>:
push   %rbx
xor    %eax,%eax
call   1030 <mt19937_genrand_int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <mt19937_genrand_int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @mt19937_genrand_res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @mt19937_genrand_int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @mt19937_genrand_int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = fmul double %13, 0x3CA0000000000000
ret double %14
}

LLVM IR (-O2):
define double @mt19937_genrand_res53() {
%1 = tail call i32 (...) @mt19937_genrand_int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @mt19937_genrand_int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = fmul double %9, 0x3CA0000000000000
ret double %10
}
float Sleef_sqrtf_u05(float x) { return __builtin_sqrtf(x); }


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

x86 assembly (clang, -O2):
<Sleef_sqrtf_u05>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <Sleef_sqrtf_u05+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @Sleef_sqrtf_u05(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
void I2CMasterControl(unsigned int baseAdd, unsigned int cmd) {
  (*((volatile unsigned int *)(baseAdd + (0xA4)))) = cmd | (0x00008000u);
}


x86 assembly (clang, -O0):
<I2CMasterControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
or     $0x8000,%ecx
mov    -0x4(%rbp),%eax
add    $0xa4,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterControl>:
or     $0x8000,%esi
add    $0xa4,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterControl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 %5, 32768
%7 = load i32, i32* %3
%8 = add i32 %7, 164
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
ret void
}

LLVM IR (-O2):
define void @I2CMasterControl(i32 %0, i32 %1) {
%3 = or i32 %1, 32768
%4 = add i32 %0, 164
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;
typedef int /*<<< orphan*/ ASN1_OBJECT;

/* Variables and functions */
int /*<<< orphan*/ *OBJ_nid2obj(int);
int X509_NAME_get_text_by_OBJ(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              char *, int);
int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len) {
  ASN1_OBJECT *obj;
  obj = OBJ_nid2obj(nid);
  if (obj == NULL)
    return (-1);
  return (X509_NAME_get_text_by_OBJ(name, obj, buf, len));
}


x86 assembly (clang, -O0):
<X509_NAME_get_text_by_NID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <OBJ_nid2obj@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1159 <X509_NAME_get_text_by_NID+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <X509_NAME_get_text_by_NID+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <X509_NAME_get_text_by_OBJ@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_NAME_get_text_by_NID>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
mov    %esi,%edi
call   1040 <OBJ_nid2obj@plt>
test   %rax,%rax
je     114e <X509_NAME_get_text_by_NID+0x2e>
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <X509_NAME_get_text_by_OBJ@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @X509_NAME_get_text_by_NID(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32* @OBJ_nid2obj(i32 %1)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @X509_NAME_get_text_by_OBJ(i32* %0, i32* %5, i8* %2, i32 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ -1, %4 ]
ret i32 %10
}
void gtk_text_iter_forward_visible_cursor_positions() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_forward_visible_cursor_positions() {
ret void
}
long __syscall_ret(unsigned long r) {
  if (r > -4096UL) {
    return -1;
  }
  return r;
}


x86 assembly (clang, -O0):
<__syscall_ret>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0xfffffffffffff000,-0x10(%rbp)
ff
jbe    1123 <__syscall_ret+0x23>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    112b <__syscall_ret+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_ret>:
cmp    $0xfffffffffffff001,%rdi
mov    $0xffffffffffffffff,%rax
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @__syscall_ret(i64 %0) {
%2 = icmp ugt i64 %0, -4096
%3 = select i1 %2, i64 -1, i64 %0
ret i64 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t B_SWAP64(uint64_t l) {
  return (l >> 56) | ((l >> 40) & 0xff00) | ((l >> 24) & 0xff0000) |
         ((l >> 8) & 0xff000000) | ((l & 255) << 56) | ((l & 0xff00) << 40) |
         ((l & 0xff0000) << 24) | ((l & 0xff000000) << 8);
}


x86 assembly (clang, -O0):
<B_SWAP64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @B_SWAP64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 56
%5 = load i32, i32* %2
%6 = ashr i32 %5, 40
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 24
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 8
%15 = and i32 %14, -16777216
%16 = or i32 %12, %15
%17 = load i32, i32* %2
%18 = and i32 %17, 255
%19 = shl i32 %18, 56
%20 = or i32 %16, %19
%21 = load i32, i32* %2
%22 = and i32 %21, 65280
%23 = shl i32 %22, 40
%24 = or i32 %20, %23
%25 = load i32, i32* %2
%26 = and i32 %25, 16711680
%27 = shl i32 %26, 24
%28 = or i32 %24, %27
%29 = load i32, i32* %2
%30 = and i32 %29, -16777216
%31 = shl i32 %30, 8
%32 = or i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @B_SWAP64(i32 %0) {
ret i32 poison
}
int add(int n, int i) { return (n + i); }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int print_a_message(const char *msg) {
  printf("A STRING: %s\n", msg);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_a_message>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"A STRING: %s\0A\00"
define i32 @print_a_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"A STRING: %s\0A\00"
define i32 @print_a_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t side_effect(uint32_t *a) {
  uint32_t v;
  v = *a;
  *a = 0;
  return v;
}


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

x86 assembly (clang, -O2):
<side_effect>:
mov    (%rdi),%rax
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i64 @side_effect(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
store i64 %5, i64* %3
%6 = load i64*, i64** %2
store i64 0, i64* %6
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @side_effect(i64* nocapture %0) {
%2 = load i64, i64* %0
store i64 0, i64* %0
ret i64 %2
}
float test_0(float x) { return -x; }


x86 assembly (clang, -O0):
<test_0>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_0>:
xorps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @test_0(float %0) {
%2 = fneg float %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ SPI_TxRx(unsigned char);
void LCD_out(unsigned char cmd) { SPI_TxRx(cmd); }


x86 assembly (clang, -O0):
<LCD_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <SPI_TxRx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_out>:
jmp    1030 <SPI_TxRx@plt>

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

LLVM IR (-O2):
define void @LCD_out(i8 zeroext %0) {
%2 = tail call i32 @SPI_TxRx(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void _explore_B_table_free_trans(void *data) {
  int *i = (int *)data;
  free(i);
}


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

x86 assembly (clang, -O2):
<_explore_B_table_free_trans>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @_explore_B_table_free_trans(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 = call i32 @free(i32* %6)
ret void
}

LLVM IR (-O2):
define void @_explore_B_table_free_trans(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, void const *, int /*<<< orphan*/);
void *g_memdup(const void *mem, uint32_t byte_size) {
  void *new_mem;
  if (mem) {
    new_mem = malloc(byte_size);
    memcpy(new_mem, mem, byte_size);
  } else
    new_mem = NULL;
  return new_mem;
}


x86 assembly (clang, -O0):
<g_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <g_memdup+0x3b>
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
jmp    1163 <g_memdup+0x43>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_memdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1149 <g_memdup+0x29>
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
jmp    114b <g_memdup+0x2b>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @g_memdup(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @malloc(i32 %1)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return (islower(c) ? (c - 32) : c); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int japi_window(int);
int j_window(int arg0) { return (japi_window(arg0)); }


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

x86 assembly (clang, -O2):
<j_window>:
jmp    1030 <japi_window@plt>

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

LLVM IR (-O2):
define i32 @j_window(i32 %0) {
%2 = tail call i32 @japi_window(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int putchar(int ic) {
  abort();
  return ic;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<putchar>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fact(int);
int main() {
  fact(10);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fact(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fact(i32 10)
ret i32 0
}
char rebase(unsigned n) {
  if (n >= 10)
    return 'A' + (n - 10);
  else
    return n;
}


x86 assembly (clang, -O0):
<rebase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jb     1122 <rebase+0x22>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1128 <rebase+0x28>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rebase>:
lea    0x37(%rdi),%eax
cmp    $0xa,%edi
movzbl %al,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @rebase(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp uge i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub i32 %7, 10
%9 = add i32 65, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %11, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @rebase(i32 %0) {
%2 = icmp ugt i32 %0, 9
%3 = add i32 %0, 55
%4 = select i1 %2, i32 %3, i32 %0
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rand();
uint64_t rand64() {
  uint64_t x;
  x = (x << 16) | (rand() & 0xffff);
  x = (x << 16) | (rand() & 0xffff);
  x = (x << 16) | (rand() & 0xffff);
  x = (x << 16) | (rand() & 0xffff);
  return x;
}


x86 assembly (clang, -O0):
<rand64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0xffff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
and    $0xffff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    $0xffff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0xffff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand64>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movzwl %ax,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand64() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = shl i32 %2, 16
%4 = call i32 (...) @rand()
%5 = and i32 %4, 65535
%6 = or i32 %3, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = shl i32 %7, 16
%9 = call i32 (...) @rand()
%10 = and i32 %9, 65535
%11 = or i32 %8, %10
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = shl i32 %12, 16
%14 = call i32 (...) @rand()
%15 = and i32 %14, 65535
%16 = or i32 %13, %15
store i32 %16, i32* %1
%17 = load i32, i32* %1
%18 = shl i32 %17, 16
%19 = call i32 (...) @rand()
%20 = and i32 %19, 65535
%21 = or i32 %18, %20
store i32 %21, i32* %1
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @rand64() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = shl i32 %3, 16
%5 = tail call i32 (...) @rand()
%6 = and i32 %5, 65535
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ oom_error(char *, size_t);
__attribute__((unused)) void *xmalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == NULL)
    oom_error("malloc", n);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <oom_error@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   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <oom_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
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 %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @oom_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias 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 @oom_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void mm_free_cgroup(struct mm_struct *mm) {}


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

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

LLVM IR (-O0):
%struct.mm_struct = type opaque
define void @mm_free_cgroup(%struct.mm_struct* %0) {
%2 = alloca %struct.mm_struct*
store %struct.mm_struct* %0, %struct.mm_struct** %2
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @mm_free_cgroup(%struct.mm_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void INTFC_combatFinal(int i) {
  printf("Combat Final : Joueur %d VS Boss\n", i + 1);
}


x86 assembly (clang, -O0):
<INTFC_combatFinal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INTFC_combatFinal>:
lea    0x1(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Combat Final : Joueur %d VS Boss\0A\00"
define void @INTFC_combatFinal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Combat Final : Joueur %d VS Boss\0A\00"
define void @INTFC_combatFinal(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int daj_rekurziju_brate(int x) {
  if (x == 1)
    return x - 1;
  else
    daj_rekurziju_brate(--x);
}


x86 assembly (clang, -O0):
<daj_rekurziju_brate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1133 <daj_rekurziju_brate+0x23>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <daj_rekurziju_brate+0x31>
mov    -0x8(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x8(%rbp)
call   1030 <daj_rekurziju_brate@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @daj_rekurziju_brate(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_cond(double, double);
int /*<<< orphan*/ init_task(int);
int /*<<< orphan*/ roe();
int system(char *);
int main() {
  int ret_codes = 0;
  init_task(3);
  init_cond(0.3, 0.5);
  roe();
  ret_codes = system("../bin/plot_Roe");
  ret_codes = system("../bin/plot_Roe_last");
  return ret_codes;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x3,%edi
call   1060 <init_task@plt>
movsd  0xe98(%rip),%xmm0
movsd  0xe98(%rip),%xmm1
call   1050 <init_cond@plt>
mov    $0x0,%al
call   1040 <roe@plt>
lea    0xe8d(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
lea    0xe8e(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1060 <init_task@plt>
movsd  0xead(%rip),%xmm0
movsd  0xead(%rip),%xmm1
call   1050 <init_cond@plt>
xor    %eax,%eax
call   1040 <roe@plt>
lea    0xea2(%rip),%rdi
call   1030 <system@plt>
lea    0xea6(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"../bin/plot_Roe\00"
@.str.1 = [21 x i8] c"../bin/plot_Roe_last\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @init_task(i32 3)
%4 = call i32 @init_cond(double 3.000000e-01, double 5.000000e-01)
%5 = call i32 (...) @roe()
%6 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %2
%7 = call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"../bin/plot_Roe\00"
@.str.1 = [21 x i8] c"../bin/plot_Roe_last\00"
define i32 @main() {
%1 = tail call i32 @init_task(i32 3)
%2 = tail call i32 @init_cond(double 3.000000e-01, double 5.000000e-01)
%3 = tail call i32 (...) @roe()
%4 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 %5
}
/* Variables and functions */
char *conf_get_str(char *, char *);
double strtod(char *, char **);
double conf_get_fnum(char *section, char *tag, double def) {
  char *value = conf_get_str(section, tag);
  if (value)
    return (strtod(value, (char **)NULL));
  return (def);
}


x86 assembly (clang, -O0):
<conf_get_fnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <conf_get_str@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1168 <conf_get_fnum+0x48>
mov    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <conf_get_fnum+0x52>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_get_fnum>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <conf_get_str@plt>
test   %rax,%rax
je     113b <conf_get_fnum+0x1b>
mov    %rax,%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <strtod@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @conf_get_fnum(i8* %0, i8* %1, double %2) {
%4 = alloca double
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca double
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store double %2, double* %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* @conf_get_str(i8* %9, i8* %10)
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i8*, i8** %8
%16 = call double @strtod(i8* %15, i8** null)
store double %16, double* %4
br label %19
17: ; preds = %3
%18 = load double, double* %7
store double %18, double* %4
br label %19
19: ; preds = %17, %14
%20 = load double, double* %4
ret double %20
}

LLVM IR (-O2):
define double @conf_get_fnum(i8* %0, i8* %1, double %2) {
%4 = tail call i8* @conf_get_str(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call double @strtod(i8* nocapture %4, i8** null)
br label %8
8: ; preds = %3, %6
%9 = phi double [ %7, %6 ], [ %2, %3 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ err(char *);
int /*<<< orphan*/ exit(int);
void fail(char *s) {
  err(s);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1030 <err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @err(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fail(i8* %0) {
%2 = tail call i32 @err(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double pow(double, double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("7 ^ 3 = %f\n", pow(7.0, 3.0));
  printf("4.73 ^ 12 = %f\n", pow(4.73, 12.0));
  printf("32.01 ^ 1.54 = %f\n", pow(32.01, 1.54));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  0xee9(%rip),%xmm1
call   1040 <pow@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1040 <pow@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe87(%rip),%xmm0
movsd  0xe87(%rip),%xmm1
call   1040 <pow@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"7 ^ 3 = %f\0A\00"
@.str.1 = [16 x i8] c"4.73 ^ 12 = %f\0A\00"
@.str.2 = [19 x i8] c"32.01 ^ 1.54 = %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @pow(double 7.000000e+00, double 3.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @pow(double 4.730000e+00, double 1.200000e+01)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @pow(double 3.201000e+01, double 1.540000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"7 ^ 3 = %f\0A\00"
@.str.1 = [16 x i8] c"4.73 ^ 12 = %f\0A\00"
@.str.2 = [19 x i8] c"32.01 ^ 1.54 = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 3.430000e+02)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double 0x419DE6721CDEA43E)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double 0x406A012C937445BD)
ret i32 0
}
int any_LSB_one(unsigned x) { return !!(x & 0xFF); }


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

x86 assembly (clang, -O2):
<any_LSB_one>:
xor    %eax,%eax
test   %dil,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @any_LSB_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @any_LSB_one(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}