xunge/DecIR huggingface dataset:
/* Variables and functions */
long pow(int, long);
long int solve(long int n) {
  long c = 0;
  while (n) {
    c += n % 2 ? 0 : 1;
    n /= 2;
  }
  c = pow(2, c);
  return c;
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <solve+0x5c>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1124 <solve+0x14>
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
xor    %esi,%esi
test   %rdi,%rdi
je     1141 <solve+0x31>
mov    %rdi,%rax
nopw   0x0(%rax,%rax,1)
mov    %edi,%ecx
not    %ecx
and    $0x1,%ecx
add    %rcx,%rsi
shr    $0x3f,%rax
add    %rdi,%rax
sar    %rax
add    $0x1,%rdi
cmp    $0x2,%rdi
mov    %rax,%rdi
ja     1120 <solve+0x10>
mov    $0x2,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i64 @solve(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i64, i64* %2
%9 = srem i64 %8, 2
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
%13 = sext i32 %12 to i64
%14 = load i64, i64* %3
%15 = add nsw i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %2
%17 = sdiv i64 %16, 2
store i64 %17, i64* %2
br label %4
18: ; preds = %4
%19 = load i64, i64* %3
%20 = call i64 @pow(i32 2, i64 %19)
store i64 %20, i64* %3
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @solve(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = xor i64 %6, 1
%8 = add nuw nsw i64 %7, %4
%9 = sdiv i64 %5, 2
%10 = add i64 %5, 1
%11 = icmp ult i64 %10, 3
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %8, %3 ]
%14 = tail call i64 @pow(i32 2, i64 %13)
ret i64 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, char const *, char *, size_t);
ssize_t readlinkat(int fd, const char *path, char *buf, size_t bufsize) {
  return syscall(267, fd, path, buf, bufsize);
}


x86 assembly (clang, -O0):
<readlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x10b,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlinkat>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x10b,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @readlinkat(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @syscall(i32 267, i32 %9, i8* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @readlinkat(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @syscall(i32 267, i32 %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
size_t zmalloc_get_private_dirty(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @zmalloc_get_private_dirty() {
ret i64 0
}

LLVM IR (-O2):
define i64 @zmalloc_get_private_dirty() {
ret i64 0
}
void test_clear_cache_voids(void *start, void *end) {
  __clear_cache(start, end);
}


x86 assembly (clang, -O0):
<test_clear_cache_voids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <__clear_cache>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nop

x86 assembly (clang, -O2):
<test_clear_cache_voids>:
xor    %eax,%eax
jmp    1110 <__clear_cache>
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @test_clear_cache_voids(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** %4
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__clear_cache to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @test_clear_cache_voids(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__clear_cache to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
ret void
}
double cos_integ3(const double x, const double sinx, const double cosx) {
  return (3.0 * x * x - 6.0) * cosx + (x * x * x - 6.0 * x) * sinx;
}


x86 assembly (clang, -O0):
<cos_integ3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xef5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm4
movsd  0xeaf(%rip),%xmm3
mulsd  -0x8(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_integ3>:
movsd  0xef8(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
movsd  0xef0(%rip),%xmm4
addsd  %xmm4,%xmm3
movapd %xmm0,%xmm5
mulsd  %xmm0,%xmm5
mulsd  %xmm0,%xmm4
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @cos_integ3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fmul double 3.000000e+00, %7
%9 = load double, double* %4
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double -6.000000e+00)
%11 = load double, double* %6
%12 = load double, double* %4
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = load double, double* %4
%16 = load double, double* %4
%17 = fmul double 6.000000e+00, %16
%18 = fneg double %17
%19 = call double @llvm.fmuladd.f64(double %14, double %15, double %18)
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %10, double %11, double %21)
ret double %22
}

LLVM IR (-O2):
define double @cos_integ3(double %0, double %1, double %2) {
%4 = fmul double %0, 3.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double -6.000000e+00)
%6 = fmul double %0, %0
%7 = fmul double %0, -6.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %7)
%9 = fmul double %8, %1
%10 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %9)
ret double %10
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ swap(int *, int *);
getPivo(int *vet, int ini, int fim) {
  int indPivo = ini + (rand() % (fim - ini));
  swap(&vet[ini], &vet[indPivo]);
  return vet[ini];
}


x86 assembly (clang, -O0):
<getPivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <swap@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPivo>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %ebp,%edx
movslq %ebp,%rbx
lea    (%r14,%rbx,4),%rdi
movslq %edx,%rax
lea    (%r14,%rax,4),%rsi
call   1030 <swap@plt>
mov    (%r14,%rbx,4),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getPivo(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = call i32 (...) @rand()
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = srem i32 %9, %12
%14 = add nsw i32 %8, %13
store i32 %14, i32* %7
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = call i32 @swap(i32* %18, i32* %22)
%24 = load i32*, i32** %4
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @getPivo(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @rand()
%5 = sub nsw i32 %2, %1
%6 = srem i32 %4, %5
%7 = add nsw i32 %6, %1
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = sext i32 %7 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = tail call i32 @swap(i32* %9, i32* %11)
%13 = load i32, i32* %9
ret i32 %13
}
void gtk_target_list_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_target_list_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int);
int /*<<< orphan*/ stderr;
void skip_chunk_error(const char *which, unsigned int target_id) {
  fprintf(stderr, "%s while searching for chunk ID 0x%08X\n", which, target_id);
}


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

x86 assembly (clang, -O2):
<skip_chunk_error>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"%s while searching for chunk ID 0x%08X\0A\00"
define void @skip_chunk_error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x52() {
  Assert_real((iscntrl(82) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              415, ("iscntrl should be 0 for R"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for R\00"
define void @t_iscntrl_0x52() {
%1 = call i64 @iscntrl(i32 82)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for R\00"
define void @t_iscntrl_0x52() {
%1 = tail call i64 @iscntrl(i32 82)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_B2uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B2uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 178
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glutSolidTorus(double, double, int, int);
void drawSTorus(void) {
  glColor3f(1.0, 0.5, 0.0);
  glutSolidTorus(1.0, 5.0, 10, 20);
}


x86 assembly (clang, -O0):
<drawSTorus>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
movsd  0xedc(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1030 <glColor3f@plt>
movsd  0xebc(%rip),%xmm0
movsd  0xebc(%rip),%xmm1
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <glutSolidTorus@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSTorus>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1030 <glColor3f@plt>
movsd  0xecf(%rip),%xmm1
movsd  0xeb7(%rip),%xmm0
mov    $0xa,%edi
mov    $0x14,%esi
pop    %rax
jmp    1040 <glutSolidTorus@plt>

LLVM IR (-O0):
define void @drawSTorus() {
%1 = call i32 @glColor3f(double 1.000000e+00, double 5.000000e-01, double 0.000000e+00)
%2 = call i32 @glutSolidTorus(double 1.000000e+00, double 5.000000e+00, i32 10, i32 20)
ret void
}

LLVM IR (-O2):
define void @drawSTorus() {
%1 = tail call i32 @glColor3f(double 1.000000e+00, double 5.000000e-01, double 0.000000e+00)
%2 = tail call i32 @glutSolidTorus(double 1.000000e+00, double 5.000000e+00, i32 10, i32 20)
ret void
}
/* Variables and functions */
int fgetc(unsigned int);
int fget_int(unsigned handle) { return fgetc(handle); }


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

x86 assembly (clang, -O2):
<fget_int>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @fget_int(i32 %0) {
%2 = tail call i32 @fgetc(i32 %0)
ret i32 %2
}
/* Type definitions */
struct changelog_rec {
  int dummy;
};

/* Variables and functions */
char *changelog_rec_name(struct changelog_rec *);
int strlen(char *);
char *changelog_rec_sname(struct changelog_rec *rec) {
  char *cr_name = changelog_rec_name(rec);
  return cr_name + strlen(cr_name) + 1;
}


x86 assembly (clang, -O0):
<changelog_rec_sname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <changelog_rec_name@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changelog_rec_sname>:
push   %rbx
call   1030 <changelog_rec_name@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.changelog_rec = type { i32 }
define i8* @changelog_rec_sname(%struct.changelog_rec* %0) {
%2 = alloca %struct.changelog_rec*
%3 = alloca i8*
store %struct.changelog_rec* %0, %struct.changelog_rec** %2
%4 = load %struct.changelog_rec*, %struct.changelog_rec** %2
%5 = call i8* @changelog_rec_name(%struct.changelog_rec* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
ret i8* %11
}

LLVM IR (-O2):
%struct.changelog_rec = type { i32 }
define i8* @changelog_rec_sname(%struct.changelog_rec* %0) {
%2 = tail call i8* @changelog_rec_name(%struct.changelog_rec* %0)
%3 = tail call i32 @strlen(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x79() {
  Assert_real((isxdigit(121) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              610, ("isxdigit should be 0 for y"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x79>:
push   %rax
mov    $0x79,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x262,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for y\00"
define void @t_isxdigit_0x79() {
%1 = call i64 @isxdigit(i32 121)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for y\00"
define void @t_isxdigit_0x79() {
%1 = tail call i64 @isxdigit(i32 121)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void __assert_func(const char *file, int line, const char *func,
                   const char *expr) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
jmp    1113 <__assert_func+0x13>

x86 assembly (clang, -O2):
<__assert_func>:
jmp    1100 <__assert_func>

LLVM IR (-O0):
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
br label %9
9: ; preds = %4, %9
br label %9
}

LLVM IR (-O2):
define void @__assert_func(i8* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
br label %5
5: ; preds = %4, %5
br label %5
}
int qe_isblank(int c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<qe_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <qe_isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qe_isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @qe_isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ log_debug(char *, char *);
int /*<<< orphan*/ log_warn(char *, char *, char const *);
int unlink(char const *);
void ctl_cleanup(const char *name) {
  log_debug("control", "cleanup control socket");
  if (unlink(name) == -1)
    log_warn("control", "unable to unlink %s", name);
}


x86 assembly (clang, -O0):
<ctl_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1040 <log_debug@plt>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    1178 <ctl_cleanup+0x48>
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1050 <log_warn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctl_cleanup>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <log_debug@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     1156 <ctl_cleanup+0x26>
pop    %rbx
ret
lea    0xea3(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1050 <log_warn@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"control\00"
@.str.1 = [23 x i8] c"cleanup control socket\00"
@.str.2 = [20 x i8] c"unable to unlink %s\00"
define void @ctl_cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @log_debug(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @unlink(i8* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @log_warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"control\00"
@.str.1 = [23 x i8] c"cleanup control socket\00"
@.str.2 = [20 x i8] c"unable to unlink %s\00"
define void @ctl_cleanup(i8* %0) {
%2 = tail call i32 @log_debug(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @unlink(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @log_warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
ret void
}
void sysMotorset(int motor, int sens) {}


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

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

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

LLVM IR (-O2):
define void @sysMotorset(i32 %0, i32 %1) {
ret void
}
float divisao(int one_parameter, int second_paramater) {
  if (second_paramater == 0) {
    second_paramater = 1;
  }
  float resultado = 0;
  resultado = one_parameter / second_paramater;
  return resultado;
}


x86 assembly (clang, -O0):
<divisao>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111b <divisao+0x1b>
movl   $0x1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisao>:
mov    %edi,%eax
test   %esi,%esi
mov    $0x1,%ecx
cmovne %esi,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @divisao(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %4
br label %9
9: ; preds = %8, %2
store float 0.000000e+00, float* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to float
store float %13, float* %5
%14 = load float, float* %5
ret float %14
}

LLVM IR (-O2):
define float @divisao(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = sdiv i32 %0, %4
%6 = sitofp i32 %5 to float
ret float %6
}
long long suzu() { return 0xffff7fff00007fffLL; }


x86 assembly (clang, -O0):
<suzu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fff00007fff,%rax
7f ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<suzu>:
movabs $0xffff7fff00007fff,%rax
7f ff ff
ret

LLVM IR (-O0):
define i64 @suzu() {
ret i64 -140741783289857
}

LLVM IR (-O2):
define i64 @suzu() {
ret i64 -140741783289857
}
void gtk_paint_box_gap() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paint_box_gap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_TransferFlags(int fh) { return ioctl(fh, _IO(0xce, 34)); }


x86 assembly (clang, -O0):
<CED_TransferFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x22,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_TransferFlags>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x22,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_TransferFlags(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 34)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_TransferFlags(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 34)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int ulog2(unsigned int);
unsigned get_depth(unsigned inputs) {
  if (inputs == 0)
    return 0;
  else if (inputs == 1)
    return 0;
  else
    return 2 * ulog2(inputs - 1) - 1;
}


x86 assembly (clang, -O0):
<get_depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <get_depth+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115b <get_depth+0x4b>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <get_depth+0x37>
movl   $0x0,-0x4(%rbp)
jmp    115b <get_depth+0x4b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ulog2@plt>
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_depth>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     1129 <get_depth+0x19>
push   %rax
add    $0xffffffff,%edi
call   1030 <ulog2@plt>
add    %eax,%eax
add    $0xffffffff,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @get_depth(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = tail call i32 @ulog2(i32 %4)
%6 = shl nsw i32 %5, 1
%7 = add nsw i32 %6, -1
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 0, %1 ]
ret i32 %9
}
void test3_lin() {
  union {
    int u0;
    struct {
      int f0;
      int f1;
    } u1;
  } c_lin;
  c_lin.u0 = 1;
  const int x0_lin = c_lin.u0;
  c_lin.u1.f0 = x0_lin;
  c_lin.u1.f1 = x0_lin;
  const int y0_lin = c_lin.u1.f0;
  const int z0_lin = c_lin.u1.f1;
}


x86 assembly (clang, -O0):
<test3_lin>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { i32, i32 }
define void @test3_lin() {
%1 = alloca %union.anon
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %5
%6 = bitcast %union.anon* %1 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = bitcast %union.anon* %1 to %struct.anon*
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 0
store i32 %8, i32* %10
%11 = load i32, i32* %2
%12 = bitcast %union.anon* %1 to %struct.anon*
%13 = getelementptr inbounds %struct.anon, %struct.anon* %12, i32 0, i32 1
store i32 %11, i32* %13
%14 = bitcast %union.anon* %1 to %struct.anon*
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 0
%16 = load i32, i32* %15
store i32 %16, i32* %3
%17 = bitcast %union.anon* %1 to %struct.anon*
%18 = getelementptr inbounds %struct.anon, %struct.anon* %17, i32 0, i32 1
%19 = load i32, i32* %18
store i32 %19, i32* %4
ret void
}

LLVM IR (-O2):
define void @test3_lin() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char *);
void check_options_failed(char *name, char *errmsg) {
  usage(name);
  fprintf(stderr, "%s\n\n", errmsg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<check_options_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <usage@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<check_options_failed>:
push   %rbx
mov    %rsi,%rbx
call   1040 <usage@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%s\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_options_failed(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 = call i32 @usage(i8* %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%s\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_options_failed(i8* %0, i8* %1) {
%3 = tail call i32 @usage(i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
char *xstrdup(char const *);
char *oauth_sign_plaintext(const char *m, const char *k) {
  return (xstrdup(k));
}


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

x86 assembly (clang, -O2):
<oauth_sign_plaintext>:
mov    %rsi,%rdi
jmp    1030 <xstrdup@plt>

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

LLVM IR (-O2):
define i8* @oauth_sign_plaintext(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i8* @xstrdup(i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int PesLength(const uint8_t *p) { return 6 + p[4] * 256 + p[5]; }


x86 assembly (clang, -O0):
<PesLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x8,%eax
add    $0x6,%eax
mov    -0x8(%rbp),%rcx
add    0x14(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PesLength>:
mov    0x10(%rdi),%eax
mov    0x14(%rdi),%ecx
shl    $0x8,%eax
add    %ecx,%eax
add    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @PesLength(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 256
%7 = add nsw i32 6, %6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 5
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @PesLength(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = shl nsw i32 %3, 8
%5 = or i32 %4, 6
%6 = getelementptr inbounds i32, i32* %0, i64 5
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ i2c_write(unsigned char *, int);
void request(void) {
  unsigned char zero;
  zero = 0;
  i2c_write(&zero, 1);
}


x86 assembly (clang, -O0):
<request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <i2c_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <i2c_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @request() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @i2c_write(i8* %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @request() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @i2c_write(i8* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ business();
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ drawui();
int /*<<< orphan*/ init();
int main() {
  init();
  drawui();
  business();
  destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1030 <drawui@plt>
mov    $0x0,%al
call   1060 <business@plt>
mov    $0x0,%al
call   1040 <destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1030 <drawui@plt>
xor    %eax,%eax
call   1060 <business@plt>
xor    %eax,%eax
call   1040 <destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 (...) @drawui()
%4 = call i32 (...) @business()
%5 = call i32 (...) @destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @drawui()
%3 = tail call i32 (...) @business()
%4 = tail call i32 (...) @destroy()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_set_padding(uint8_t *p_rtp) { p_rtp[0] |= 0x20; }


x86 assembly (clang, -O0):
<rtp_set_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_set_padding>:
orb    $0x20,(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_padding(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = or i32 %5, 32
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @rtp_set_padding(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = or i32 %2, 32
store i32 %3, i32* %0
ret void
}
/* Type definitions */
struct statvfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __statvfs(const char *file, struct statvfs *buf) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__statvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__statvfs>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
@ENOSYS = global i32 0
define i32 @__statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca i8*
%4 = alloca %struct.statvfs*
store i8* %0, i8** %3
store %struct.statvfs* %1, %struct.statvfs** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
@ENOSYS = global i32 0
define i32 @__statvfs(i8* nocapture readnone %0, %struct.statvfs* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
double istat_min(double min, double x) { return x < min ? x : min; }


x86 assembly (clang, -O0):
<istat_min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <istat_min+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <istat_min+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<istat_min>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @istat_min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @istat_min(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
void fa125(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        a:
          goto a;
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa125>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa125+0x4>

x86 assembly (clang, -O2):
<fa125>:
jmp    1100 <fa125>

LLVM IR (-O0):
define void @fa125() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
27: ; preds = %27
br label %27
}

LLVM IR (-O2):
define void @fa125() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ rp_decode_uint32(char const **, unsigned int *, char);
int rp_decode_reg(const char *in, unsigned int *reg_no) {
  if (!rp_decode_uint32(&in, reg_no, '\0'))
    return 0;
  return (!0);
}


x86 assembly (clang, -O0):
<rp_decode_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdi
xor    %edx,%edx
call   1030 <rp_decode_uint32@plt>
cmp    $0x0,%eax
jne    1144 <rp_decode_reg+0x34>
movl   $0x0,-0x4(%rbp)
jmp    114b <rp_decode_reg+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_decode_reg>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %edx,%edx
call   1030 <rp_decode_uint32@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rp_decode_reg(i8* %0, i32* %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @rp_decode_uint32(i8** %3, i32* %1, i8 signext 0)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void _Unwind_GetGR() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetGR() {
ret void
}
unsigned int timeR_add_userfn_bin(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @timeR_add_userfn_bin() {
ret i32 0
}

LLVM IR (-O2):
define i32 @timeR_add_userfn_bin() {
ret i32 0
}
int isblanks(int c) {
  if (c == '\t' || c == '\n' || c == '\r' || c == ' ')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isblanks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
je     112f <isblanks+0x2f>
cmpl   $0xa,-0x8(%rbp)
je     112f <isblanks+0x2f>
cmpl   $0xd,-0x8(%rbp)
je     112f <isblanks+0x2f>
cmpl   $0x20,-0x8(%rbp)
jne    113b <isblanks+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isblanks+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblanks>:
cmp    $0x20,%edi
ja     111d <isblanks+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <isblanks+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isblanks(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void foo() {
  unsigned i1 = 1U << -1;
  unsigned i2 = 1U >> -1;
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}