xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int *ft_intnew(size_t size) {
  int *tab;
  size_t i;
  i = -1;
  tab = (int *)malloc(sizeof(int) * size);
  if (tab) {
    while (++i <= size)
      tab[i] = 0;
  }
  return (tab);
}


x86 assembly (clang, -O0):
<ft_intnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <ft_intnew+0x66>
jmp    1147 <ft_intnew+0x37>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x8(%rbp),%rax
ja     1171 <ft_intnew+0x61>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    1147 <ft_intnew+0x37>
jmp    1176 <ft_intnew+0x66>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_intnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x0(,%rdi,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114d <ft_intnew+0x2d>
lea    0x4(,%r14,4),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @ft_intnew(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = inttoptr i64 %4 to i8*
%8 = shl i64 %0, 2
%9 = add i64 %8, 4
br label %10
10: ; preds = %6, %1
%11 = inttoptr i64 %4 to i32*
ret i32* %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ c2_addr_write(int);
int /*<<< orphan*/ check_status();
int /*<<< orphan*/ fpdat_write(int);
void fp_reg_write(uint8_t addr, uint8_t value) {
  c2_addr_write(0xb4);
  fpdat_write(0x0a);
  check_status();
  fpdat_write(addr);
  fpdat_write(1);
  fpdat_write(value);
}


x86 assembly (clang, -O0):
<fp_reg_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xb4,%edi
call   1040 <c2_addr_write@plt>
mov    $0xa,%edi
call   1050 <fpdat_write@plt>
mov    $0x0,%al
call   1030 <check_status@plt>
mov    -0x4(%rbp),%edi
call   1050 <fpdat_write@plt>
mov    $0x1,%edi
call   1050 <fpdat_write@plt>
mov    -0x8(%rbp),%edi
call   1050 <fpdat_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_reg_write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xb4,%edi
call   1040 <c2_addr_write@plt>
mov    $0xa,%edi
call   1050 <fpdat_write@plt>
xor    %eax,%eax
call   1030 <check_status@plt>
mov    %ebp,%edi
call   1050 <fpdat_write@plt>
mov    $0x1,%edi
call   1050 <fpdat_write@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <fpdat_write@plt>

LLVM IR (-O0):
define void @fp_reg_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @c2_addr_write(i32 180)
%6 = call i32 @fpdat_write(i32 10)
%7 = call i32 (...) @check_status()
%8 = load i32, i32* %3
%9 = call i32 @fpdat_write(i32 %8)
%10 = call i32 @fpdat_write(i32 1)
%11 = load i32, i32* %4
%12 = call i32 @fpdat_write(i32 %11)
ret void
}

LLVM IR (-O2):
define void @fp_reg_write(i32 %0, i32 %1) {
%3 = tail call i32 @c2_addr_write(i32 180)
%4 = tail call i32 @fpdat_write(i32 10)
%5 = tail call i32 (...) @check_status()
%6 = tail call i32 @fpdat_write(i32 %0)
%7 = tail call i32 @fpdat_write(i32 1)
%8 = tail call i32 @fpdat_write(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("Hello, World!\n");
  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)
lea    0xed3(%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 = [15 x i8] c"Hello, World!\0A\00"
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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(long *);
int /*<<< orphan*/ sort_ascending_and_get_permutation(double *, long *, int);
extern void sort_ascending(double *x, int n) {
  long *idx = (long *)calloc(n, sizeof(long));
  sort_ascending_and_get_permutation(x, idx, n);
  free(idx);
}


x86 assembly (clang, -O0):
<sort_ascending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <sort_ascending_and_get_permutation@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_ascending>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
call   1050 <sort_ascending_and_get_permutation@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @sort_ascending(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i64*
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i64 @calloc(i32 %6, i32 8)
%8 = inttoptr i64 %7 to i64*
store i64* %8, i64** %5
%9 = load double*, double** %3
%10 = load i64*, i64** %5
%11 = load i32, i32* %4
%12 = call i32 @sort_ascending_and_get_permutation(double* %9, i64* %10, i32 %11)
%13 = load i64*, i64** %5
%14 = call i32 @free(i64* %13)
ret void
}

LLVM IR (-O2):
define void @sort_ascending(double* %0, i32 %1) {
%3 = tail call i64 @calloc(i32 %1, i32 8)
%4 = inttoptr i64 %3 to i64*
%5 = tail call i32 @sort_ascending_and_get_permutation(double* %0, i64* %4, i32 %1)
%6 = tail call i32 @free(i64* %4)
ret void
}
void do_move_ai() {}


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

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

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

LLVM IR (-O2):
define void @do_move_ai() {
ret void
}
/* Variables and functions */
int __futex(void volatile *, int, int, int /*<<< orphan*/ *);
int __futex_wake_ex(volatile void *ftx, bool shared, int count) {
  return __futex(ftx, shared ? 1 : (1 | 128), count, NULL);
}


x86 assembly (clang, -O0):
<__futex_wake_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x81,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
mov    -0x10(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__futex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futex_wake_ex>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
shl    $0x7,%eax
or     $0x1,%eax
mov    %eax,%esi
xor    %ecx,%ecx
jmp    1030 <__futex@plt>

LLVM IR (-O0):
define i32 @__futex_wake_ex(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 129
%12 = load i32, i32* %6
%13 = call i32 @__futex(i8* %7, i32 %11, i32 %12, i32* null)
ret i32 %13
}

LLVM IR (-O2):
define i32 @__futex_wake_ex(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 129, i32 1
%6 = tail call i32 @__futex(i8* %0, i32 %5, i32 %2, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo1() { printf("foo1 in inline0\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"foo1 in inline0\00"
define void @foo1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
uintptr_t hash_str(void *key) {
  char *str = (void *)key;
  unsigned i = 0;
  while (*str) {
    i ^= (*str) * -13;
    str++;
  }
  return i;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <hash_str+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
imul   $0xfffffff3,%eax,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hash_str+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <hash_str+0x25>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0xfffffff3,%ecx,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_str+0x10>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @hash_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 0, i32* %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 %19
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = mul nsw i32 %13, -13
%15 = load i32, i32* %4
%16 = xor i32 %15, %14
store i32 %16, i32* %4
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
%21 = zext i32 %20 to i64
ret i64 %21
}

LLVM IR (-O2):
define i64 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %8, -13
%10 = xor i32 %9, %6
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = zext i32 %10 to i64
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 0, %1 ], [ %15, %14 ]
ret i64 %17
}
/* Variables and functions */
int foo(double);
int /*<<< orphan*/ printf(char *, double, int);
int main(int argc, char *argv[]) {
  double d = 99.5;
  int i = foo(d);
  printf("foo (%lf) = %d\n", d, i);
  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)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <foo@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <foo@plt>
lea    0xed3(%rip),%rdi
movsd  0xec3(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"foo (%lf) = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 9.950000e+01, double* %6
%8 = load double, double* %6
%9 = call i32 @foo(double %8)
store i32 %9, i32* %7
%10 = load double, double* %6
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"foo (%lf) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(double 9.950000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 9.950000e+01, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ getanswer(char *, int /*<<< orphan*/);
int /*<<< orphan*/ mvaddstr(int, int /*<<< orphan*/, char *);
void more(int where) {
  mvaddstr(where, 0, "-- more --");
  getanswer(" ", FALSE);
}


x86 assembly (clang, -O0):
<more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
lea    0xec9(%rip),%rdx
call   1040 <mvaddstr@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <getanswer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<more>:
push   %rax
lea    0xed8(%rip),%rdx
xor    %esi,%esi
call   1040 <mvaddstr@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <getanswer@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"-- more --\00"
@.str.1 = [2 x i8] c" \00"
@FALSE = global i32 0
define void @more(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mvaddstr(i32 %3, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @FALSE
%6 = call i32 @getanswer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"-- more --\00"
@.str.1 = [2 x i8] c" \00"
@FALSE = global i32 0
define void @more(i32 %0) {
%2 = tail call i32 @mvaddstr(i32 %0, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @FALSE
%4 = tail call i32 @getanswer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_char(char);
int /*<<< orphan*/ wait_for_uart_idle();
extern void put_string(const char *str) {
  char currentChar = str[0];
  for (size_t i = 0; currentChar != '\0'; ++i) {
    currentChar = str[i];
    if (currentChar != '\0') {
      put_char(currentChar);
    }
  }
  wait_for_uart_idle();
}


x86 assembly (clang, -O0):
<put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     1184 <put_string+0x64>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     116e <put_string+0x4e>
movsbl -0x9(%rbp),%edi
call   1040 <put_char@plt>
jmp    1173 <put_string+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113d <put_string+0x1d>
mov    $0x0,%al
call   1030 <wait_for_uart_idle@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <put_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1040 <put_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <put_string+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1030 <wait_for_uart_idle@plt>

LLVM IR (-O0):
define void @put_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
store i8 %7, i8* %3
store i64 0, i64* %4
br label %8
8: ; preds = %24, %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %3
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i8, i8* %3
%22 = call i32 @put_char(i8 signext %21)
br label %23
23: ; preds = %20, %12
br label %24
24: ; preds = %23
%25 = load i64, i64* %4
%26 = add i64 %25, 1
store i64 %26, i64* %4
br label %8
27: ; preds = %8
%28 = call i32 (...) @wait_for_uart_idle()
ret void
}

LLVM IR (-O2):
define void @put_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = tail call i32 (...) @wait_for_uart_idle()
ret void
6: ; preds = %1, %6
%7 = phi i64 [ %10, %6 ], [ 0, %1 ]
%8 = phi i8 [ %12, %6 ], [ %2, %1 ]
%9 = tail call i32 @put_char(i8 signext %8)
%10 = add i64 %7, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *Parrot_localtime_r(const time_t *t, struct tm *tm) {
  *tm = *localtime(t);
  return tm;
}


x86 assembly (clang, -O0):
<Parrot_localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Parrot_localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @Parrot_localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load %struct.tm*, %struct.tm** %4
%6 = load i32*, i32** %3
%7 = call %struct.tm* @localtime(i32* %6)
%8 = bitcast %struct.tm* %5 to i8*
%9 = bitcast %struct.tm* %7 to i8*
%10 = load %struct.tm*, %struct.tm** %4
ret %struct.tm* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @Parrot_localtime_r(i32* %0, %struct.tm* returned writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%5 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%6 = load i32, i32* %4
store i32 %6, i32* %5
ret %struct.tm* %1
}
void min_free_kbytes_sysctl_handler(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<min_free_kbytes_sysctl_handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_free_kbytes_sysctl_handler>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.min_free_kbytes_sysctl_handler = [31 x i8] c"min_free_kbytes_sysctl_handler\00"
define void @min_free_kbytes_sysctl_handler() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__func__.min_free_kbytes_sysctl_handler, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.min_free_kbytes_sysctl_handler = [31 x i8] c"min_free_kbytes_sysctl_handler\00"
define void @min_free_kbytes_sysctl_handler() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__func__.min_free_kbytes_sysctl_handler, i64 0, i64 0))
ret void
}
int f18(j, i)
long *i;
int j;
{ return j + i[0]; }


x86 assembly (clang, -O0):
<f18>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    (%rcx),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f18(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i64*, i64** %4
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add nsw i64 %6, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @f18(i32 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = add i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ integers_not_equal_display_error(int const, int const);
void _assert_int_not_equal(const int a, const int b, const char *const file,
                           const int line) {
  if (!integers_not_equal_display_error(a, b)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_int_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <integers_not_equal_display_error@plt>
cmp    $0x0,%eax
jne    1155 <_assert_int_not_equal+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_int_not_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <integers_not_equal_display_error@plt>
test   %eax,%eax
je     1138 <_assert_int_not_equal+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

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

LLVM IR (-O2):
define void @_assert_int_not_equal(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @integers_not_equal_display_error(i32 %0, i32 %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_fail(i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MCUSendCmdSoundRecordCtrl(int /*<<< orphan*/);
void MCUSendCmdSoundRecordCtrlStart() { MCUSendCmdSoundRecordCtrl(0); }


x86 assembly (clang, -O0):
<MCUSendCmdSoundRecordCtrlStart>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <MCUSendCmdSoundRecordCtrl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCUSendCmdSoundRecordCtrlStart>:
xor    %edi,%edi
jmp    1030 <MCUSendCmdSoundRecordCtrl@plt>

LLVM IR (-O0):
define void @MCUSendCmdSoundRecordCtrlStart() {
%1 = call i32 @MCUSendCmdSoundRecordCtrl(i32 0)
ret void
}

LLVM IR (-O2):
define void @MCUSendCmdSoundRecordCtrlStart() {
%1 = tail call i32 @MCUSendCmdSoundRecordCtrl(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int x, y, m;
  puts("Please input x and y");
  scanf("%d%d", &x, &y);
  m = x * y;
  printf("%d * %d = %d\n", x, y, m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Please input x and y\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [14 x i8] c"%d * %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}
int tadd_ok(int x, int y) {
  return !(((x > 0) && (y > 0) && (x + y) <= 0) ||
           ((x < 0) && (y < 0) && (x + y) >= 0));
}


x86 assembly (clang, -O0):
<tadd_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <tadd_ok+0x32>
cmpl   $0x0,-0x8(%rbp)
jle    1132 <tadd_ok+0x32>
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jle    1165 <tadd_ok+0x65>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xa(%rbp)
jge    115f <tadd_ok+0x5f>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jge    115f <tadd_ok+0x5f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
setge  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tadd_ok>:
lea    (%rsi,%rdi,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
test   %edi,%esi
mov    $0x1,%edx
cmovs  %eax,%edx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %edx,%eax
test   %esi,%esi
cmovle %edx,%eax
test   %edi,%edi
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @tadd_ok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
%14 = icmp sle i32 %13, 0
br i1 %14, label %28, label %15
15: ; preds = %10, %7, %2
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %22, %23
%25 = icmp sge i32 %24, 0
br label %26
26: ; preds = %21, %18, %15
%27 = phi i1 [ false, %18 ], [ false, %15 ], [ %25, %21 ]
br label %28
28: ; preds = %26, %10
%29 = phi i1 [ true, %10 ], [ %27, %26 ]
%30 = xor i1 %29, true
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @tadd_ok(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = add nsw i32 %1, %0
%7 = icmp slt i32 %6, 1
%8 = select i1 %5, i1 %7, i1 false
%9 = and i32 %1, %0
%10 = icmp slt i32 %9, 0
%11 = lshr i32 %6, 31
%12 = select i1 %10, i32 %11, i32 1
%13 = select i1 %8, i32 0, i32 %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void foo(int i) {
  static int n;
  if (i < -128 || i > 127)
    abort();
  if (++n > 1000)
    exit(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffff80,-0x4(%rbp)
jl     113f <foo+0x1f>
cmpl   $0x7f,-0x4(%rbp)
jle    1146 <foo+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2ee8(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2edf(%rip)
cmp    $0x3e8,%eax
jle    1167 <foo+0x47>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
movsbl %dil,%eax
cmp    %edi,%eax
jne    1141 <foo+0x21>
mov    0x2f05(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2efc(%rip)
cmp    $0x3e8,%eax
jge    1148 <foo+0x28>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@foo.n = internal global i32 0
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, -128
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 127
br i1 %7, label %8, label %10
8: ; preds = %5, %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = load i32, i32* @foo.n
%12 = add nsw i32 %11, 1
store i32 %12, i32* @foo.n
%13 = icmp sgt i32 %12, 1000
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %10
ret void
}

LLVM IR (-O2):
@foo.n = internal unnamed_addr global i32 0
define void @foo(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, -256
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
%7 = load i32, i32* @foo.n
%8 = add nsw i32 %7, 1
store i32 %8, i32* @foo.n
%9 = icmp sgt i32 %7, 999
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xcd() {
  Assert_real((isalpha(205) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1030, ("isalpha should be 0 for 0xcd"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xcd>:
push   %rax
mov    $0xcd,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x406,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcd\00"
define void @t_isalpha_0xcd() {
%1 = call i64 @isalpha(i32 205)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1030, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcd\00"
define void @t_isalpha_0xcd() {
%1 = tail call i64 @isalpha(i32 205)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1030, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void h_AI_levels() { printf("\tAI levels:\n0 [human], 1, or 2\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"\09AI levels:\0A0 [human], 1, or 2\0A\00"
define void @h_AI_levels() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"\09AI levels:\0A0 [human], 1, or 2\00"
define void @h_AI_levels() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
void *__run_process(void *ptr) {
  void (*func)() = ptr;
  func();
  return 0;
}


x86 assembly (clang, -O0):
<__run_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   *-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__run_process>:
push   %rax
xor    %eax,%eax
call   *%rdi
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @__run_process(i8* %0) {
%2 = alloca i8*
%3 = alloca void (...)*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to void (...)*
store void (...)* %5, void (...)** %3
%6 = load void (...)*, void (...)** %3
ret i8* null
}

LLVM IR (-O2):
define i8* @__run_process(i8* nocapture %0) {
%2 = bitcast i8* %0 to void (...)*
tail call void (...) %2()
ret i8* null
}
void u32_to_b3(unsigned char *b, unsigned long l) {
  b[2] = l & 0xff;
  b[1] = (l >> 8) & 0xff;
  b[0] = (l >> 16) & 0xff;
}


x86 assembly (clang, -O0):
<u32_to_b3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32_to_b3>:
mov    %esi,%eax
rol    $0x8,%ax
mov    %ax,0x1(%rdi)
shr    $0x10,%rsi
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @u32_to_b3(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8 %7, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 8
%12 = and i64 %11, 255
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i64, i64* %4
%17 = lshr i64 %16, 16
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 %19, i8* %21
ret void
}

LLVM IR (-O2):
define void @u32_to_b3(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utf8_remove_last_char(char *);
void dynstr_trim_last_char(char *this) { utf8_remove_last_char(this); }


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

x86 assembly (clang, -O2):
<dynstr_trim_last_char>:
jmp    1030 <utf8_remove_last_char@plt>

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

LLVM IR (-O2):
define void @dynstr_trim_last_char(i8* %0) {
%2 = tail call i32 @utf8_remove_last_char(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/ *, int, int, char *);
void erase_arrow(WINDOW *win, int y, int x) { mvwaddstr(win, y, x, "  "); }


x86 assembly (clang, -O0):
<erase_arrow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xecd(%rip),%rcx
call   1030 <mvwaddstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_arrow>:
lea    0xee9(%rip),%rcx
jmp    1030 <mvwaddstr@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @erase_arrow(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @mvwaddstr(i32* %0, i32 %1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s dbpath [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb]\n",
          prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"usage: %s dbpath [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"usage: %s dbpath [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_I2C_BUS1_SCL_OUTPUT() { set_io_bit(0x36, 4); }


x86 assembly (clang, -O0):
<TOSH_MAKE_I2C_BUS1_SCL_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x4,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_I2C_BUS1_SCL_OUTPUT>:
mov    $0x36,%edi
mov    $0x4,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_I2C_BUS1_SCL_OUTPUT() {
%1 = call i32 @set_io_bit(i32 54, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_I2C_BUS1_SCL_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 54, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned int);
int print_cpsr(unsigned int cpsr, char *why) {
  printf("print_cpsr %s cpsr = 0x%x\n\r", why, cpsr);
}


x86 assembly (clang, -O0):
<print_cpsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cpsr>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"print_cpsr %s cpsr = 0x%x\0A\0D\00"
define i32 @print_cpsr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [28 x i8] c"print_cpsr %s cpsr = 0x%x\0A\0D\00"
define i32 @print_cpsr(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0)
ret i32 undef
}
int main() {
  int b = 1;
  char a[16] = {0};
  int ab[2][3] = {1, 2, 3, 4, 5, 6};
  printf("%x,%x,%x,%x\n", ab, ab + 1, *ab, **ab);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    0xeb3(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x40(%rbp),%rsi
lea    -0x40(%rbp),%rdx
add    $0xc,%rdx
lea    -0x40(%rbp),%rcx
mov    -0x40(%rbp),%r8d
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xc(%rsp),%rdx
lea    0xee1(%rip),%rdi
mov    %rsp,%rcx
mov    %rcx,%rsi
mov    $0x1,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.ab = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@.str = [13 x i8] c"%x,%x,%x,%x\0A\00"
define i32 @main() {
%1 = alloca [2 x [3 x i32]]
%2 = bitcast [2 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1
%5 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), [3 x i32]* %3, [3 x i32]* %4, i32* %5, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int k;
  k = 5 + 5 * 5 + 5 * 5 + 5;
  printf("%d\n", k);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca i32
store i32 60, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 60)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
short gshortplus(short x, short y) {
  x += y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gshortplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%ecx
movswl -0x2(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1148 <gshortplus+0x38>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gshortplus>:
push   %rbx
mov    %esi,%ebx
add    %di,%bx
jne    111f <gshortplus+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @gshortplus(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
%9 = add nsw i32 %8, %6
%10 = trunc i32 %9 to i16
store i16 %10, i16* %3
%11 = load i16, i16* %3
%12 = icmp ne i16 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @foo(i8* null)
br label %15
15: ; preds = %13, %2
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @gshortplus(i16 signext %0, i16 signext %1) {
%3 = add i16 %1, %0
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i16 %3
}