xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("this process will exit\n");
  exit(0);
  printf("never be excuted\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"this process will exit\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"this process will exit\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ func(int);
int /*<<< orphan*/ printf(char *);
int main() {
  if (func(10))
    printf("OK");
  else
    printf("ERROR");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <func@plt>
cmp    $0x0,%rax
je     1154 <main+0x34>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <func@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [6 x i8] c"ERROR\00"
define i32 @main() {
%1 = tail call i64 @func(i32 10)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(3, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_start_system_to_container>:
mov    $0x3,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 3, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void g_spawn_command_line_async() {}


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

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

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

LLVM IR (-O2):
define void @g_spawn_command_line_async() {
ret void
}
/* Variables and functions */
int MatchString(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int MatchExe(char *exe, char *pattern) {
  if (pattern[0] == '/') {
    return !strcmp(exe, pattern);
  } else
    return (MatchString(exe, pattern));
}


x86 assembly (clang, -O0):
<MatchExe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1162 <MatchExe+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <MatchExe+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <MatchString@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatchExe>:
push   %rax
cmpb   $0x2f,(%rsi)
jne    1136 <MatchExe+0x16>
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret
pop    %rax
jmp    1030 <MatchString@plt>

LLVM IR (-O0):
define i32 @MatchExe(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 @strcmp(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %22
18: ; preds = %2
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i32 @MatchString(i8* %19, i8* %20)
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @MatchExe(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 47
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %11
9: ; preds = %2
%10 = tail call i32 @MatchString(i8* %0, i8* %1)
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %8, %5 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ sleep(int);
void main() {
  while (1) {
    foo();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1129 <main+0x9>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @foo()
%3 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @foo()
%3 = tail call i32 @sleep(i32 1)
br label %1
}
unsigned hash(char *v) {
  int h;
  for (h = 0; *v != '\0'; v++)
    h = (64 * h + *v) % 801;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0xc(%rbp),%eax
shl    $0x6,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    $0x321,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1142 <hash+0x42>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
shl    $0x6,%eax
add    %ecx,%eax
cltq
imul   $0x51d1569d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x28,%rcx
add    %edx,%ecx
imul   $0x321,%ecx,%ecx
sub    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i32, i32* %3
%11 = mul nsw i32 64, %10
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %11, %14
%16 = srem i32 %15, 801
store i32 %16, i32* %3
br label %17
17: ; preds = %9
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %4
20: ; preds = %4
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = shl nsw i32 %6, 6
%10 = add nsw i32 %9, %8
%11 = srem i32 %10, 801
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int STDERR_FILENO;
int STDIN_FILENO;
int STDOUT_FILENO;
int /*<<< orphan*/ errno;
int _isatty(int file) {
  if ((file == STDIN_FILENO) || (file == STDOUT_FILENO) ||
      (file == STDERR_FILENO)) {
    return 1;
  } else {
    errno = EBADF;
    return -1;
  }
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     113d <_isatty+0x3d>
mov    -0x8(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
je     113d <_isatty+0x3d>
mov    -0x8(%rbp),%eax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%eax
jne    1149 <_isatty+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1162 <_isatty+0x62>
mov    0x2e78(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7f(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
mov    0x2eb9(%rip),%rcx
mov    $0x1,%eax
cmp    %edi,(%rcx)
je     113d <_isatty+0x3d>
mov    0x2ed9(%rip),%rcx
cmp    %edi,(%rcx)
je     113d <_isatty+0x3d>
mov    0x2eae(%rip),%rcx
cmp    %edi,(%rcx)
je     113d <_isatty+0x3d>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    0x2ea2(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define i32 @_isatty(i32 %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @STDOUT_FILENO
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32, i32* @STDERR_FILENO
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = load i32, i32* @EBADF
store i32 %11, i32* @errno
br label %12
12: ; preds = %1, %10
%13 = phi i32 [ -1, %10 ], [ 1, %1 ]
ret i32 %13
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("\n");
  {
    int id = omp_get_thread_num();
    int numThreads = omp_get_num_threads();
    printf("Hello from thread %d of %d\n", id, numThreads);
  }
  printf("\n");
  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    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <omp_get_num_threads@plt>
lea    0xe9e(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Hello from thread %d of %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @omp_get_thread_num()
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
unsigned long long ulldiv(unsigned long long a, unsigned long long b) {
  return a / b;
}


x86 assembly (clang, -O0):
<ulldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ulldiv+0x15>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @ulldiv(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 = udiv i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @ulldiv(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
ret i64 %3
}
int mySqrt1(int x) {
  if (x == 0) {
    return 0;
  }
  double res = 1;
  double last = 0;
  while (res != last) {
    last = res;
    res = (res + x / res) / 2;
  }
  return (int)res;
}


x86 assembly (clang, -O0):
<mySqrt1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <mySqrt1+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1188 <mySqrt1+0x88>
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    114d <mySqrt1+0x4d>
jp     114d <mySqrt1+0x4d>
jmp    1180 <mySqrt1+0x80>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe96(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1132 <mySqrt1+0x32>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mySqrt1>:
test   %edi,%edi
je     1141 <mySqrt1+0x41>
cvtsi2sd %edi,%xmm0
movsd  0xef0(%rip),%xmm1
movsd  0xef0(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
movapd %xmm1,%xmm3
movapd %xmm0,%xmm1
divsd  %xmm3,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm3,%xmm1
jne    1120 <mySqrt1+0x20>
jp     1120 <mySqrt1+0x20>
cvttsd2si %xmm1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mySqrt1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %26
9: ; preds = %1
store double 1.000000e+00, double* %4
store double 0.000000e+00, double* %5
br label %10
10: ; preds = %14, %9
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fcmp une double %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load double, double* %4
store double %15, double* %5
%16 = load double, double* %4
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = load double, double* %4
%20 = fdiv double %18, %19
%21 = fadd double %16, %20
%22 = fdiv double %21, 2.000000e+00
store double %22, double* %4
br label %10
23: ; preds = %10
%24 = load double, double* %4
%25 = fptosi double %24 to i32
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %8
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @mySqrt1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to double
br label %5
5: ; preds = %3, %5
%6 = phi double [ 1.000000e+00, %3 ], [ %9, %5 ]
%7 = fdiv double %4, %6
%8 = fadd double %6, %7
%9 = fmul double %8, 5.000000e-01
%10 = fcmp une double %9, %6
br i1 %10, label %5, label %11
11: ; preds = %5
%12 = fptosi double %9 to i32
br label %13
13: ; preds = %1, %11
%14 = phi i32 [ %12, %11 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void n_free(void *ptr, const int lineno, const char *file) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<n_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <n_free+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_free>:
test   %rdi,%rdi
je     111a <n_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @n_free(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int not_in_ldconfig(int);
int where_is_it(int par) { return not_in_ldconfig(par) + 2018; }


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

x86 assembly (clang, -O2):
<where_is_it>:
push   %rax
call   1030 <not_in_ldconfig@plt>
add    $0x7e2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @where_is_it(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @not_in_ldconfig(i32 %3)
%5 = add nsw i32 %4, 2018
ret i32 %5
}

LLVM IR (-O2):
define i32 @where_is_it(i32 %0) {
%2 = tail call i32 @not_in_ldconfig(i32 %0)
%3 = add nsw i32 %2, 2018
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ YM2612_writeSafe(int, int);
void YM2612_disableDAC() {
  YM2612_writeSafe(0, 0x2B);
  YM2612_writeSafe(1, 0x00);
}


x86 assembly (clang, -O0):
<YM2612_disableDAC>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2b,%esi
call   1030 <YM2612_writeSafe@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <YM2612_writeSafe@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<YM2612_disableDAC>:
push   %rax
xor    %edi,%edi
mov    $0x2b,%esi
call   1030 <YM2612_writeSafe@plt>
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <YM2612_writeSafe@plt>

LLVM IR (-O0):
define void @YM2612_disableDAC() {
%1 = call i32 @YM2612_writeSafe(i32 0, i32 43)
%2 = call i32 @YM2612_writeSafe(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @YM2612_disableDAC() {
%1 = tail call i32 @YM2612_writeSafe(i32 0, i32 43)
%2 = tail call i32 @YM2612_writeSafe(i32 1, i32 0)
ret void
}
void RTProcIsRunningByName(void) {}


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

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

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

LLVM IR (-O2):
define void @RTProcIsRunningByName() {
ret void
}
int condition_t(char c) { return c == 't'; }


x86 assembly (clang, -O0):
<condition_t>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x74,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_t>:
xor    %eax,%eax
cmp    $0x74,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_t(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 116
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_t(i8 signext %0) {
%2 = icmp eq i8 %0, 116
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *copyValue(const char *value) {
  if (value == NULL) {
    return NULL;
  } else {
    size_t len = strlen(value);
    char *newValue = malloc(sizeof(char) * (len + 1));
    strcpy(newValue, value);
    return newValue;
  }
}


x86 assembly (clang, -O0):
<copyValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <copyValue+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118d <copyValue+0x5d>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyValue>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1159 <copyValue+0x29>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115c <copyValue+0x2c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copyValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %21
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = mul i64 1, %13
%15 = trunc i64 %14 to i32
%16 = call i8* @malloc(i32 %15)
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %5
store i8* %20, i8** %2
br label %21
21: ; preds = %9, %8
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @copyValue(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = tail call i8* @malloc(i32 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ stderr;
int jit_fail(const char *msg, const char *file, int line,
             const char *function) {
  fprintf(stderr, "%s: In function `%s':\n", file, function);
  fprintf(stderr, "%s:%d: %s\n", file, line, msg);
  abort();
}


x86 assembly (clang, -O0):
<jit_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<jit_fail>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x2ea9(%rip),%r15
mov    (%r15),%edi
lea    0xebf(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
lea    0xec2(%rip),%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
mov    %rbp,%r8
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"%s: In function `%s':\0A\00"
@.str.1 = [11 x i8] c"%s:%d: %s\0A\00"
define i32 @jit_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %5
%17 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 %15, i8* %16)
%18 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"%s: In function `%s':\0A\00"
@.str.1 = [11 x i8] c"%s:%d: %s\0A\00"
define i32 @jit_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%9 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x6f() {
  Assert_real((isalnum(111)),
              "/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_isalnum.c",
              560, ("isalnum should be 1 for o"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x6f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6f,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x230,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x6f>:
push   %rax
mov    $0x6f,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x230,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for o\00"
define void @t_isalnum_0x6f() {
%1 = call i32 @isalnum(i32 111)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for o\00"
define void @t_isalnum_0x6f() {
%1 = tail call i32 @isalnum(i32 111)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void hdl_error(int rtn) {
  if (0 > rtn) {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<hdl_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jle    1134 <hdl_error+0x24>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdl_error>:
test   %edi,%edi
js     1115 <hdl_error+0x5>
ret
push   %rax
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @hdl_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 0, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @hdl_error(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %1
ret void
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_CurRgn_adjust_all(struct Cyc_List_List *);
int Cyc_do_adjust(int ignore, struct Cyc_List_List *tds) {
  Cyc_CurRgn_adjust_all(tds);
  return 1;
}


x86 assembly (clang, -O0):
<Cyc_do_adjust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_CurRgn_adjust_all@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_do_adjust>:
push   %rax
mov    %rsi,%rdi
call   1030 <Cyc_CurRgn_adjust_all@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_do_adjust(i32 %0, %struct.Cyc_List_List* %1) {
%3 = alloca i32
%4 = alloca %struct.Cyc_List_List*
store i32 %0, i32* %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%5 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%6 = call i32 @Cyc_CurRgn_adjust_all(%struct.Cyc_List_List* %5)
ret i32 1
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_do_adjust(i32 %0, %struct.Cyc_List_List* %1) {
%3 = tail call i32 @Cyc_CurRgn_adjust_all(%struct.Cyc_List_List* %1)
ret i32 1
}
int func(int a) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
ret i32 1
}
int absVal(int x) {
  int sign = x >> 31 & 0x1;
  int mask = ~sign + 1;
  return ((~x + 1) & mask) | (x & ~mask);
}


x86 assembly (clang, -O0):
<absVal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
and    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absVal>:
mov    %edi,%eax
neg    %eax
mov    %edi,%ecx
sar    $0x1f,%ecx
and    %eax,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @absVal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 31
%7 = and i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = xor i32 %8, -1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = xor i32 %11, -1
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %4
%15 = and i32 %13, %14
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @absVal(i32 %0) {
%2 = sub i32 0, %0
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 %2, i32 0
%5 = icmp sgt i32 %0, 0
%6 = select i1 %5, i32 %0, i32 0
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int insert(int, int, int, int);
int insert2(int, int, int, int);
int test_overlap() {
  int n = 0b10010000;
  int m = 0b00000101;
  return 0b10010100 == insert(n, m, 4, 2) && 0b10010100 == insert2(n, m, 4, 2);
}


x86 assembly (clang, -O0):
<test_overlap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x90,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1040 <insert@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x94,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jne    1183 <test_overlap+0x63>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <insert2@plt>
mov    %eax,%ecx
mov    $0x94,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_overlap>:
push   %rax
mov    $0x90,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1040 <insert@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x94,%ecx
jne    116c <test_overlap+0x4c>
mov    $0x90,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <insert2@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x94,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_overlap() {
%1 = alloca i32
%2 = alloca i32
store i32 144, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @insert(i32 %3, i32 %4, i32 4, i32 2)
%6 = icmp eq i32 148, %5
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @insert2(i32 %8, i32 %9, i32 4, i32 2)
%11 = icmp eq i32 148, %10
br label %12
12: ; preds = %7, %0
%13 = phi i1 [ false, %0 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_overlap() {
%1 = tail call i32 @insert(i32 144, i32 5, i32 4, i32 2)
%2 = icmp eq i32 %1, 148
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @insert2(i32 144, i32 5, i32 4, i32 2)
%5 = icmp eq i32 %4, 148
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int syscall(int, char const *, unsigned int, char *, unsigned int);
int kifs(const char *entry_name, unsigned int op_mode, char *user_buffer,
         unsigned int maxchars) {
  return syscall(307, entry_name, op_mode, user_buffer, maxchars);
}


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

x86 assembly (clang, -O2):
<kifs>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x133,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @kifs(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @syscall(i32 307, i8* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void show(int *address, int limit) {
  for (int i = 0; i < limit; i++) {
    printf("Get the value %d for %d .\n", i, address[i]);
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <show+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <show+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <show+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <show+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"Get the value %d for %d .\0A\00"
define void @show(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
scalar_t__ malloc(int);
void getMemory(char *p) { p = (char *)malloc(100); }


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

x86 assembly (clang, -O2):
<getMemory>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @getMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret void
}

LLVM IR (-O2):
define void @getMemory(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M_Menu_Keys_f();
void CustomizeControlsFunc(void *unused) { M_Menu_Keys_f(); }


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

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

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

LLVM IR (-O2):
define void @CustomizeControlsFunc(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @M_Menu_Keys_f()
ret void
}
int isDigit(char ch) { return (ch <= '9' && ch >= '0'); }


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jg     1129 <isDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
setge  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ bit_diff(int, int);
int test_no_diff() { return 0 == bit_diff(0b01010, 0b01010); }


x86 assembly (clang, -O0):
<test_no_diff>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%esi
mov    %esi,%edi
call   1030 <bit_diff@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_diff>:
push   %rax
mov    $0xa,%edi
mov    $0xa,%esi
call   1030 <bit_diff@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_no_diff() {
%1 = call i64 @bit_diff(i32 10, i32 10)
%2 = icmp eq i64 0, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_no_diff() {
%1 = tail call i64 @bit_diff(i32 10, i32 10)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int adt_cmpsp(const char *const *a, const char *const *b) {
  return strcmp(*a, *b);
}


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

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

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

LLVM IR (-O2):
define i32 @adt_cmpsp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_dbc_history(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_dbc_history>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_dbc_history(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_dbc_history(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
struct _RegionHandle {
  int dummy;
};

/* Variables and functions */
int region_get_heap_size(struct _RegionHandle *);
int region_used_bytes(struct _RegionHandle *r) {
  return region_get_heap_size(r);
}


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

x86 assembly (clang, -O2):
<region_used_bytes>:
jmp    1030 <region_get_heap_size@plt>

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

LLVM IR (-O2):
%struct._RegionHandle = type { i32 }
define i32 @region_used_bytes(%struct._RegionHandle* %0) {
%2 = tail call i32 @region_get_heap_size(%struct._RegionHandle* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ emit_writeword_indexed_tlb(int, int, int, int);
void emit_writedword_indexed_tlb(int rh, int rl, int addr, int rs, int map) {
  assert(rh >= 0);
  emit_writeword_indexed_tlb(rh, addr, rs, map);
  emit_writeword_indexed_tlb(rl, addr + 4, rs, map);
}


x86 assembly (clang, -O0):
<emit_writedword_indexed_tlb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <emit_writeword_indexed_tlb@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
add    $0x4,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <emit_writeword_indexed_tlb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_writedword_indexed_tlb>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r12d
mov    %edx,%ebx
mov    %esi,%r15d
mov    %edi,%ebp
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1040 <emit_writeword_indexed_tlb@plt>
add    $0x4,%ebx
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <emit_writeword_indexed_tlb@plt>

LLVM IR (-O0):
define void @emit_writedword_indexed_tlb(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %6
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @emit_writeword_indexed_tlb(i32 %15, i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 4
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = call i32 @emit_writeword_indexed_tlb(i32 %20, i32 %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @emit_writedword_indexed_tlb(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = xor i32 %0, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @emit_writeword_indexed_tlb(i32 %0, i32 %2, i32 %3, i32 %4)
%10 = add nsw i32 %2, 4
%11 = tail call i32 @emit_writeword_indexed_tlb(i32 %1, i32 %10, i32 %3, i32 %4)
ret void
}