xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int ft_strlen(char *);
int ctrl_k(int i, char **result) {
  while (i + 1 < ft_strlen(*result)) {
    ft_putstr(" ");
    ++i;
  }
  i = ft_strlen(*result);
  return (i);
}


x86 assembly (clang, -O0):
<ctrl_k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    116b <ctrl_k+0x4b>
lea    0xea8(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ctrl_k+0xf>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctrl_k>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
mov    (%rsi),%rdi
call   1030 <ft_strlen@plt>
cmp    %eax,%ebp
jge    1157 <ctrl_k+0x37>
lea    0xec1(%rip),%r14
nop
mov    %r14,%rdi
call   1040 <ft_putstr@plt>
add    $0x1,%ebp
mov    (%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    %eax,%ebp
jl     1140 <ctrl_k+0x20>
mov    (%rbx),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ft_strlen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @ctrl_k(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, 1
%4 = load i8*, i8** %1
%5 = tail call i32 @ft_strlen(i8* %4)
%6 = icmp slt i32 %3, %5
br i1 %6, label %7, label %14
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %3, %2 ]
%9 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = add nsw i32 %8, 1
%11 = load i8*, i8** %1
%12 = tail call i32 @ft_strlen(i8* %11)
%13 = icmp slt i32 %10, %12
br i1 %13, label %7, label %14
14: ; preds = %7, %2
%15 = load i8*, i8** %1
%16 = tail call i32 @ft_strlen(i8* %15)
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("I'm a main project bar.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"I'm a main project bar.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"I'm a main project bar.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct useradd_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ useradd_cmdline_parser_release(struct useradd_args_info *);
void useradd_cmdline_parser_free(struct useradd_args_info *args_info) {
  useradd_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<useradd_cmdline_parser_free>:
jmp    1030 <useradd_cmdline_parser_release@plt>

LLVM IR (-O0):
%struct.useradd_args_info = type { i32 }
define void @useradd_cmdline_parser_free(%struct.useradd_args_info* %0) {
%2 = alloca %struct.useradd_args_info*
store %struct.useradd_args_info* %0, %struct.useradd_args_info** %2
%3 = load %struct.useradd_args_info*, %struct.useradd_args_info** %2
%4 = call i32 @useradd_cmdline_parser_release(%struct.useradd_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.useradd_args_info = type { i32 }
define void @useradd_cmdline_parser_free(%struct.useradd_args_info* %0) {
%2 = tail call i32 @useradd_cmdline_parser_release(%struct.useradd_args_info* %0)
ret void
}
/* Variables and functions */
unsigned char _subborrow_u32(unsigned char, unsigned int, unsigned int,
                             unsigned int *);
unsigned char test_subborrow_u32(unsigned char __cf, unsigned int __x,
                                 unsigned int __y, unsigned int *__p) {
  return _subborrow_u32(__cf, __x, __y, __p);
}


x86 assembly (clang, -O0):
<test_subborrow_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
movzbl %al,%edi
call   1030 <_subborrow_u32@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_subborrow_u32>:
jmp    1030 <_subborrow_u32@plt>

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

LLVM IR (-O2):
define zeroext i8 @test_subborrow_u32(i8 zeroext %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call zeroext i8 @_subborrow_u32(i8 zeroext %0, i32 %1, i32 %2, i32* %3)
ret i8 %5
}
int swapone(int *B, int left, int right) {
  int temp;
  temp = B[left];
  B[left] = B[right];
  B[right] = temp;
  return 0;
}


x86 assembly (clang, -O0):
<swapone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapone>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @swapone(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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret i32 0
}

LLVM IR (-O2):
define i32 @swapone(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double tp_gettime() {
  struct timeval tr;
  gettimeofday(&tr, NULL);
  return (double)tr.tv_sec + (double)tr.tv_usec / 1000000;
}


x86 assembly (clang, -O0):
<tp_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @tp_gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @tp_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void WatchdogReloadSet(uint32_t ui32Base, uint32_t ui32LoadVal) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32LoadVal;
}


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

x86 assembly (clang, -O2):
<WatchdogReloadSet>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogReloadSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @WatchdogReloadSet(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
int wtree_compare(const void *a, const void *b) {
  return (*(char *)a - *(char *)b);
}


x86 assembly (clang, -O0):
<wtree_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtree_compare>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @wtree_compare(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* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @wtree_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
short *_zero_arr_plus_short_fn(short *, int, int, char const *, unsigned int);
short *_zero_arr_inplace_plus_short_fn(short **x, int orig_i,
                                       const char *filename, unsigned lineno) {
  *x = _zero_arr_plus_short_fn(*x, 1, orig_i, filename, lineno);
  return *x;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_short_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <_zero_arr_plus_short_fn@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_short_fn>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%esi
call   1030 <_zero_arr_plus_short_fn@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i16* @_zero_arr_inplace_plus_short_fn(i16** %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i16**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i16** %0, i16*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i16**, i16*** %5
%10 = load i16*, i16** %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i16* @_zero_arr_plus_short_fn(i16* %10, i32 1, i32 %11, i8* %12, i32 %13)
%15 = load i16**, i16*** %5
store i16* %14, i16** %15
%16 = load i16**, i16*** %5
%17 = load i16*, i16** %16
ret i16* %17
}

LLVM IR (-O2):
define i16* @_zero_arr_inplace_plus_short_fn(i16** nocapture %0, i32 %1, i8* %2, i32 %3) {
%5 = load i16*, i16** %0
%6 = tail call i16* @_zero_arr_plus_short_fn(i16* %5, i32 1, i32 %1, i8* %2, i32 %3)
store i16* %6, i16** %0
ret i16* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void indent(FILE *out, int indent) {
  while (indent--)
    fputc(' ', out);
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1146 <indent+0x36>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
jmp    111f <indent+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1132 <indent+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <indent+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @indent(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @fputc(i8 signext 32, i32* %0)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
const char *HPDF_GetVersion(void) { return "2.2.1"; }


x86 assembly (clang, -O0):
<HPDF_GetVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HPDF_GetVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"2.2.1\00"
define i8* @HPDF_GetVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"2.2.1\00"
define i8* @HPDF_GetVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
long double sin(long double x) { return x - ((x * x) / (1 * 2 * 3)); }


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fmul   %st(1),%st
flds   0xee9(%rip)
fdivrp %st,%st(1)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
fldt   0x8(%rsp)
fld    %st(0)
fmul   %st(1),%st
fdivs  0xef2(%rip)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @sin(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = fmul x86_fp80 %4, %5
%7 = fdiv x86_fp80 %6, 0xK4001C000000000000000
%8 = fsub x86_fp80 %3, %7
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @sin(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, %0
%3 = fdiv x86_fp80 %2, 0xK4001C000000000000000
%4 = fsub x86_fp80 %0, %3
ret x86_fp80 %4
}
int devCoorMenor(int coorUno, int coorDos) {
  int menor;
  if (coorUno < coorDos)
    menor = coorUno;
  else
    menor = coorDos;
  return menor;
}


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

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

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

LLVM IR (-O2):
define i32 @devCoorMenor(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x1a() {
  Assert_real((isupper(26) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              135, ("isupper should be 0 for 0x1a"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1a\00"
define void @t_isupper_0x1a() {
%1 = call i64 @isupper(i32 26)
%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 135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1a\00"
define void @t_isupper_0x1a() {
%1 = tail call i64 @isupper(i32 26)
%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 135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_19int8_reg(signed char val) {
  return ((val) & (0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x19,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_19int8_reg>:
test   $0x19,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_19int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 25
%6 = icmp ne i32 %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_19int8_reg(i8 signext %0) {
%2 = and i8 %0, 25
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int isalpha(int c) {
  return !!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = xor i1 %17, true
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *canonize_path(char *, char *);
int /*<<< orphan*/ eq(char *, char *);
int /*<<< orphan*/ free(char *);
int main() {
  char *c;
  c = canonize_path("/pp/a", "./..");
  assert((eq(c, "/pp")));
  free(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1050 <canonize_path@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1060 <eq@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1050 <canonize_path@plt>
mov    %rax,%rbx
lea    0xead(%rip),%rsi
mov    %rax,%rdi
call   1060 <eq@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"/pp/a\00"
@.str.1 = [5 x i8] c"./..\00"
@.str.2 = [4 x i8] c"/pp\00"
define i32 @main() {
%1 = tail call i8* @canonize_path(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @eq(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @assert(i32 %2)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ v;

/* Variables and functions */
int binsearch(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int v[] = {1, 3, 5, 7, 9, 11, 13, 15};
  int x = 11;
  printf("Result:%d ", binsearch(x, v, (sizeof(v) / sizeof(v[0]))));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0xb,-0x24(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <binsearch@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xb,%edi
mov    $0x8,%edx
call   1030 <binsearch@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.v = [8 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15]
@.str = [11 x i8] c"Result:%d \00"
define void @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = bitcast [8 x i32]* %1 to i8*
store i32 11, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 @binsearch(i32 %4, i32* %5, i32 8)
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.main.v = [8 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15]
@.str = [11 x i8] c"Result:%d \00"
define void @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @binsearch(i32 11, i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap_endian_32(uint32_t i) {
  return ((i & 0x000000ff) << 24) | ((i & 0x0000ff00) << 8) |
         ((i & 0x00ff0000) >> 8) | ((i & 0xff000000) >> 24);
}


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

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

LLVM IR (-O0):
define i32 @swap_endian_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swap_endian_32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int fun503() { return 503; }


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

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

LLVM IR (-O0):
define i32 @fun503() {
ret i32 503
}

LLVM IR (-O2):
define i32 @fun503() {
ret i32 503
}
/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
unsigned long getTime() { return (unsigned long)time(NULL); }


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i64 @getTime() {
%1 = call i64 @time(i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @getTime() {
%1 = tail call i64 @time(i32* null)
ret i64 %1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_multprec_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(497, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @write_multprec_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 497, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void full_memory_barrier() { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @full_memory_barrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @full_memory_barrier() {
fence seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_FREEZE;
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoFreeze(int fd, char *arg) {
  if (arg)
    return -1;
  if (ioctl(fd, VIDEO_FREEZE) == -1)
    perror("VIDEO_FREEZE");
  return 0;
}


x86 assembly (clang, -O0):
<videoFreeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <videoFreeze+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <videoFreeze+0x53>
mov    -0x8(%rbp),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    116c <videoFreeze+0x4c>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoFreeze>:
push   %rbx
mov    $0xffffffff,%ebx
test   %rsi,%rsi
jne    1140 <videoFreeze+0x20>
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
je     1144 <videoFreeze+0x24>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
jmp    1140 <videoFreeze+0x20>

LLVM IR (-O0):
@VIDEO_FREEZE = global i32 0
@.str = [13 x i8] c"VIDEO_FREEZE\00"
define i32 @videoFreeze(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %17
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* @VIDEO_FREEZE
%12 = call i32 @ioctl(i32 %10, i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
store i32 0, i32* %3
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@VIDEO_FREEZE = global i32 0
@.str = [13 x i8] c"VIDEO_FREEZE\00"
define i32 @videoFreeze(i32 %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @VIDEO_FREEZE
%6 = tail call i32 @ioctl(i32 %0, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8, %2
%11 = phi i32 [ -1, %2 ], [ 0, %8 ], [ 0, %4 ]
ret i32 %11
}
int execute_chroot() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_chroot() {
ret i32 0
}
void fc3a(x) volatile short x;
{}


x86 assembly (clang, -O0):
<fc3a>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc3a>:
mov    %di,-0x2(%rsp)
ret

LLVM IR (-O0):
define void @fc3a(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store volatile i16 %3, i16* %2
ret void
}

LLVM IR (-O2):
define void @fc3a(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store volatile i16 %3, i16* %2
ret void
}
extern unsigned short __inw_p(unsigned short port) {
  unsigned short _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "d"(port));
  __asm__ __volatile__("outb %al,$0x80");
  return _v;
}


x86 assembly (clang, -O0):
<__inw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
out    %al,$0x80
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inw_p>:
mov    %edi,%edx
in     (%dx),%ax
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i16 @__inw_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @__inw_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i16 %2
}
void gdk_property_delete() {}


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

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

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

LLVM IR (-O2):
define void @gdk_property_delete() {
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_node_from_dl(struct node *);
void ofdt_put(struct node *delete) { delete_node_from_dl(delete); }


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

x86 assembly (clang, -O2):
<ofdt_put>:
jmp    1030 <delete_node_from_dl@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @ofdt_put(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call i32 @delete_node_from_dl(%struct.node* %3)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @ofdt_put(%struct.node* %0) {
%2 = tail call i32 @delete_node_from_dl(%struct.node* %0)
ret void
}
/* Variables and functions */
int ioctl(int, unsigned long, int *);
int ari_ioctlVip(int fildes, unsigned long request, int *val) {
  return ioctl(fildes, request, val);
}


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

x86 assembly (clang, -O2):
<ari_ioctlVip>:
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @ari_ioctlVip(i32 %0, i64 %1, i32* %2) {
%4 = tail call i32 @ioctl(i32 %0, i64 %1, i32* %2)
ret i32 %4
}
__attribute__((no)) int f(int k) { return k; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos3d(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { glRasterPos3d(x, y, z); }


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

x86 assembly (clang, -O2):
<RasterPos3d>:
jmp    1030 <glRasterPos3d@plt>

LLVM IR (-O0):
define void @RasterPos3d(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @glRasterPos3d(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @RasterPos3d(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glRasterPos3d(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ overflower(size_t *, int);
void overflowme(size_t *c, int start) { overflower(c, start); }


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

x86 assembly (clang, -O2):
<overflowme>:
jmp    1030 <overflower@plt>

LLVM IR (-O0):
define void @overflowme(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = call i32 @overflower(i64* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @overflowme(i64* %0, i32 %1) {
%3 = tail call i32 @overflower(i64* %0, i32 %1)
ret void
}
/* Variables and functions */
char toupper(char);
void libed_strupr(char *string, int len) {
  int index = 0;
  for (; index < len; ++index) {
    string[index] = toupper(string[index]);
  }
}


x86 assembly (clang, -O0):
<libed_strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <libed_strupr+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <libed_strupr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libed_strupr>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <libed_strupr+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <libed_strupr+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @libed_strupr(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void term_blank() { printf("\033[8m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[8m\00"
define void @term_blank() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[8m\00"
define void @term_blank() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_devinfo_with_index(int);
int masp_hal_sbc_enabled(void) {
  return (get_devinfo_with_index(6) & 0x00000002) ? 1 : 0;
}


x86 assembly (clang, -O0):
<masp_hal_sbc_enabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <get_devinfo_with_index@plt>
mov    %eax,%edx
and    $0x2,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<masp_hal_sbc_enabled>:
push   %rax
mov    $0x6,%edi
call   1030 <get_devinfo_with_index@plt>
shr    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @masp_hal_sbc_enabled() {
%1 = call i32 @get_devinfo_with_index(i32 6)
%2 = and i32 %1, 2
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @masp_hal_sbc_enabled() {
%1 = tail call i32 @get_devinfo_with_index(i32 6)
%2 = lshr i32 %1, 1
%3 = and i32 %2, 1
ret i32 %3
}
int skip_one_char(const char **p, char c) {
  if (**p == c) {
    *p += 1;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<skip_one_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <skip_one_char+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1145 <skip_one_char+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_one_char>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    %sil,(%rcx)
jne    1116 <skip_one_char+0x16>
add    $0x1,%rcx
mov    %rcx,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @skip_one_char(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %9
}
const char *get_mp3x_version(void) {
  static const char *const str = "0"
                                 "."
                                 "82";
  return str;
}


x86 assembly (clang, -O0):
<get_mp3x_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mp3x_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@get_mp3x_version.str = internal constant i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
@.str = [5 x i8] c"0.82\00"
define i8* @get_mp3x_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"0.82\00"
define i8* @get_mp3x_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
const char *unqlite_lib_ident(void) {
  return "unqlite:b172a1e2c3f62fb35c8e1fb2795121f82356cad6";
}


x86 assembly (clang, -O0):
<unqlite_lib_ident>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unqlite_lib_ident>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [49 x i8] c"unqlite:b172a1e2c3f62fb35c8e1fb2795121f82356cad6\00"
define i8* @unqlite_lib_ident() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"unqlite:b172a1e2c3f62fb35c8e1fb2795121f82356cad6\00"
define i8* @unqlite_lib_ident() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_get_reply_cookie(void *m, uint64_t *cookie) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_get_reply_cookie>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_get_reply_cookie>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_reply_cookie(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_reply_cookie(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}