xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: simple_proxy [-f] [-x] [target host] [target port] [port]\n");
  exit(3);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: simple_proxy [-f] [-x] [target host] [target port] [port]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: simple_proxy [-f] [-x] [target host] [target port] [port]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sync();
main() { sync(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @sync()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sync()
ret i32 0
}
/* Variables and functions */
int getLine(char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int len, max = 0;
  char line[1000];
  while ((len = getLine(line, 1000)) > 0)
    printf("%d: %s", len - 1, line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getLine@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1174 <main+0x54>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x400(%rbp),%rdx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getLine@plt>
test   %eax,%eax
jle    1171 <main+0x51>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%eax
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getLine@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d: %s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getLine(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = add nsw i32 %6, -1
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %2)
%9 = call i32 @getLine(i8* %2, i32 1000)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
void silent_printf(char *fmt, ...) { (void)fmt; }


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

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

LLVM IR (-O0):
define void @silent_printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @silent_printf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ go();
scalar_t__ waiting(int volatile *);
int main(int argc, char **argv) {
  volatile int a = 0;
  while (waiting(&a) == 0)
    continue;
  (void)fork();
  (void)go();
  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)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <waiting@plt>
cmp    $0x0,%rax
jne    1165 <main+0x35>
jmp    114d <main+0x1d>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1030 <go@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <waiting@plt>
test   %rax,%rax
je     1150 <main+0x20>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1030 <go@plt>
xor    %eax,%eax
add    $0x10,%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 i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 0, i32* %6
br label %7
7: ; preds = %10, %2
%8 = call i64 @waiting(i32* %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %7
11: ; preds = %7
%12 = call i32 (...) @fork()
%13 = call i32 (...) @go()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
br label %5
5: ; preds = %5, %2
%6 = call i64 @waiting(i32* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
%9 = call i32 (...) @fork()
%10 = call i32 (...) @go()
ret i32 0
}
void WF_TimerInit() {}


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

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

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

LLVM IR (-O2):
define void @WF_TimerInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m, d, f;
  scanf("%d", &m);
  d = m * m;
  f = m * m * m;
  printf("\n %d\n", d);
  printf("\n %d\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"\0A %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"\0A %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%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 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ukvm_x86_mem_size(size_t *);
void ukvm_hv_mem_size(size_t *mem_size) { ukvm_x86_mem_size(mem_size); }


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

x86 assembly (clang, -O2):
<ukvm_hv_mem_size>:
jmp    1030 <ukvm_x86_mem_size@plt>

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

LLVM IR (-O2):
define void @ukvm_hv_mem_size(i64* %0) {
%2 = tail call i32 @ukvm_x86_mem_size(i64* %0)
ret void
}
int rounding(int n) {
  if ((n % 6) / 3 == 0)
    return n / 6;
  else
    return (n / 6) + 1;
}


x86 assembly (clang, -O0):
<rounding>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    1138 <rounding+0x38>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1149 <rounding+0x49>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounding>:
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %edi,%ecx
add    $0xfffffffd,%ecx
cmp    $0xfffffffb,%ecx
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @rounding(i32 %0) {
%2 = srem i32 %0, 6
%3 = add nsw i32 %2, -3
%4 = icmp ult i32 %3, -5
%5 = sdiv i32 %0, 6
%6 = zext i1 %4 to i32
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log2(int);
scalar_t__ pow(int, int);
int next_power_of_2(int a) { return (int)pow(2, (int)ceil(log2(a))); }


x86 assembly (clang, -O0):
<next_power_of_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    %eax,%esi
mov    $0x2,%edi
call   1050 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_2>:
push   %rax
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    $0x2,%edi
mov    %eax,%esi
pop    %rax
jmp    1050 <pow@plt>

LLVM IR (-O0):
define i32 @next_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log2(i32 %3)
%5 = call i64 @ceil(i32 %4)
%6 = trunc i64 %5 to i32
%7 = call i64 @pow(i32 2, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @next_power_of_2(i32 %0) {
%2 = tail call i32 @log2(i32 %0)
%3 = tail call i64 @ceil(i32 %2)
%4 = trunc i64 %3 to i32
%5 = tail call i64 @pow(i32 2, i32 %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void swapIntegerElements(int array[], int p1, int p2) {
  int tmp;
  tmp = array[p1];
  array[p1] = array[p2];
  array[p2] = tmp;
}


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

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

LLVM IR (-O0):
define void @swapIntegerElements(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swapIntegerElements(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ solve(int *, int /*<<< orphan*/, int **);
int /*<<< orphan*/ zeroIt(int **);
int main() {
  int chess[8][8];
  zeroIt(chess);
  int a[8];
  solve(a, 0, chess);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <zeroIt@plt>
lea    -0x130(%rbp),%rdi
lea    -0x110(%rbp),%rdx
xor    %esi,%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x120,%rsp
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <zeroIt@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x [8 x i32]]
%3 = alloca [8 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 0, i64 0
%5 = bitcast [8 x i32]* %4 to i32**
%6 = call i32 @zeroIt(i32** %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 0, i64 0
%9 = bitcast [8 x i32]* %8 to i32**
%10 = call i32 @solve(i32* %7, i32 0, i32** %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = alloca [8 x i32]
%3 = bitcast [8 x [8 x i32]]* %1 to i8*
%4 = bitcast [8 x [8 x i32]]* %1 to i32**
%5 = call i32 @zeroIt(i32** %4)
%6 = bitcast [8 x i32]* %2 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%8 = call i32 @solve(i32* %7, i32 0, i32** %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ __gen_tempname(char *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
char *mktemp(char *template) {
  if (__gen_tempname(template, 3, 0, 0, 0) < 0)
    template[0] = '\0';
  return template;
}


x86 assembly (clang, -O0):
<mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <__gen_tempname@plt>
cmp    $0x0,%rax
jge    1144 <mktemp+0x34>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktemp>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <__gen_tempname@plt>
test   %rax,%rax
jns    112d <mktemp+0x1d>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mktemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @__gen_tempname(i8* %3, i32 3, i32 0, i32 0, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @mktemp(i8* returned %0) {
%2 = tail call i64 @__gen_tempname(i8* %0, i32 3, i32 0, i32 0, i32 0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 0, i8* %0
br label %5
5: ; preds = %4, %1
ret i8* %0
}
void RasterMSBDataOrderSelect(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x28)))) |= (0x00000100u);
}


x86 assembly (clang, -O0):
<RasterMSBDataOrderSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterMSBDataOrderSelect>:
add    $0x28,%edi
orl    $0x100,(%rdi)
ret

LLVM IR (-O0):
define void @RasterMSBDataOrderSelect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 40
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 256
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterMSBDataOrderSelect(i32 %0) {
%2 = add i32 %0, 40
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 256
store volatile i32 %6, i32* %4
ret void
}
void hash_no_destroy_value(void *string) { ((string) = (string)); }


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

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

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

LLVM IR (-O2):
define void @hash_no_destroy_value(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
char *safe_strdup(const char *str) {
  char *new_str = strdup(str);
  if (new_str == NULL) {
    fprintf(stderr, "ERROR: MALLOC FAILURE!\n");
    exit(1);
  }
  return new_str;
}


x86 assembly (clang, -O0):
<safe_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <safe_strdup+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <safe_strdup+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"ERROR: MALLOC FAILURE!\0A\00"
define i8* @safe_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"ERROR: MALLOC FAILURE!\0A\00"
define noalias i8* @safe_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
long long hDoubleToLongBits(double);
int hIsNeg(double d) { return hDoubleToLongBits(d) < 0ll; }


x86 assembly (clang, -O0):
<hIsNeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <hDoubleToLongBits@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hIsNeg>:
push   %rax
call   1030 <hDoubleToLongBits@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hIsNeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @hDoubleToLongBits(double %3)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hIsNeg(double %0) {
%2 = tail call i64 @hDoubleToLongBits(double %0)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct song_node {
  int dummy;
};

/* Variables and functions */
struct song_node *find_element_song(char *, char *);
struct song_node *find_song(char *song_name, char *song_artist) {
  return find_element_song(song_name, song_artist);
}


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

x86 assembly (clang, -O2):
<find_song>:
jmp    1030 <find_element_song@plt>

LLVM IR (-O0):
%struct.song_node = type { i32 }
define %struct.song_node* @find_song(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call %struct.song_node* @find_element_song(i8* %5, i8* %6)
ret %struct.song_node* %7
}

LLVM IR (-O2):
%struct.song_node = type { i32 }
define %struct.song_node* @find_song(i8* %0, i8* %1) {
%3 = tail call %struct.song_node* @find_element_song(i8* %0, i8* %1)
ret %struct.song_node* %3
}
void ECDSA_sign_ex(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @yyaccpt() {
ret i32 undef
}
void UARTCharPut(unsigned long ulBase, unsigned char ucData) {
  ;
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) & 0x00000020) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ucData;
}


x86 assembly (clang, -O0):
<UARTCharPut>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
je     1129 <UARTCharPut+0x29>
jmp    110e <UARTCharPut+0xe>
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPut>:
testq  $0x20,0x18(%rdi)
jne    1100 <UARTCharPut>
movzbl %sil,%eax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @UARTCharPut(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
br label %5
5: ; preds = %12, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 32
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
%14 = load i8, i8* %4
%15 = zext i8 %14 to i64
%16 = load i64, i64* %3
%17 = add i64 %16, 0
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @UARTCharPut(i64 %0, i8 zeroext %1) {
%3 = add i64 %0, 24
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 32
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = zext i8 %1 to i64
%11 = inttoptr i64 %0 to i64*
store volatile i64 %10, i64* %11
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void AVRCP_ResponseSink_ConnectionManager_GetProtocolInfo(
    struct UPnPService *Service, int ErrorCode, void *User, char *Source,
    char *Sink) {
  printf("AVRCP_ Invoke Response: "
         "ConnectionManager/GetProtocolInfo[ErrorCode:%d](%s,%s)\r\n",
         ErrorCode, Source, Sink);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_ConnectionManager_GetProtocolInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AVRCP_ResponseSink_ConnectionManager_GetProtocolInfo>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [81 x i8] c"AVRCP_ Invoke Response: ConnectionManager/GetProtocolInfo[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @AVRCP_ResponseSink_ConnectionManager_GetProtocolInfo(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca %struct.UPnPService*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = load i8*, i8** %9
%13 = load i8*, i8** %10
%14 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [81 x i8] c"AVRCP_ Invoke Response: ConnectionManager/GetProtocolInfo[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @AVRCP_ResponseSink_ConnectionManager_GetProtocolInfo(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(char);
void convertToUppercase(char *sPtr) {
  while (*sPtr != '\0') {
    if (islower(*sPtr)) {
      *sPtr = toupper(*sPtr);
    }
    ++sPtr;
  }
}


x86 assembly (clang, -O0):
<convertToUppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <convertToUppercase+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1166 <convertToUppercase+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <convertToUppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertToUppercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <convertToUppercase+0x35>
mov    %rdi,%rbx
jmp    113c <convertToUppercase+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <convertToUppercase+0x35>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1130 <convertToUppercase+0x10>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1130 <convertToUppercase+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @convertToUppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %18, %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 %21
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @islower(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = call signext i8 @toupper(i8 signext %15)
%17 = load i8*, i8** %2
store i8 %16, i8* %17
br label %18
18: ; preds = %13, %8
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %3
21: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @convertToUppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @islower(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Variables and functions */
scalar_t__ get_interval(double *, int const, double);
int test3() {
  const int nt = 3;
  double t[] = {0.0, 1.0, 2.0};
  double treq = 0.9;
  int i = -2;
  i = (int)get_interval(t, nt, treq);
  return (i == 0);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x3,-0x4(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x10(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0xfffffffe,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
mov    $0x3,%esi
call   1030 <get_interval@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
sub    $0x18,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
movsd  0xeca(%rip),%xmm0
mov    $0x3,%esi
call   1030 <get_interval@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test3.t = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00]
define i32 @test3() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = alloca double
%4 = alloca i32
store i32 3, i32* %1
%5 = bitcast [3 x double]* %2 to i8*
store double 9.000000e-01, double* %3
store i32 -2, i32* %4
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%7 = load double, double* %3
%8 = call i64 @get_interval(double* %6, i32 3, double %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test3.t = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00]
define i32 @test3() {
%1 = alloca [3 x double]
%2 = bitcast [3 x double]* %1 to i8*
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%4 = call i64 @get_interval(double* %3, i32 3, double 9.000000e-01)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int f1(int);
int test1(int x) { return f1(x); }


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

x86 assembly (clang, -O2):
<test1>:
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = tail call i32 @f1(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int builtin_help(char *const *argv) {
  printf("SHELL HELP\n"
         "\n"
         "Type commands at the prompt and press ENTER to execute them\n"
         "\n"
         "Appending '&' to a command will run it in the background.\n"
         "Pressing Ctrl-Z while running a command will place it in the "
         "background.\n"
         "\n"
         "Built-in commands:\n"
         "cd [dir]      change current working directory to dir\n"
         "exit          quit shell\n"
         "fg job        run job in foreground\n"
         "jobs          list background jobs\n"
         "history       list recently-typed commands\n"
         "r [cmd]       run recently-typed command beginning with cmd\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [478 x i8] c"SHELL HELP\0A\0AType commands at the prompt and press ENTER to execute them\0A\0AAppending '&' to a command will run it in the background.\0APressing Ctrl-Z while running a command will place it in the background.\0A\0ABuilt-in commands:\0Acd [dir] change current working directory to dir\0Aexit quit shell\0Afg job run job in foreground\0Ajobs list background jobs\0Ahistory list recently-typed commands\0Ar [cmd] run recently-typed command beginning with cmd\0A\00"
define i32 @builtin_help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([478 x i8], [478 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [477 x i8] c"SHELL HELP\0A\0AType commands at the prompt and press ENTER to execute them\0A\0AAppending '&' to a command will run it in the background.\0APressing Ctrl-Z while running a command will place it in the background.\0A\0ABuilt-in commands:\0Acd [dir] change current working directory to dir\0Aexit quit shell\0Afg job run job in foreground\0Ajobs list background jobs\0Ahistory list recently-typed commands\0Ar [cmd] run recently-typed command beginning with cmd\00"
define i32 @builtin_help(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([477 x i8], [477 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ht1632_chipselect(unsigned char);
int /*<<< orphan*/ ht1632_writebits(unsigned char, int);
void ht1632_senddata(unsigned char chipNo, unsigned char address,
                     unsigned char data) {
  ht1632_chipselect(chipNo);
  ht1632_writebits(5, 1 << 2);
  ht1632_writebits(address, 1 << 6);
  ht1632_writebits(data, 1 << 3);
  ht1632_chipselect(0);
}


x86 assembly (clang, -O0):
<ht1632_senddata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <ht1632_chipselect@plt>
mov    $0x5,%edi
mov    $0x4,%esi
call   1040 <ht1632_writebits@plt>
mov    $0x40,%esi
movzbl -0x2(%rbp),%edi
call   1040 <ht1632_writebits@plt>
mov    $0x8,%esi
movzbl -0x3(%rbp),%edi
call   1040 <ht1632_writebits@plt>
xor    %edi,%edi
call   1030 <ht1632_chipselect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht1632_senddata>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <ht1632_chipselect@plt>
mov    $0x5,%edi
mov    $0x4,%esi
call   1040 <ht1632_writebits@plt>
mov    %ebp,%edi
mov    $0x40,%esi
call   1040 <ht1632_writebits@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1040 <ht1632_writebits@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ht1632_chipselect@plt>

LLVM IR (-O0):
define void @ht1632_senddata(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = call i32 @ht1632_chipselect(i8 zeroext %7)
%9 = call i32 @ht1632_writebits(i8 zeroext 5, i32 4)
%10 = load i8, i8* %5
%11 = call i32 @ht1632_writebits(i8 zeroext %10, i32 64)
%12 = load i8, i8* %6
%13 = call i32 @ht1632_writebits(i8 zeroext %12, i32 8)
%14 = call i32 @ht1632_chipselect(i8 zeroext 0)
ret void
}

LLVM IR (-O2):
define void @ht1632_senddata(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @ht1632_chipselect(i8 zeroext %0)
%5 = tail call i32 @ht1632_writebits(i8 zeroext 5, i32 4)
%6 = tail call i32 @ht1632_writebits(i8 zeroext %1, i32 64)
%7 = tail call i32 @ht1632_writebits(i8 zeroext %2, i32 8)
%8 = tail call i32 @ht1632_chipselect(i8 zeroext 0)
ret void
}
/* Variables and functions */
int getNoOfWinsP1();
int getNoOfWinsP2();
int /*<<< orphan*/ printCharXY(int, int, int);
void printWins() {
  int wp1 = getNoOfWinsP1() % 10;
  printCharXY(wp1 + 48, 57, 12);
  int wp2 = getNoOfWinsP2() % 10;
  printCharXY(wp2 + 48, 22, 12);
}


x86 assembly (clang, -O0):
<printWins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getNoOfWinsP1@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x30,%edi
mov    $0x39,%esi
mov    $0xc,%edx
call   1030 <printCharXY@plt>
mov    $0x0,%al
call   1040 <getNoOfWinsP2@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%edi
add    $0x30,%edi
mov    $0x16,%esi
mov    $0xc,%edx
call   1030 <printCharXY@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printWins>:
push   %rax
xor    %eax,%eax
call   1050 <getNoOfWinsP1@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x30,%edi
mov    $0x39,%esi
mov    $0xc,%edx
call   1030 <printCharXY@plt>
xor    %eax,%eax
call   1040 <getNoOfWinsP2@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x30,%edi
mov    $0x16,%esi
mov    $0xc,%edx
pop    %rax
jmp    1030 <printCharXY@plt>

LLVM IR (-O0):
define void @printWins() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getNoOfWinsP1()
%4 = srem i32 %3, 10
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 48
%7 = call i32 @printCharXY(i32 %6, i32 57, i32 12)
%8 = call i32 (...) @getNoOfWinsP2()
%9 = srem i32 %8, 10
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 48
%12 = call i32 @printCharXY(i32 %11, i32 22, i32 12)
ret void
}

LLVM IR (-O2):
define void @printWins() {
%1 = tail call i32 (...) @getNoOfWinsP1()
%2 = srem i32 %1, 10
%3 = add nsw i32 %2, 48
%4 = tail call i32 @printCharXY(i32 %3, i32 57, i32 12)
%5 = tail call i32 (...) @getNoOfWinsP2()
%6 = srem i32 %5, 10
%7 = add nsw i32 %6, 48
%8 = tail call i32 @printCharXY(i32 %7, i32 22, i32 12)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  unsigned long long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t realtime_now() {
  struct timespec now;
  clock_gettime(CLOCK_REALTIME, &now);
  return ((&now)->tv_sec * 1000000000ULL + (&now)->tv_nsec);
}


x86 assembly (clang, -O0):
<realtime_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realtime_now>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @realtime_now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @realtime_now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}
int f_int() { return 2; }


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

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

LLVM IR (-O0):
define i32 @f_int() {
ret i32 2
}

LLVM IR (-O2):
define i32 @f_int() {
ret i32 2
}
/* Variables and functions */
unsigned int UINT_MAX;
int add_uint_overflows(unsigned int a, unsigned int b) {
  return (b > UINT_MAX - a);
}


x86 assembly (clang, -O0):
<add_uint_overflows>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed4(%rip),%rcx
mov    (%rcx),%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_uint_overflows>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
sub    %edi,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
setb   %al
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @add_uint_overflows(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @UINT_MAX
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = icmp ugt i32 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @add_uint_overflows(i32 %0, i32 %1) {
%3 = load i32, i32* @UINT_MAX
%4 = sub i32 %3, %0
%5 = icmp ult i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char const *getenv(char const *);
const char *env_get(const char name[]) { return getenv(name); }


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

x86 assembly (clang, -O2):
<env_get>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @env_get(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
void ff_hevc_put_hevc_epel_hv24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv24_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x06() {
  Assert_real((isalpha(6) == 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_isalpha.c",
              35, ("isalpha should be 0 for 0x06"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x06>:
push   %rax
mov    $0x6,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x06\00"
define void @t_isalpha_0x06() {
%1 = call i64 @isalpha(i32 6)
%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 35, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x06\00"
define void @t_isalpha_0x06() {
%1 = tail call i64 @isalpha(i32 6)
%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 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fsqrt() {
  put8(0xD9);
  put8(0xFA);
}


x86 assembly (clang, -O0):
<fsqrt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xfa,%edi
call   1030 <put8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsqrt>:
push   %rax
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xfa,%edi
pop    %rax
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fsqrt() {
%1 = call i32 @put8(i32 217)
%2 = call i32 @put8(i32 250)
ret void
}

LLVM IR (-O2):
define void @fsqrt() {
%1 = tail call i32 @put8(i32 217)
%2 = tail call i32 @put8(i32 250)
ret void
}