xunge/DecIR huggingface dataset:
/* Variables and functions */
void *Memory__I7_alloc(int, int, int);
void *Memory__I7_calloc(int how_many, int size_in_bytes, int reason) {
  return Memory__I7_alloc(how_many, size_in_bytes, reason);
}


x86 assembly (clang, -O0):
<Memory__I7_calloc>:
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 <Memory__I7_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memory__I7_calloc>:
jmp    1030 <Memory__I7_alloc@plt>

LLVM IR (-O0):
define i8* @Memory__I7_calloc(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 i8* @Memory__I7_alloc(i32 %7, i32 %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @Memory__I7_calloc(i32 %0, i32 %1, i32 %2) {
%4 = tail call i8* @Memory__I7_alloc(i32 %0, i32 %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double randf(void) { return (double)(0.5 + rand()) / (1.0 + RAND_MAX); }


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm1
movsd  0xee0(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mov    0x2ead(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mov    0x2ebc(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randf() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double 5.000000e-01, %2
%4 = load double, double* @RAND_MAX
%5 = fadd double 1.000000e+00, %4
%6 = fdiv double %3, %5
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randf() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ ks_event_processes(int);
int socket_bind_listen(char *, int);
int main(int argc, char *argv[]) {
  int servfd;
  servfd = socket_bind_listen((char *)"127.0.0.1", 8080);
  ks_event_processes(servfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x1f90,%esi
call   1030 <socket_bind_listen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <ks_event_processes@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1f90,%esi
call   1030 <socket_bind_listen@plt>
mov    %eax,%edi
call   1040 <ks_event_processes@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @socket_bind_listen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8080)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @ks_event_processes(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @socket_bind_listen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8080)
%4 = tail call i32 @ks_event_processes(i32 %3)
ret i32 0
}
void f_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @f_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo();
main() {
  if (foo() != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1156 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int XSetModifierMapping() {}


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

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

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

LLVM IR (-O2):
define i32 @XSetModifierMapping() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ detab(char *);
int /*<<< orphan*/ settab(int, char **, char *);
main(int argc, char *argv[]) {
  char tab[100 + 1];
  settab(argc, argv, tab);
  detab(tab);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1030 <settab@plt>
mov    %rbx,%rdi
call   1040 <detab@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [101 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%10 = call i32 @settab(i32 %7, i8** %8, i8* %9)
%11 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%12 = call i32 @detab(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [101 x i8]
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%5 = call i32 @settab(i32 %0, i8** %1, i8* %4)
%6 = call i32 @detab(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle13() { kprintf("ISR %d.\n", 13); }


x86 assembly (clang, -O0):
<isrHandle13>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xd,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle13>:
lea    0xee9(%rip),%rdi
mov    $0xd,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle13() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle13() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}
unsigned int audeng_id3_decint(unsigned int sint) {
  return ((sint & 0x7F000000) >> 1) + ((sint & 0x7F0000) >> 1) +
         ((sint & 0x7F00) >> 1) + (sint & 0x7F);
}


x86 assembly (clang, -O0):
<audeng_id3_decint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f000000,%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x7f0000,%ecx
shr    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x7f00,%ecx
shr    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x7f,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audeng_id3_decint>:
mov    %edi,%eax
shr    %eax
and    $0x3fbfbf80,%eax
and    $0x7f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @audeng_id3_decint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 2130706432
%5 = lshr i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 8323072
%8 = lshr i32 %7, 1
%9 = add i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 32512
%12 = lshr i32 %11, 1
%13 = add i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 127
%16 = add i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @audeng_id3_decint(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1069531008
%4 = and i32 %0, 127
%5 = or i32 %3, %4
ret i32 %5
}
/* Type definitions */
struct parse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse_nextchar(struct parse *);
void parse_nextchars(struct parse *p, size_t sz) {
  size_t i;
  for (i = 0; i < sz; i++)
    parse_nextchar(p);
}


x86 assembly (clang, -O0):
<parse_nextchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1150 <parse_nextchars+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <parse_nextchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <parse_nextchars+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_nextchars>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     112e <parse_nextchars+0x1e>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
mov    %r14,%rdi
call   1030 <parse_nextchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <parse_nextchars+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.parse = type { i32 }
define void @parse_nextchars(%struct.parse* %0, i64 %1) {
%3 = alloca %struct.parse*
%4 = alloca i64
%5 = alloca i64
store %struct.parse* %0, %struct.parse** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %13, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load %struct.parse*, %struct.parse** %3
%12 = call i32 @parse_nextchar(%struct.parse* %11)
br label %13
13: ; preds = %10
%14 = load i64, i64* %5
%15 = add i64 %14, 1
store i64 %15, i64* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.parse = type { i32 }
define void @parse_nextchars(%struct.parse* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @parse_nextchar(%struct.parse* %0)
%7 = add nuw i64 %5, 1
%8 = icmp eq i64 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_a(int, char **);
int main(int argc, char **argv) {
  do {
    run_a(argc, argv);
  } while (0);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <run_a@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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
br label %6
6: ; preds = %2
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @run_a(i32 %7, i8** %8)
br label %10
10: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @run_a(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flag_error(char *);
int /*<<< orphan*/ scanf(char *, int *);
int read_num_slices() {
  int num_slices = 0;
  scanf("%i", &num_slices);
  if (num_slices == 0) {
    goto error;
  }
  return num_slices;
error:
  flag_error(
      "ERROR: Could not parse the number of entries from first input line.");
  return 1;
}


x86 assembly (clang, -O0):
<read_num_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    114e <read_num_slices+0x2e>
jmp    1159 <read_num_slices+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <read_num_slices+0x4c>
lea    0xea3(%rip),%rdi
call   1030 <flag_error@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_num_slices>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     1144 <read_num_slices+0x24>
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1030 <flag_error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [68 x i8] c"ERROR: Could not parse the number of entries from first input line.\00"
define i32 @read_num_slices() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %11
9: ; preds = %6
%10 = call i32 @flag_error(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [68 x i8] c"ERROR: Could not parse the number of entries from first input line.\00"
define i32 @read_num_slices() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @flag_error(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ 1, %6 ], [ %4, %0 ]
ret i32 %9
}
int defcheck_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @defcheck_init() {
ret i32 0
}
unsigned long __mp_setoption(long o, unsigned long v) { return ~0L; }


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

x86 assembly (clang, -O2):
<__mp_setoption>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @__mp_setoption(i64 %0, i64 %1) {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void **, int);
void pack_to_hptr(void *v, void *ptr) { memcpy(v, &ptr, sizeof(void *)); }


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

x86 assembly (clang, -O2):
<pack_to_hptr>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pack_to_hptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @memcpy(i8* %5, i8** %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @pack_to_hptr(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @memcpy(i8* %0, i8** %3, i32 8)
ret void
}
/* Variables and functions */
size_t ALIGN_TO(size_t l, size_t ali) {
  return ((l + ali - 1) & (unsigned)~(ali - 1));
}


x86 assembly (clang, -O0):
<ALIGN_TO>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
mov    %ecx,%ecx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ALIGN_TO>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i64 @ALIGN_TO(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = trunc i64 %11 to i32
%13 = zext i32 %12 to i64
%14 = and i64 %8, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @ALIGN_TO(i64 %0, i64 %1) {
%3 = add i64 %0, 4294967295
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %5, 4294967295
%7 = and i64 %6, %4
ret i64 %7
}
char *tskip(register char *bp) {
  while (*bp && *bp != ':')
    bp++;
  if (*bp == ':')
    bp++;
  return (bp);
}


x86 assembly (clang, -O0):
<tskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <tskip+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <tskip+0x3d>
jmp    114e <tskip+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <tskip+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    116a <tskip+0x6a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tskip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <tskip+0x22>
cmp    $0x3a,%cl
je     1122 <tskip+0x22>
add    $0x1,%rax
jmp    1110 <tskip+0x10>
xor    %edx,%edx
cmp    $0x3a,%cl
sete   %dl
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @tskip(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 58, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = icmp eq i8 %4, 58
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %3, i64 %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print3(double *v) {
  printf("%10.4g\n", *v++);
  printf("%10.4g\n", *v++);
  printf("%10.4g\n", *v);
}


x86 assembly (clang, -O0):
<print3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print3>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
lea    0xede(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%10.4g\0A\00"
define void @print3(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %3)
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load double, double* %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}
disp_hex(a, b, c) char a, b, c;
{
  char row, col;
  to_xy(a, b, &row, &col);
  movecur(row, col * 2 + 1);
  putchar(c);
}


x86 assembly (clang, -O0):
<disp_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edx,%eax
mov    %dil,%dl
mov    %sil,%cl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
movsbl -0x5(%rbp),%edi
movsbl -0x6(%rbp),%esi
lea    -0x8(%rbp),%rdx
lea    -0x9(%rbp),%rcx
mov    $0x0,%al
call   1050 <to_xy@plt>
movsbl -0x8(%rbp),%edi
movsbl -0x9(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    $0x0,%al
call   1040 <movecur@plt>
movsbl -0x7(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_hex>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
movsbl %dil,%edi
movsbl %sil,%esi
lea    0xf(%rsp),%rdx
lea    0xe(%rsp),%rcx
xor    %eax,%eax
call   1050 <to_xy@plt>
movsbl 0xf(%rsp),%edi
movsbl 0xe(%rsp),%eax
lea    (%rax,%rax,1),%esi
add    $0x1,%esi
xor    %eax,%eax
call   1040 <movecur@plt>
movsbl %bl,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @disp_hex(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = trunc i32 %0 to i8
%11 = trunc i32 %1 to i8
%12 = trunc i32 %2 to i8
store i8 %10, i8* %5
store i8 %11, i8* %6
store i8 %12, i8* %7
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = call i32 (i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @to_xy to i32 (i32, i32, i8*, i8*, ...)*)(i32 %14, i32 %16, i8* %8, i8* %9)
%18 = load i8, i8* %8
%19 = sext i8 %18 to i32
%20 = load i8, i8* %9
%21 = sext i8 %20 to i32
%22 = mul nsw i32 %21, 2
%23 = add nsw i32 %22, 1
%24 = call i32 (i32, i32, ...) bitcast (i32 (...)* @movecur to i32 (i32, i32, ...)*)(i32 %19, i32 %23)
%25 = load i8, i8* %7
%26 = sext i8 %25 to i32
%27 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %26)
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @disp_hex(i32 %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8
%6 = shl i32 %0, 24
%7 = ashr exact i32 %6, 24
%8 = shl i32 %1, 24
%9 = ashr exact i32 %8, 24
%10 = call i32 (i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @to_xy to i32 (i32, i32, i8*, i8*, ...)*)(i32 %7, i32 %9, i8* %4, i8* %5)
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = shl nsw i32 %14, 1
%16 = or i32 %15, 1
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @movecur to i32 (i32, i32, ...)*)(i32 %12, i32 %16)
%18 = shl i32 %2, 24
%19 = ashr exact i32 %18, 24
%20 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %19)
ret i32 undef
}
void UART_ScbModeStop(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_ScbModeStop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int bitposition() {
  int bitpos;
  printf("Enter bit position from (0 to 31): \n");
  scanf("%d", &bitpos);
  return bitpos;
}


x86 assembly (clang, -O0):
<bitposition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitposition>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Enter bit position from (0 to 31): \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @bitposition() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [36 x i8] c"Enter bit position from (0 to 31): \00"
define i32 @bitposition() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
size_t region_output_size(void) { return 1024; }


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

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

LLVM IR (-O0):
define i64 @region_output_size() {
ret i64 1024
}

LLVM IR (-O2):
define i64 @region_output_size() {
ret i64 1024
}
/* Variables and functions */
int PATH_MAX;
char *get_fixtures_dir();
char *read_file(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *read_fixture(char *fixture) {
  char path[PATH_MAX];
  sprintf(path, "%s/%s", get_fixtures_dir(), fixture);
  return read_file(path);
}


x86 assembly (clang, -O0):
<read_fixture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <get_fixtures_dir@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xe7f(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <read_file@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_fixture>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
xor    %eax,%eax
call   1040 <get_fixtures_dir@plt>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <read_file@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [6 x i8] c"%s/%s\00"
define i8* @read_fixture(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @PATH_MAX
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = call i8* (...) @get_fixtures_dir()
%10 = load i8*, i8** %2
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = call i8* @read_file(i8* %8)
%13 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [6 x i8] c"%s/%s\00"
define i8* @read_fixture(i8* %0) {
%2 = load i32, i32* @PATH_MAX
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = tail call i8* (...) @get_fixtures_dir()
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %0)
%7 = call i8* @read_file(i8* %4)
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fputs(char *, int /*<<< orphan*/ *);
int write_temp(char *line, FILE *temp) {
  int result = EOF;
  if (temp != NULL) {
    result = fputs(line, temp);
  }
  return result;
}


x86 assembly (clang, -O0):
<write_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1147 <write_temp+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_temp>:
test   %rsi,%rsi
je     111a <write_temp+0xa>
jmp    1030 <fputs@plt>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @write_temp(i8* nocapture %0, i32* %1) {
%3 = load i32, i32* @EOF
%4 = icmp eq i32* %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %0, i32* %1)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Type definitions */
typedef unsigned long long uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ jenkins_hashlittle2(void const *, size_t, scalar_t__ *,
                                       scalar_t__ *);
uint64_t jenkins_hash64(const void *data, size_t length) {
  uint32_t a = 0, b = 0;
  jenkins_hashlittle2(data, length, &a, &b);
  return ((uint64_t)a << 32ULL) | (uint64_t)b;
}


x86 assembly (clang, -O0):
<jenkins_hash64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <jenkins_hashlittle2@plt>
mov    -0x18(%rbp),%rax
shl    $0x20,%rax
or     -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jenkins_hash64>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <jenkins_hashlittle2@plt>
mov    0x10(%rsp),%rax
shl    $0x20,%rax
or     0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @jenkins_hash64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @jenkins_hashlittle2(i8* %7, i64 %8, i64* %5, i64* %6)
%10 = load i64, i64* %5
%11 = shl i64 %10, 32
%12 = load i64, i64* %6
%13 = or i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @jenkins_hash64(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%7 = call i32 @jenkins_hashlittle2(i8* %0, i64 %1, i64* %3, i64* %4)
%8 = load i64, i64* %3
%9 = shl i64 %8, 32
%10 = load i64, i64* %4
%11 = or i64 %9, %10
ret i64 %11
}
/* Variables and functions */
int gl_gllog_add_alt(char *, char *);
int gl_gllog_add(char *str) {
  return gl_gllog_add_alt(str, "/ftp-data/logs/glftpd.log");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"/ftp-data/logs/glftpd.log\00"
define i32 @gl_gllog_add(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gl_gllog_add_alt(i8* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [26 x i8] c"/ftp-data/logs/glftpd.log\00"
define i32 @gl_gllog_add(i8* %0) {
%2 = tail call i32 @gl_gllog_add_alt(i8* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint bits(uint n) {
  uint b = 0;
  while (n) {
    b++;
    n >>= 1;
  }
  return b;
}


x86 assembly (clang, -O0):
<bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bits+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bits+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int exp(double);
double logi_b1(double x) {
  return x > 0 ? 1 / (1 + exp(-x)) : exp(x) / (1 + exp(x));
}


x86 assembly (clang, -O0):
<logi_b1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <logi_b1+0x55>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    118a <logi_b1+0x7a>
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logi_b1>:
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    113e <logi_b1+0x2e>
xorpd  0xed9(%rip),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
lea    0x1(%rcx),%edx
add    $0x2,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
cmovb  %edx,%eax
jmp    115e <logi_b1+0x4e>
movapd %xmm0,(%rsp)
call   1030 <exp@plt>
mov    %eax,%ebx
movapd (%rsp),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @logi_b1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
%8 = call i32 @exp(double %7)
%9 = add nsw i32 1, %8
%10 = sdiv i32 1, %9
br label %18
11: ; preds = %1
%12 = load double, double* %2
%13 = call i32 @exp(double %12)
%14 = load double, double* %2
%15 = call i32 @exp(double %14)
%16 = add nsw i32 1, %15
%17 = sdiv i32 %13, %16
br label %18
18: ; preds = %11, %5
%19 = phi i32 [ %10, %5 ], [ %17, %11 ]
%20 = sitofp i32 %19 to double
ret double %20
}

LLVM IR (-O2):
define double @logi_b1(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = fneg double %0
%5 = tail call i32 @exp(double %4)
%6 = add nsw i32 %5, 1
%7 = add i32 %5, 2
%8 = icmp ult i32 %7, 3
%9 = select i1 %8, i32 %6, i32 0
br label %15
10: ; preds = %1
%11 = tail call i32 @exp(double %0)
%12 = tail call i32 @exp(double %0)
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %11, %13
br label %15
15: ; preds = %10, %3
%16 = phi i32 [ %9, %3 ], [ %14, %10 ]
%17 = sitofp i32 %16 to double
ret double %17
}
int _read(int fd, char *buf, int nbytes) { return 0; }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ out;

/* Variables and functions */
size_t base64_decode(char *, char *, int);
char *sid_btotext(char *);
char *sid_b64totext(char *buf, size_t len) {
  char *p;
  char out[1024];
  len = base64_decode(out, buf, sizeof(out));
  p = out;
  return sid_btotext(p);
}


x86 assembly (clang, -O0):
<sid_b64totext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x400,%edx
call   1040 <base64_decode@plt>
mov    %rax,-0x10(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <sid_btotext@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sid_b64totext>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%edx
call   1040 <base64_decode@plt>
mov    %rbx,%rdi
call   1030 <sid_btotext@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sid_b64totext(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca [1024 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i64 @base64_decode(i8* %7, i8* %8, i32 1024)
store i64 %9, i64* %4
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = call i8* @sid_btotext(i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @sid_b64totext(i8* %0, i64 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i64 @base64_decode(i8* %4, i8* %0, i32 1024)
%6 = call i8* @sid_btotext(i8* %4)
ret i8* %6
}
/* Variables and functions */
int *function(int *);
int main() {
  int a[3] = {0};
  return function(a) == a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
call   1040 <function@plt>
lea    -0x10(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <function@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = call i32* @function(i32* %4)
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = icmp eq i32* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32* @function(i32* %3)
%5 = icmp eq i32* %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void CFGMR3QueryBoolDef(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryBoolDef() {
ret void
}
void f7() {
  int y;
#pragma unused(undeclared, undefined, y)
}


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

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

LLVM IR (-O0):
define void @f7() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @f7() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ unsetenv(char *);
void reset_tz(char *value) {
  if (value) {
    setenv("TZ", value, 1);
  } else {
    unsetenv("TZ");
  }
}


x86 assembly (clang, -O0):
<reset_tz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <reset_tz+0x31>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
jmp    115d <reset_tz+0x3d>
lea    0xea8(%rip),%rdi
call   1040 <unsetenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_tz>:
test   %rdi,%rdi
je     1139 <reset_tz+0x19>
mov    %rdi,%rsi
lea    0xed1(%rip),%rdi
mov    $0x1,%edx
jmp    1030 <setenv@plt>
lea    0xec0(%rip),%rdi
jmp    1040 <unsetenv@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"TZ\00"
define void @reset_tz(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6, i32 1)
br label %10
8: ; preds = %1
%9 = call i32 @unsetenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"TZ\00"
define void @reset_tz(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
br label %7
5: ; preds = %1
%6 = tail call i32 @unsetenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
prratio(num, den) long int num, den;
{
  register int q;
  if (num > 214748L) {
    q = num / (den / 10000L);
  } else {
    q = 10000L * num / den;
  }
  if (q < 0) {
    ("-");
    q = -q;
  }
  ("%d.%02d%%", q / 100, q % 100);
  return 0;
}


x86 assembly (clang, -O0):
<prratio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x346dc,-0x8(%rbp)
jle    1144 <prratio+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cqto
idiv   %rcx
mov    %eax,-0x14(%rbp)
jmp    1155 <prratio+0x55>
imul   $0x2710,-0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1167 <prratio+0x67>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [10 x i8] c"%d.%02d%%\00"
define i32 @prratio(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp sgt i64 %6, 214748
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sdiv i64 %10, 10000
%12 = sdiv i64 %9, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %5
br label %20
14: ; preds = %2
%15 = load i64, i64* %3
%16 = mul nsw i64 10000, %15
%17 = load i64, i64* %4
%18 = sdiv i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %5
br label %20
20: ; preds = %14, %8
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %5
%25 = sub nsw i32 0, %24
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %5
%28 = sdiv i32 %27, 100
%29 = load i32, i32* %5
%30 = srem i32 %29, 100
ret i32 0
}

LLVM IR (-O2):
define i32 @prratio(i64 %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ matNd_copy(double *, double const *, int);
void mat4d_copy(double dest[16], const double src[16]) {
  matNd_copy(dest, src, 4);
}


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

x86 assembly (clang, -O2):
<mat4d_copy>:
mov    $0x4,%edx
jmp    1030 <matNd_copy@plt>

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

LLVM IR (-O2):
define void @mat4d_copy(double* %0, double* %1) {
%3 = tail call i32 @matNd_copy(double* %0, double* %1, i32 4)
ret void
}