xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strdup(char *);
char *strrchr(char const *, char);
char *filename(const char *path) {
  char *ptr = strrchr(path, '\\');
  char *b = strdup(ptr ? ptr + 1 : (char *)path);
  char *p = strrchr(b, '.');
  if (p != NULL)
    *p = '\0';
  return b;
}


x86 assembly (clang, -O0):
<filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <filename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1162 <filename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1193 <filename+0x73>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rdi
test   %rax,%rax
cmove  %rbx,%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1156 <filename+0x36>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strrchr(i8* %6, i8 signext 92)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
br label %15
13: ; preds = %1
%14 = load i8*, i8** %2
br label %15
15: ; preds = %13, %10
%16 = phi i8* [ %12, %10 ], [ %14, %13 ]
%17 = call i8* @strdup(i8* %16)
store i8* %17, i8** %4
%18 = load i8*, i8** %4
%19 = call i8* @strrchr(i8* %18, i8 signext 46)
store i8* %19, i8** %5
%20 = load i8*, i8** %5
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %15
%23 = load i8*, i8** %5
store i8 0, i8* %23
br label %24
24: ; preds = %22, %15
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @filename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i8* @strdup(i8* %5)
%7 = tail call i8* @strrchr(i8* dereferenceable(1) %6, i8 signext 46)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8 0, i8* %7
br label %10
10: ; preds = %9, %1
ret i8* %6
}
/* Type definitions */
struct bfq_service_tree {
  int dummy;
};
struct bfq_entity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bfq_forget_entity(struct bfq_service_tree *,
                                     struct bfq_entity *);
int /*<<< orphan*/ bfq_idle_extract(struct bfq_service_tree *,
                                    struct bfq_entity *);
void bfq_put_idle_entity(struct bfq_service_tree *st,
                         struct bfq_entity *entity) {
  bfq_idle_extract(st, entity);
  bfq_forget_entity(st, entity);
}


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

x86 assembly (clang, -O2):
<bfq_put_idle_entity>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <bfq_idle_extract@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <bfq_forget_entity@plt>

LLVM IR (-O0):
%struct.bfq_service_tree = type { i32 }
%struct.bfq_entity = type { i32 }
define void @bfq_put_idle_entity(%struct.bfq_service_tree* %0, %struct.bfq_entity* %1) {
%3 = alloca %struct.bfq_service_tree*
%4 = alloca %struct.bfq_entity*
store %struct.bfq_service_tree* %0, %struct.bfq_service_tree** %3
store %struct.bfq_entity* %1, %struct.bfq_entity** %4
%5 = load %struct.bfq_service_tree*, %struct.bfq_service_tree** %3
%6 = load %struct.bfq_entity*, %struct.bfq_entity** %4
%7 = call i32 @bfq_idle_extract(%struct.bfq_service_tree* %5, %struct.bfq_entity* %6)
%8 = load %struct.bfq_service_tree*, %struct.bfq_service_tree** %3
%9 = load %struct.bfq_entity*, %struct.bfq_entity** %4
%10 = call i32 @bfq_forget_entity(%struct.bfq_service_tree* %8, %struct.bfq_entity* %9)
ret void
}

LLVM IR (-O2):
%struct.bfq_service_tree = type { i32 }
%struct.bfq_entity = type { i32 }
define void @bfq_put_idle_entity(%struct.bfq_service_tree* %0, %struct.bfq_entity* %1) {
%3 = tail call i32 @bfq_idle_extract(%struct.bfq_service_tree* %0, %struct.bfq_entity* %1)
%4 = tail call i32 @bfq_forget_entity(%struct.bfq_service_tree* %0, %struct.bfq_entity* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;
typedef int GLbyte;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
GLdouble extractSbyte(int isSwap, const void *sbyte) {
  isSwap = isSwap;
  assert(*((const GLbyte *)sbyte) <= 127);
  return (GLdouble)(*((const GLbyte *)sbyte));
}


x86 assembly (clang, -O0):
<extractSbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x7f,(%rax)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractSbyte>:
push   %rbx
mov    %rsi,%rbx
xor    %edi,%edi
cmpl   $0x80,(%rsi)
setl   %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @extractSbyte(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
store i32 %5, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 127
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @extractSbyte(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}
double asin(double x) {
  return ({
    extern __typeof__(asin) module_libc_asin;
    &module_libc_asin;
  })(x);
}


x86 assembly (clang, -O0):
<asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asin>:
jmp    1030 <module_libc_asin@plt>

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
%3 = alloca double (double)*
store double %0, double* %2
store double (double)* @module_libc_asin, double (double)** %3
%4 = load double (double)*, double (double)** %3
%5 = load double, double* %2
%6 = call double %4(double %5)
ret double %6
}

LLVM IR (-O2):
define double @asin(double %0) {
%2 = tail call double @module_libc_asin(double %0)
ret double %2
}
void gnu_debug_unlock() {}


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

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

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

LLVM IR (-O2):
define void @gnu_debug_unlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello World!");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void mutt_exit(int code) { exit(code); }


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

x86 assembly (clang, -O2):
<mutt_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @mutt_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
int vgs2_pause() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vgs2_pause() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *reverseWords(char *);
int main() {
  char s[] = "  hello world!  ";
  printf("%s\\0", reverseWords(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <reverseWords@plt>
mov    %rax,%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1040 <reverseWords@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [17 x i8] c" hello world! \00"
@.str = [5 x i8] c"%s\\0\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = bitcast [17 x i8]* %1 to i8*
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = call i8* @reverseWords(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [17 x i8] c" hello world! \00"
@.str = [5 x i8] c"%s\\0\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = call i8* @reverseWords(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
void XScreenSaverSuspend(Display *dpy, Bool suspend) {}


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

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

LLVM IR (-O0):
define void @XScreenSaverSuspend(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 @XScreenSaverSuspend(i32* nocapture %0, i32 %1) {
ret void
}
double trunc(double s) { return (double)(int)((double)s); }


x86 assembly (clang, -O0):
<trunc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}
__attribute__((visibility("default"))) int
httplib_atomic_dec(volatile int *addr) {
  return __sync_sub_and_fetch(addr, 1);
}


x86 assembly (clang, -O0):
<httplib_atomic_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xffffffff,%eax
lock xadd %eax,(%rcx)
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<httplib_atomic_dec>:
mov    $0xffffffff,%eax
lock xadd %eax,(%rdi)
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @httplib_atomic_dec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = atomicrmw sub i32* %3, i32 1 seq_cst
%5 = sub i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @httplib_atomic_dec(i32* nocapture %0) {
%2 = atomicrmw sub i32* %0, i32 1 seq_cst
%3 = add i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stderr;
void check_args(const int argc, const char *const argv[], const int required) {
  if (argc < required) {
    fprintf(stderr, "Usage: %s helper-name [args]\n", argv[0]);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1168 <check_args+0x48>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_args>:
cmp    %edx,%edi
jl     1125 <check_args+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s helper-name [args]\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_args(i32 %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s helper-name [args]\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_args(i32 %0, i8** nocapture %1, i32 %2) {
%4 = icmp slt i32 %0, %2
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
int gpio_direction_get(unsigned gpio) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_direction_get(i32 %0) {
ret i32 -1
}
/* Type definitions */
struct r8a66597 {
  int dummy;
};

/* Variables and functions */
unsigned long get_dvstctr_reg(int);
int /*<<< orphan*/ r8a66597_mdfy(struct r8a66597 *, int, int, unsigned long);
void r8a66597_port_power(struct r8a66597 *r8a66597, int port, int power) {
  unsigned long dvstctr_reg = get_dvstctr_reg(port);
  if (power)
    r8a66597_mdfy(r8a66597, 0x0200, 0, dvstctr_reg);
  else
    r8a66597_mdfy(r8a66597, 0, 0x0200, dvstctr_reg);
}


x86 assembly (clang, -O0):
<r8a66597_port_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <get_dvstctr_reg@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1161 <r8a66597_port_power+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x200,%esi
xor    %edx,%edx
call   1040 <r8a66597_mdfy@plt>
jmp    1175 <r8a66597_port_power+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <r8a66597_mdfy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r8a66597_port_power>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <get_dvstctr_reg@plt>
mov    %rbx,%rdi
test   %ebp,%ebp
je     113f <r8a66597_port_power+0x1f>
mov    $0x200,%esi
xor    %edx,%edx
jmp    1146 <r8a66597_port_power+0x26>
xor    %esi,%esi
mov    $0x200,%edx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <r8a66597_mdfy@plt>

LLVM IR (-O0):
%struct.r8a66597 = type { i32 }
define void @r8a66597_port_power(%struct.r8a66597* %0, i32 %1, i32 %2) {
%4 = alloca %struct.r8a66597*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store %struct.r8a66597* %0, %struct.r8a66597** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = call i64 @get_dvstctr_reg(i32 %8)
store i64 %9, i64* %7
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load %struct.r8a66597*, %struct.r8a66597** %4
%14 = load i64, i64* %7
%15 = call i32 @r8a66597_mdfy(%struct.r8a66597* %13, i32 512, i32 0, i64 %14)
br label %20
16: ; preds = %3
%17 = load %struct.r8a66597*, %struct.r8a66597** %4
%18 = load i64, i64* %7
%19 = call i32 @r8a66597_mdfy(%struct.r8a66597* %17, i32 0, i32 512, i64 %18)
br label %20
20: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
%struct.r8a66597 = type { i32 }
define void @r8a66597_port_power(%struct.r8a66597* %0, i32 %1, i32 %2) {
%4 = tail call i64 @get_dvstctr_reg(i32 %1)
%5 = icmp eq i32 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @r8a66597_mdfy(%struct.r8a66597* %0, i32 512, i32 0, i64 %4)
br label %10
8: ; preds = %3
%9 = tail call i32 @r8a66597_mdfy(%struct.r8a66597* %0, i32 0, i32 512, i64 %4)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray() {
  int array[100];
  int i;
  for (i = 0; i < 100; i++) {
    printf("%d ", array[i] + 1);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x194(%rbp)
cmpl   $0x64,-0x194(%rbp)
jge    1165 <printArray+0x55>
movslq -0x194(%rbp),%rax
mov    -0x190(%rbp,%rax,4),%esi
add    $0x1,%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1125 <printArray+0x15>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r14
push   %rbx
sub    $0x198,%rsp
lea    0xecf(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsp,%rbx,4),%esi
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x198,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %9, %3 ]
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 100
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int fdt_cells(void const *, int, char *);
int fdt_size_cells(const void *fdt, int nodeoffset) {
  return fdt_cells(fdt, nodeoffset, "#size-cells");
}


x86 assembly (clang, -O0):
<fdt_size_cells>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <fdt_cells@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_size_cells>:
lea    0xee9(%rip),%rdx
jmp    1030 <fdt_cells@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"#size-cells\00"
define i32 @fdt_size_cells(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @fdt_cells(i8* %5, i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"#size-cells\00"
define i32 @fdt_size_cells(i8* %0, i32 %1) {
%3 = tail call i32 @fdt_cells(i8* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
int cycleLength(int n) {
  int count = 1;
  while (n > 1) {
    if (n & 1) {
      n = 3 * n + 1;
    } else {
      n >>= 1;
    }
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<cycleLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    114d <cycleLength+0x4d>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1136 <cycleLength+0x36>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <cycleLength+0x3f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <cycleLength+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycleLength>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1127 <cycleLength+0x27>
mov    $0x1,%eax
nop
mov    %edi,%ecx
shr    %ecx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
jg     1110 <cycleLength+0x10>
ret

LLVM IR (-O0):
define i32 @cycleLength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %2
%13 = mul nsw i32 3, %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %18
15: ; preds = %7
%16 = load i32, i32* %2
%17 = ashr i32 %16, 1
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @cycleLength(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %12, %3 ], [ 1, %1 ]
%5 = phi i32 [ %11, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = mul nsw i32 %5, 3
%9 = add nsw i32 %8, 1
%10 = lshr i32 %5, 1
%11 = select i1 %7, i32 %10, i32 %9
%12 = add nuw nsw i32 %4, 1
%13 = icmp sgt i32 %11, 1
br i1 %13, label %3, label %14
14: ; preds = %3, %1
%15 = phi i32 [ 1, %1 ], [ %12, %3 ]
ret i32 %15
}
void get_load_average(float *load_1, float *load_5, float *load_15) {
  *load_1 = 0.0;
  *load_5 = 0.0;
  *load_15 = 0.0;
}


x86 assembly (clang, -O0):
<get_load_average>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_load_average>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @get_load_average(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
store float 0.000000e+00, float* %7
%8 = load float*, float** %5
store float 0.000000e+00, float* %8
%9 = load float*, float** %6
store float 0.000000e+00, float* %9
ret void
}

LLVM IR (-O2):
define void @get_load_average(float* nocapture writeonly %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
store float 0.000000e+00, float* %0
store float 0.000000e+00, float* %1
store float 0.000000e+00, float* %2
ret void
}
unsigned xrop3_128_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_128_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_128_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_128_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_question();
int getch();
int /*<<< orphan*/ printw(char *);
int which_line(void) {
  clear_question();
  printw("Which line do you want to change (1 - 6)? ");
  int num = getch() - '0';
  if (num > 6 || num < 1)
    num = 7;
  clear_question();
  return num;
}


x86 assembly (clang, -O0):
<which_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <clear_question@plt>
lea    0xeba(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <getch@plt>
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jg     116c <which_line+0x3c>
cmpl   $0x1,-0x4(%rbp)
jge    1173 <which_line+0x43>
movl   $0x7,-0x4(%rbp)
mov    $0x0,%al
call   1050 <clear_question@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<which_line>:
push   %rbx
xor    %eax,%eax
call   1050 <clear_question@plt>
lea    0xec1(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
call   1040 <getch@plt>
lea    -0x30(%rax),%ecx
add    $0xffffffc9,%eax
cmp    $0xfffffffa,%eax
mov    $0x7,%ebx
cmovae %ecx,%ebx
xor    %eax,%eax
call   1050 <clear_question@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Which line do you want to change (1 - 6)? \00"
define i32 @which_line() {
%1 = alloca i32
%2 = call i32 (...) @clear_question()
%3 = call i32 @printw(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getch()
%5 = sub nsw i32 %4, 48
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 6
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8, %0
store i32 7, i32* %1
br label %12
12: ; preds = %11, %8
%13 = call i32 (...) @clear_question()
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [43 x i8] c"Which line do you want to change (1 - 6)? \00"
define i32 @which_line() {
%1 = tail call i32 (...) @clear_question()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getch()
%4 = add nsw i32 %3, -48
%5 = add i32 %3, -55
%6 = icmp ult i32 %5, -6
%7 = select i1 %6, i32 7, i32 %4
%8 = tail call i32 (...) @clear_question()
ret i32 %7
}
/* Variables and functions */
int SIGWINCH;
int /*<<< orphan*/ resize();
void sigwinch(int signo) {
  if (signo != SIGWINCH)
    return;
  resize();
}


x86 assembly (clang, -O0):
<sigwinch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
je     1132 <sigwinch+0x22>
jmp    1139 <sigwinch+0x29>
mov    $0x0,%al
call   1030 <resize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigwinch>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1122 <sigwinch+0x12>
xor    %eax,%eax
jmp    1030 <resize@plt>
ret

LLVM IR (-O0):
@SIGWINCH = global i32 0
define void @sigwinch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGWINCH
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = call i32 (...) @resize()
br label %9
9: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@SIGWINCH = global i32 0
define void @sigwinch(i32 %0) {
%2 = load i32, i32* @SIGWINCH
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @resize()
br label %6
6: ; preds = %1, %4
ret void
}
unsigned int lx_get_pitch(unsigned int xres, int bpp) {
  return (((xres * (bpp >> 3)) + 7) & ~7);
}


x86 assembly (clang, -O0):
<lx_get_pitch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x3,%ecx
imul   %ecx,%eax
add    $0x7,%eax
and    $0xfffffff8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lx_get_pitch>:
sar    $0x3,%esi
imul   %edi,%esi
lea    0x7(%rsi),%eax
and    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @lx_get_pitch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 3
%8 = mul i32 %5, %7
%9 = add i32 %8, 7
%10 = and i32 %9, -8
ret i32 %10
}

LLVM IR (-O2):
define i32 @lx_get_pitch(i32 %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = mul i32 %3, %0
%5 = add i32 %4, 7
%6 = and i32 %5, -8
ret i32 %6
}
/* Variables and functions */
int cos(double);
int sin(double);
double f(double *y, double t, double *par) {
  return sin(y[0]) / (1. + cos(y[0]) * cos(y[0]));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <cos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <cos@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm2
movsd  0xe7f(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rbx),%xmm0
call   1040 <cos@plt>
mov    %eax,%ebp
movsd  (%rbx),%xmm0
call   1040 <cos@plt>
imul   %ebp,%eax
cvtsi2sd %eax,%xmm1
addsd  0xea2(%rip),%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @f(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 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = call i32 @sin(double %9)
%11 = sitofp i32 %10 to double
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = call i32 @cos(double %14)
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = call i32 @cos(double %18)
%20 = mul nsw i32 %15, %19
%21 = sitofp i32 %20 to double
%22 = fadd double 1.000000e+00, %21
%23 = fdiv double %11, %22
ret double %23
}

LLVM IR (-O2):
define double @f(double* nocapture %0, double %1, double* nocapture readnone %2) {
%4 = load double, double* %0
%5 = tail call i32 @sin(double %4)
%6 = sitofp i32 %5 to double
%7 = load double, double* %0
%8 = tail call i32 @cos(double %7)
%9 = load double, double* %0
%10 = tail call i32 @cos(double %9)
%11 = mul nsw i32 %10, %8
%12 = sitofp i32 %11 to double
%13 = fadd double %12, 1.000000e+00
%14 = fdiv double %6, %13
ret double %14
}
/* Variables and functions */
long const log(double const);
double AT_histoOld_log_bin_width(const long number_of_bins,
                                 const double bin_centers[]) {
  return (log(bin_centers[number_of_bins - 1]) - log(bin_centers[0])) /
         (number_of_bins - 1.);
}


x86 assembly (clang, -O0):
<AT_histoOld_log_bin_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <log@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <log@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
cvtsi2sd %rax,%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xe9c(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_histoOld_log_bin_width>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
movsd  -0x8(%rsi,%rdi,8),%xmm0
call   1030 <log@plt>
mov    %rax,%rbx
movsd  (%r15),%xmm0
call   1030 <log@plt>
sub    %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
cvtsi2sd %r14,%xmm1
addsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @AT_histoOld_log_bin_width(i64 %0, double* %1) {
%3 = alloca i64
%4 = alloca double*
store i64 %0, i64* %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %6, 1
%8 = getelementptr inbounds double, double* %5, i64 %7
%9 = load double, double* %8
%10 = call i64 @log(double %9)
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = call i64 @log(double %13)
%15 = sub nsw i64 %10, %14
%16 = sitofp i64 %15 to double
%17 = load i64, i64* %3
%18 = sitofp i64 %17 to double
%19 = fsub double %18, 1.000000e+00
%20 = fdiv double %16, %19
ret double %20
}

LLVM IR (-O2):
define double @AT_histoOld_log_bin_width(i64 %0, double* nocapture %1) {
%3 = add nsw i64 %0, -1
%4 = getelementptr inbounds double, double* %1, i64 %3
%5 = load double, double* %4
%6 = tail call i64 @log(double %5)
%7 = load double, double* %1
%8 = tail call i64 @log(double %7)
%9 = sub nsw i64 %6, %8
%10 = sitofp i64 %9 to double
%11 = sitofp i64 %0 to double
%12 = fadd double %11, -1.000000e+00
%13 = fdiv double %10, %12
ret double %13
}
int HelpItem82(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem82() {
ret i32 0
}
void f() {
  int x, y;
  int z, *u, ***pointer;
  float a, b[10], c[5][5];
  char one, (*two)[2], *three[3], *const four[4];
  return;
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32***
%6 = alloca float
%7 = alloca [10 x float]
%8 = alloca [5 x [5 x float]]
%9 = alloca i8
%10 = alloca [2 x i8]*
%11 = alloca [3 x i8*]
%12 = alloca [4 x i8*]
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int ap_get_single_string_command(int, int, char *, int);
int ap_get_track_number(int session, char *str) {
  return (ap_get_single_string_command(session, 0xcc13, str, 10));
}


x86 assembly (clang, -O0):
<ap_get_track_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc13,%esi
mov    $0xa,%ecx
call   1030 <ap_get_single_string_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_track_number>:
mov    %rsi,%rdx
mov    $0xcc13,%esi
mov    $0xa,%ecx
jmp    1030 <ap_get_single_string_command@plt>

LLVM IR (-O0):
define i32 @ap_get_track_number(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @ap_get_single_string_command(i32 %5, i32 52243, i8* %6, i32 10)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_get_track_number(i32 %0, i8* %1) {
%3 = tail call i32 @ap_get_single_string_command(i32 %0, i32 52243, i8* %1, i32 10)
ret i32 %3
}
/* Variables and functions */
int pm8xxx_mpp_cfg(unsigned int, int, unsigned int, unsigned int);
int pm8xxx_mpp_config_bi_dir(unsigned mpp, unsigned level, unsigned control) {
  return pm8xxx_mpp_cfg(mpp, 2, level, control);
}


x86 assembly (clang, -O0):
<pm8xxx_mpp_config_bi_dir>:
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),%edx
mov    -0xc(%rbp),%ecx
mov    $0x2,%esi
call   1030 <pm8xxx_mpp_cfg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8xxx_mpp_config_bi_dir>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <pm8xxx_mpp_cfg@plt>

LLVM IR (-O0):
define i32 @pm8xxx_mpp_config_bi_dir(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 @pm8xxx_mpp_cfg(i32 %7, i32 2, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pm8xxx_mpp_config_bi_dir(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8xxx_mpp_cfg(i32 %0, i32 2, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ e_sei();
void e_sei_accu() { e_sei(); }


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

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

LLVM IR (-O0):
define void @e_sei_accu() {
%1 = call i32 (...) @e_sei()
ret void
}

LLVM IR (-O2):
define void @e_sei_accu() {
%1 = tail call i32 (...) @e_sei()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int f(int a, int b) {
  int c;
  printf("a=%d b=%d\n", a, b);
  if (a > b)
    c = 1;
  else if (a == b)
    c = 0;
  else
    c = -1;
  return (c);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1148 <f+0x38>
movl   $0x1,-0xc(%rbp)
jmp    116c <f+0x5c>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1160 <f+0x50>
movl   $0x0,-0xc(%rbp)
jmp    1167 <f+0x57>
movl   $0xffffffff,-0xc(%rbp)
jmp    116c <f+0x5c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %esi,%edx
mov    %edi,%esi
xor    %eax,%eax
cmp    %edx,%edi
setne  %al
neg    %eax
cmp    %edx,%edi
lea    0xed9(%rip),%rdi
mov    $0x1,%ebx
cmovle %eax,%ebx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a=%d b=%d\0A\00"
define i32 @f(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 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %5
br label %20
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %5
br label %19
18: ; preds = %13
store i32 -1, i32* %5
br label %19
19: ; preds = %18, %17
br label %20
20: ; preds = %19, %12
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d b=%d\0A\00"
define i32 @f(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = icmp sgt i32 %0, %1
%5 = icmp ne i32 %0, %1
%6 = sext i1 %5 to i32
%7 = select i1 %4, i32 1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_TYPE_HASH;
int bpf_create_map(int /*<<< orphan*/, int, size_t, int, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
int create_map(size_t val_size, int num) {
  int map_fd;
  map_fd =
      bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(long long), val_size, num, 0);
  if (map_fd < 0) {
    printf("failed to create map '%s'\n", strerror(errno));
  }
  return map_fd;
}


x86 assembly (clang, -O0):
<create_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x8,%esi
xor    %r8d,%r8d
call   1040 <bpf_create_map@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1186 <create_map+0x56>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_map>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    $0x8,%esi
xor    %r8d,%r8d
call   1040 <bpf_create_map@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    116f <create_map+0x3f>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe99(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@BPF_MAP_TYPE_HASH = global i32 0
@.str = [27 x i8] c"failed to create map '%s'\0A\00"
@errno = global i32 0
define i32 @create_map(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i32, i32* @BPF_MAP_TYPE_HASH
%7 = load i64, i64* %3
%8 = load i32, i32* %4
%9 = call i32 @bpf_create_map(i32 %6, i32 8, i64 %7, i32 %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* @errno
%14 = call i8* @strerror(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@BPF_MAP_TYPE_HASH = global i32 0
@.str = [27 x i8] c"failed to create map '%s'\0A\00"
@errno = global i32 0
define i32 @create_map(i64 %0, i32 %1) {
%3 = load i32, i32* @BPF_MAP_TYPE_HASH
%4 = tail call i32 @bpf_create_map(i32 %3, i32 8, i64 %0, i32 %1, i32 0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xdc() {
  Assert_real((ispunct(220) == 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_ispunct.c",
              1105, ("ispunct should be 0 for 0xdc"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xdc>:
push   %rax
mov    $0xdc,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x451,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xdc\00"
define void @t_ispunct_0xdc() {
%1 = call i64 @ispunct(i32 220)
%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 1105, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xdc\00"
define void @t_ispunct_0xdc() {
%1 = tail call i64 @ispunct(i32 220)
%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 1105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}