xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ endswap_int64_t_copy(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ const *, int);
void endswap_double_copy(double *dest, const double *src, int len) {
  endswap_int64_t_copy((int64_t *)dest, (const int64_t *)src, len);
}


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

x86 assembly (clang, -O2):
<endswap_double_copy>:
jmp    1030 <endswap_int64_t_copy@plt>

LLVM IR (-O0):
define void @endswap_double_copy(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = bitcast double* %7 to i32*
%9 = load double*, double** %5
%10 = bitcast double* %9 to i32*
%11 = load i32, i32* %6
%12 = call i32 @endswap_int64_t_copy(i32* %8, i32* %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @endswap_double_copy(double* %0, double* %1, i32 %2) {
%4 = bitcast double* %0 to i32*
%5 = bitcast double* %1 to i32*
%6 = tail call i32 @endswap_int64_t_copy(i32* %4, i32* %5, i32 %2)
ret void
}
void foo728(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo728(i32 %0) {
ret void
}
int findGcd(int a, int b) {
  int r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<findGcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <findGcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <findGcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findGcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <findGcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <findGcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findGcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           size_t);
int /*<<< orphan*/ stderr;
void __xalloc_failed(const char *file, int line, size_t size) {
  fprintf(stderr, "%s:%d: Failed to allocate memory block of size %zu\n", file,
          line, size);
  _exit(64);
}


x86 assembly (clang, -O0):
<__xalloc_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x40,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<__xalloc_failed>:
push   %rax
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x40,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"%s:%d: Failed to allocate memory block of size %zu\0A\00"
define void @__xalloc_failed(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i64 %10)
%12 = call i32 @_exit(i32 64)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"%s:%d: Failed to allocate memory block of size %zu\0A\00"
define void @__xalloc_failed(i8* %0, i32 %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i64 %2)
%6 = tail call i32 @_exit(i32 64)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int tfs_validate2(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ utl_str2time(char *);
int tfs_validate(const char *cache_fn, char *last_ddl_time,
                 time_t *actual_time) {
  *actual_time = utl_str2time(last_ddl_time);
  return tfs_validate2(cache_fn, *actual_time);
}


x86 assembly (clang, -O0):
<tfs_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <utl_str2time@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1030 <tfs_validate2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfs_validate>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <utl_str2time@plt>
mov    %eax,(%r14)
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <tfs_validate2@plt>

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

LLVM IR (-O2):
define i32 @tfs_validate(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @utl_str2time(i8* %1)
store i32 %4, i32* %2
%5 = tail call i32 @tfs_validate2(i8* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ palindrome();
int main(int argc, char *argv[]) {
  palindrome();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @palindrome()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @palindrome()
ret i32 0
}
/* Variables and functions */
char *malloc(size_t);
char *strcpy(char *, char const *);
size_t strlen(char const *);
char *strdup(const char *s) {
  size_t len = strlen(s);
  char *buf = malloc((len + 1) * sizeof(char));
  if (!buf) {
    return NULL;
  }
  return strcpy(buf, s);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1176 <strdup+0x46>
movq   $0x0,-0x8(%rbp)
jmp    1187 <strdup+0x57>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(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 = call i64 @strlen(i8* %6)
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = add i64 %8, 1
%10 = mul i64 %9, 1
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %1
store i8* null, i8** %2
br label %19
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = call i8* @strcpy(i8* %16, i8* %17)
store i8* %18, i8** %2
br label %19
19: ; preds = %15, %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Dobredojdovte na FINKI!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Dobredojdovte na FINKI!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Dobredojdovte na FINKI!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ utf8_surrogate_len(char const *);
size_t utf8_strlen(const char *string) {
  const char *ptr = string;
  size_t result = 0;
  while (*ptr) {
    ptr += utf8_surrogate_len(ptr);
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <utf8_strlen+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <utf8_surrogate_len@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <utf8_strlen+0x1c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_strlen>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113a <utf8_strlen+0x2a>
mov    %rdi,%rbx
xor    %r14d,%r14d
nop
mov    %rbx,%rdi
call   1030 <utf8_surrogate_len@plt>
cltq
add    $0x1,%r14
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
jne    1120 <utf8_strlen+0x10>
jmp    113d <utf8_strlen+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @utf8_strlen(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @utf8_surrogate_len(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = add i64 %5, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
/* Variables and functions */
char getchar();
clearIBuffer() {
  char c;
  do {
    c = getchar();
  } while (c != '\n' && c != 'EOF');
}


x86 assembly (clang, -O0):
<clearIBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x6(%rbp)
je     1143 <clearIBuffer+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x454f46,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    1118 <clearIBuffer+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearIBuffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clearIBuffer+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clearIBuffer() {
%1 = alloca i32
%2 = alloca i8
br label %3
3: ; preds = %13, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
br label %5
5: ; preds = %3
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 4542278
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ false, %5 ], [ %12, %9 ]
br i1 %14, label %3, label %15
15: ; preds = %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @clearIBuffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 undef
}
void mac_format_void(void) {}


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

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

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

LLVM IR (-O2):
define void @mac_format_void() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PathDesiredHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void PathDesiredRequestUpdate() { UAVObjRequestUpdate(PathDesiredHandle()); }


x86 assembly (clang, -O0):
<PathDesiredRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PathDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathDesiredRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <PathDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @PathDesiredRequestUpdate() {
%1 = call i32 (...) @PathDesiredHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathDesiredRequestUpdate() {
%1 = tail call i32 (...) @PathDesiredHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void btusb_proc_remove(struct btusb *p_dev, const char *name) {}


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

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

LLVM IR (-O0):
%struct.btusb = type opaque
define void @btusb_proc_remove(%struct.btusb* %0, i8* %1) {
%3 = alloca %struct.btusb*
%4 = alloca i8*
store %struct.btusb* %0, %struct.btusb** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.btusb = type opaque
define void @btusb_proc_remove(%struct.btusb* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ activeContextStackDuplicateTop();
void interpretDuplicateTop(int context) { activeContextStackDuplicateTop(); }


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

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

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

LLVM IR (-O2):
define void @interpretDuplicateTop(i32 %0) {
%2 = tail call i32 (...) @activeContextStackDuplicateTop()
ret void
}
__attribute__((__always___)) void foo(void) {}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matNd_transpose(double *, int);
void mat4d_transpose(double m[16]) { matNd_transpose(m, 4); }


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

x86 assembly (clang, -O2):
<mat4d_transpose>:
mov    $0x4,%esi
jmp    1030 <matNd_transpose@plt>

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

LLVM IR (-O2):
define void @mat4d_transpose(double* %0) {
%2 = tail call i32 @matNd_transpose(double* %0, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int setgroups(int ngroups, const gid_t *gidset) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<setgroups>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setgroups>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setgroups(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setgroups(i32 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
struct pollfd {
  int fd;
  int /*<<< orphan*/ events;
};

/* Variables and functions */
int /*<<< orphan*/ POLLIN;
int poll(struct pollfd *, int, int);
int perf_event_poll(int fd) {
  struct pollfd pfd = {.fd = fd, .events = POLLIN};
  return poll(&pfd, 1, 1000);
}


x86 assembly (clang, -O0):
<perf_event_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1030 <poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_event_poll>:
push   %rax
mov    %edi,(%rsp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1030 <poll@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @perf_event_poll(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.pollfd
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i32 0, i32 0
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i32 0, i32 1
%7 = load i32, i32* @POLLIN
store i32 %7, i32* %6
%8 = call i32 @poll(%struct.pollfd* %3, i32 1, i32 1000)
ret i32 %8
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @perf_event_poll(i32 %0) {
%2 = alloca %struct.pollfd
%3 = bitcast %struct.pollfd* %2 to i8*
%4 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 1
%6 = load i32, i32* @POLLIN
store i32 %6, i32* %5
%7 = call i32 @poll(%struct.pollfd* %2, i32 1, i32 1000)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ stat();
int main() {
  int i;
  for (i = 0; i < 5; i++) {
    stat();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <stat@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @stat()
%2 = tail call i32 (...) @stat()
%3 = tail call i32 (...) @stat()
%4 = tail call i32 (...) @stat()
%5 = tail call i32 (...) @stat()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
void eval_leq(void) { write_instr(0x19); }


x86 assembly (clang, -O0):
<eval_leq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1030 <write_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_leq>:
mov    $0x19,%edi
jmp    1030 <write_instr@plt>

LLVM IR (-O0):
define void @eval_leq() {
%1 = call i32 @write_instr(i32 25)
ret void
}

LLVM IR (-O2):
define void @eval_leq() {
%1 = tail call i32 @write_instr(i32 25)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void read() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @read() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_stat();
void update_running_processes() { update_stat(); }


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

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

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

LLVM IR (-O2):
define void @update_running_processes() {
%1 = tail call i32 (...) @update_stat()
ret void
}
/* Variables and functions */
double Melder_roundUp(double);
double Melder_round_tieDown(double x) { return Melder_roundUp(x - 0.5); }


x86 assembly (clang, -O0):
<Melder_round_tieDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <Melder_roundUp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Melder_round_tieDown>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <Melder_roundUp@plt>

LLVM IR (-O0):
define double @Melder_round_tieDown(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = call double @Melder_roundUp(double %4)
ret double %5
}

LLVM IR (-O2):
define double @Melder_round_tieDown(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = tail call double @Melder_roundUp(double %2)
ret double %3
}
void shift_one_bit(char *cur_byte, int *byteshift, int *bitshift,
                   unsigned char *bits_header) {
  (*cur_byte) = (*cur_byte) << 1;
  (*bitshift)++;
  if ((*bitshift) >= 8) {
    (*byteshift) += 1;
    (*bitshift) = 0;
    (*cur_byte) = bits_header[*byteshift];
  }
}


x86 assembly (clang, -O0):
<shift_one_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x1,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x8,(%rax)
jl     1167 <shift_one_bit+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_one_bit>:
shlb   (%rdi)
mov    (%rdx),%r8d
lea    0x1(%r8),%eax
mov    %eax,(%rdx)
cmp    $0x7,%r8d
jl     1122 <shift_one_bit+0x22>
addl   $0x1,(%rsi)
movl   $0x0,(%rdx)
movslq (%rsi),%rax
mov    (%rcx,%rax,1),%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @shift_one_bit(i8* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl i32 %11, 1
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
store i8 %13, i8* %14
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %15
%18 = load i32*, i32** %7
%19 = load i32, i32* %18
%20 = icmp sge i32 %19, 8
br i1 %20, label %21, label %33
21: ; preds = %4
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
store i32 %24, i32* %22
%25 = load i32*, i32** %7
store i32 0, i32* %25
%26 = load i8*, i8** %8
%27 = load i32*, i32** %6
%28 = load i32, i32* %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %26, i64 %29
%31 = load i8, i8* %30
%32 = load i8*, i8** %5
store i8 %31, i8* %32
br label %33
33: ; preds = %21, %4
ret void
}

LLVM IR (-O2):
define void @shift_one_bit(i8* nocapture %0, i32* nocapture %1, i32* nocapture %2, i8* nocapture %3) {
%5 = load i8, i8* %0
%6 = shl i8 %5, 1
store i8 %6, i8* %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = icmp sgt i32 %7, 6
br i1 %9, label %10, label %17
10: ; preds = %4
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
store i32 0, i32* %2
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %3, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %0
br label %17
17: ; preds = %10, %4
ret void
}
void get_proximity_sensordata(char *pchRcvDataFrame, int *iDataIdx,
                              struct sensor_value *sensorsdata) {
  return;
}


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

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

LLVM IR (-O0):
%struct.sensor_value = type opaque
define void @get_proximity_sensordata(i8* %0, i32* %1, %struct.sensor_value* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca %struct.sensor_value*
store i8* %0, i8** %4
store i32* %1, i32** %5
store %struct.sensor_value* %2, %struct.sensor_value** %6
ret void
}

LLVM IR (-O2):
%struct.sensor_value = type opaque
define void @get_proximity_sensordata(i8* nocapture %0, i32* nocapture %1, %struct.sensor_value* nocapture %2) {
ret void
}
/* Variables and functions */
int __C_isgraph(int);
int isgraph(int c) { return __C_isgraph(c); }


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

x86 assembly (clang, -O2):
<isgraph>:
jmp    1030 <__C_isgraph@plt>

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = tail call i32 @__C_isgraph(i32 %0)
ret i32 %2
}
double exp(double x) { return 4; }


x86 assembly (clang, -O0):
<exp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @exp(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @exp(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ boardCoordsConvertedToString(int, int, char *);
void validCoordinatesConvertedToCoordString(void) {
  boardCoordsConvertedToString(5, 6, "G6");
  boardCoordsConvertedToString(15, 9, "K16");
}


x86 assembly (clang, -O0):
<validCoordinatesConvertedToCoordString>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x6,%esi
lea    0xedb(%rip),%rdx
call   1030 <boardCoordsConvertedToString@plt>
mov    $0xf,%edi
mov    $0x9,%esi
lea    0xec8(%rip),%rdx
call   1030 <boardCoordsConvertedToString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<validCoordinatesConvertedToCoordString>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <boardCoordsConvertedToString@plt>
lea    0xed5(%rip),%rdx
mov    $0xf,%edi
mov    $0x9,%esi
pop    %rax
jmp    1030 <boardCoordsConvertedToString@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"G6\00"
@.str.1 = [4 x i8] c"K16\00"
define void @validCoordinatesConvertedToCoordString() {
%1 = call i32 @boardCoordsConvertedToString(i32 5, i32 6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @boardCoordsConvertedToString(i32 15, i32 9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"G6\00"
@.str.1 = [4 x i8] c"K16\00"
define void @validCoordinatesConvertedToCoordString() {
%1 = tail call i32 @boardCoordsConvertedToString(i32 5, i32 6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @boardCoordsConvertedToString(i32 15, i32 9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ strncat(char *, char const *, size_t);
size_t trio_length(char *);
int trio_append_max(char *target, size_t max, const char *source) {
  size_t length;
  assert(target);
  assert(source);
  length = trio_length(target);
  if (max > length) {
    strncat(target, source, max - length - 1);
  }
  return (!(1 == 0));
}


x86 assembly (clang, -O0):
<trio_append_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <trio_length@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    118a <trio_append_max+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
sub    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncat@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_append_max>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %r14,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <trio_length@plt>
cmp    %r15,%rax
jae    116c <trio_append_max+0x3c>
not    %rax
add    %r15,%rax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncat@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @trio_append_max(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @assert(i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @assert(i8* %10)
%12 = load i8*, i8** %4
%13 = call i64 @trio_length(i8* %12)
store i64 %13, i64* %7
%14 = load i64, i64* %5
%15 = load i64, i64* %7
%16 = icmp ugt i64 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %3
%18 = load i8*, i8** %4
%19 = load i8*, i8** %6
%20 = load i64, i64* %5
%21 = load i64, i64* %7
%22 = sub i64 %20, %21
%23 = sub i64 %22, 1
%24 = call i32 @strncat(i8* %18, i8* %19, i64 %23)
br label %25
25: ; preds = %17, %3
ret i32 1
}

LLVM IR (-O2):
define i32 @trio_append_max(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @assert(i8* %0)
%5 = tail call i32 @assert(i8* %2)
%6 = tail call i64 @trio_length(i8* %0)
%7 = icmp ult i64 %6, %1
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = xor i64 %6, -1
%10 = add i64 %9, %1
%11 = tail call i32 @strncat(i8* %0, i8* %2, i64 %10)
br label %12
12: ; preds = %8, %3
ret i32 1
}
void quad_prob(int *n, int *A, int *n0, int *A0, double *psi, double *prob) {
  double quad_recur(int n, int A, int n0, int A0, double psi);
  *prob = quad_recur(*n, *A, *n0, *A0, *psi);
}


x86 assembly (clang, -O0):
<quad_prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <quad_recur@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad_prob>:
push   %rbx
mov    %r9,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
movsd  (%r8),%xmm0
call   1030 <quad_recur@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @quad_prob(i32* %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca double*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load double*, double** %11
%22 = load double, double* %21
%23 = call double @quad_recur(i32 %14, i32 %16, i32 %18, i32 %20, double %22)
%24 = load double*, double** %12
store double %23, double* %24
ret void
}

LLVM IR (-O2):
define void @quad_prob(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, double* nocapture %4, double* nocapture writeonly %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load double, double* %4
%12 = tail call double @quad_recur(i32 %7, i32 %8, i32 %9, i32 %10, double %11)
store double %12, double* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xbf() {
  Assert_real((isbdigit(191) == 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_isbdigit.c",
              960, ("isbdigit should be 0 for 0xbf"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xbf>:
push   %rax
mov    $0xbf,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3c0,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xbf\00"
define void @t_isbdigit_0xbf() {
%1 = call i64 @isbdigit(i32 191)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xbf\00"
define void @t_isbdigit_0xbf() {
%1 = tail call i64 @isbdigit(i32 191)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_CC_FIFOP_PIN() { return 0x01 & (inp_emulate(-5) >> 1); }


x86 assembly (clang, -O0):
<TOSH_READ_CC_FIFOP_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffb,%edi
call   1030 <inp_emulate@plt>
sar    $0x1,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_CC_FIFOP_PIN>:
push   %rax
mov    $0xfffffffb,%edi
call   1030 <inp_emulate@plt>
shr    %al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_CC_FIFOP_PIN() {
%1 = call i32 @inp_emulate(i32 -5)
%2 = ashr i32 %1, 1
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_CC_FIFOP_PIN() {
%1 = tail call i32 @inp_emulate(i32 -5)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 1
%4 = and i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
int main() {
  char s[] = "I am Michael";
  squeeze(s, "am");
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <squeeze@plt>
lea    -0xd(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6c65616863694d,%rax
mov    %rax,0x5(%rsp)
movabs $0x63694d206d612049,%rax
4d 69 63
mov    %rax,(%rsp)
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <squeeze@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [13 x i8] c"I am Michael\00"
@.str = [3 x i8] c"am\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = bitcast [13 x i8]* %1 to i8*
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = call i32 @squeeze(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [13 x i8] c"I am Michael\00"
@.str = [3 x i8] c"am\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @squeeze(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BUG_ON(int /*<<< orphan*/);
int /*<<< orphan*/ radix_tree_is_indirect_ptr(void *);
int /*<<< orphan*/ rcu_assign_pointer(void *, void *);
void radix_tree_replace_slot(void **pslot, void *item) {
  BUG_ON(radix_tree_is_indirect_ptr(item));
  rcu_assign_pointer(*pslot, item);
}


x86 assembly (clang, -O0):
<radix_tree_replace_slot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <radix_tree_is_indirect_ptr@plt>
mov    %eax,%edi
call   1030 <BUG_ON@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rcu_assign_pointer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_tree_replace_slot>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <radix_tree_is_indirect_ptr@plt>
mov    %eax,%edi
call   1030 <BUG_ON@plt>
mov    (%r14),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rcu_assign_pointer@plt>

LLVM IR (-O0):
define void @radix_tree_replace_slot(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @radix_tree_is_indirect_ptr(i8* %5)
%7 = call i32 @BUG_ON(i32 %6)
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = load i8*, i8** %4
%11 = call i32 @rcu_assign_pointer(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @radix_tree_replace_slot(i8** nocapture %0, i8* %1) {
%3 = tail call i32 @radix_tree_is_indirect_ptr(i8* %1)
%4 = tail call i32 @BUG_ON(i32 %3)
%5 = load i8*, i8** %0
%6 = tail call i32 @rcu_assign_pointer(i8* %5, i8* %1)
ret void
}
void fc186(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
  a:
    goto a;
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc186>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc186+0x7>

x86 assembly (clang, -O2):
<fc186>:
jmp    1100 <fc186>

LLVM IR (-O0):
define void @fc186(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %15, %1
br label %15
16: ; No predecessors!
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc186(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int __cc(char c) { return (c - '0'); }


x86 assembly (clang, -O0):
<__cc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cc>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @__cc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @__cc(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
double calcGeomMeanAnomalySun(double t) {
  double M = 357.52911 + t * (35999.05029 - 0.0001537 * t);
  return M;
}


x86 assembly (clang, -O0):
<calcGeomMeanAnomalySun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeed(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee9(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcGeomMeanAnomalySun>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcGeomMeanAnomalySun(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double -1.537000e-04, double %5, double 0x40E193E19BF9C62A)
%7 = call double @llvm.fmuladd.f64(double %4, double %6, double 0x407658773C0C1FC9)
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @calcGeomMeanAnomalySun(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double -1.537000e-04, double 0x40E193E19BF9C62A)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0x407658773C0C1FC9)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(int);
void *emalloc(int size) {
  void *p = malloc(size);
  if (p == NULL)
    die("Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <emalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <emalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @emalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @emalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ strout_upper(char *);
void begin_upper(void) { strout_upper("\n\n\n\n"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A\0A\0A\0A\00"
define void @begin_upper() {
%1 = tail call i32 @strout_upper(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}