xunge/DecIR huggingface dataset:
/* Variables and functions */
long Sum(long, long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *, long *);
int main(void) {
  long a, b, c;
  printf("Enter two ints\n");
  scanf("%ld%ld", &a, &b);
  c = Sum(a, b);
  printf("The sum is %ld\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <Sum@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1050 <Sum@plt>
lea    0xe8b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter two ints\0A\00"
@.str.1 = [7 x i8] c"%ld%ld\00"
@.str.2 = [16 x i8] c"The sum is %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = call i64 @Sum(i64 %7, i64 %8)
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%ld%ld\00"
@.str.2 = [16 x i8] c"The sum is %ld\0A\00"
@str = [15 x i8] c"Enter two ints\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = call i64 @Sum(i64 %7, i64 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int f4(int i) {
  printf("%d\n", i = 0);
  return i;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @f4(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ max_num(int, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int wyj;
  max_num(3, 4, &wyj);
  printf("%d\n", wyj);
  max_num(2137, 1488, &wyj);
  printf("%d\n", wyj);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1040 <max_num@plt>
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x859,%edi
mov    $0x5d0,%esi
lea    -0x8(%rbp),%rdx
call   1040 <max_num@plt>
mov    -0x8(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%r14
mov    $0x3,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1040 <max_num@plt>
mov    0x4(%rsp),%esi
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x859,%edi
mov    $0x5d0,%esi
mov    %r14,%rdx
call   1040 <max_num@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @max_num(i32 3, i32 4, i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @max_num(i32 2137, i32 1488, i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
long atos(char s[]) {
  long i, j;
  j = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i)
    j = 10 * j + s[i] - '0';
  return (j);
}


x86 assembly (clang, -O0):
<atos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x19(%rbp)
jl     1147 <atos+0x47>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1157 <atos+0x57>
jmp    1185 <atos+0x85>
imul   $0xa,-0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <atos+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atos>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%eax
cmp    $0x9,%al
ja     112f <atos+0x2f>
add    $0x1,%rdi
xor    %eax,%eax
nop
lea    (%rax,%rax,4),%rax
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1110 <atos+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @atos(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i8 [ %15, %5 ], [ %2, %1 ]
%7 = phi i64 [ %12, %5 ], [ 0, %1 ]
%8 = phi i64 [ %13, %5 ], [ 0, %1 ]
%9 = mul nsw i64 %7, 10
%10 = zext i8 %6 to i64
%11 = add i64 %9, -48
%12 = add i64 %11, %10
%13 = add nuw nsw i64 %8, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i64 [ 0, %1 ], [ %12, %5 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ snprintf(char *, int const, char *, int, long, char *);
int main(int argc, char **argv) {
  int i = 5;
  long int li = 1234567890L;
  char *s = "this is a string";
  const int bufSize = 10;
  char os[bufSize];
  snprintf(os, bufSize, "i: %d, li: %ld, s: %s\n", i, li, s);
  puts(os);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movq   $0x499602d2,-0x20(%rbp)
49
lea    0xeb4(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0xa,-0x2c(%rbp)
mov    %rsp,%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    -0x50(%rbp),%rdi
mov    $0xa,%esi
lea    0xe98(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee5(%rip),%rdx
lea    0xecd(%rip),%r9
mov    %rsp,%rbx
mov    $0x499602d2,%r8d
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x5,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"this is a string\00"
@.str.1 = [23 x i8] c"i: %d, li: %ld, s: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i64 1234567890, i64* %7
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %8
store i32 10, i32* %9
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %10
%12 = alloca i8, i64 10
%13 = load i32, i32* %6
%14 = load i64, i64* %7
%15 = load i8*, i8** %8
%16 = call i32 @snprintf(i8* %12, i32 10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %13, i64 %14, i8* %15)
%17 = call i32 @puts(i8* %12)
store i32 0, i32* %3
%18 = load i8*, i8** %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [17 x i8] c"this is a string\00"
@.str.1 = [23 x i8] c"i: %d, li: %ld, s: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 5, i64 1234567890, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @puts(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_mosaic_xgrid_order1(char const *, int *, int *, int *,
                                            int *, double *);
void read_mosaic_xgrid_order1_(const char *xgrid_file, int *i1, int *j1,
                               int *i2, int *j2, double *area) {
  read_mosaic_xgrid_order1(xgrid_file, i1, j1, i2, j2, area);
}


x86 assembly (clang, -O0):
<read_mosaic_xgrid_order1_>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <read_mosaic_xgrid_order1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mosaic_xgrid_order1_>:
jmp    1030 <read_mosaic_xgrid_order1@plt>

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

LLVM IR (-O2):
define void @read_mosaic_xgrid_order1_(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, double* %5) {
%7 = tail call i32 @read_mosaic_xgrid_order1(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, double* %5)
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
int /*<<< orphan*/ netif_wake_queue(struct net_device *);
void netif_wake_subqueue(struct net_device *dev, int fifo_no) {
  WARN_ON(1);
  netif_wake_queue(dev);
}


x86 assembly (clang, -O0):
<netif_wake_subqueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
mov    -0x8(%rbp),%rdi
call   1040 <netif_wake_queue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netif_wake_subqueue>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <netif_wake_queue@plt>

LLVM IR (-O0):
%struct.net_device = type { i32 }
define void @netif_wake_subqueue(%struct.net_device* %0, i32 %1) {
%3 = alloca %struct.net_device*
%4 = alloca i32
store %struct.net_device* %0, %struct.net_device** %3
store i32 %1, i32* %4
%5 = call i32 @WARN_ON(i32 1)
%6 = load %struct.net_device*, %struct.net_device** %3
%7 = call i32 @netif_wake_queue(%struct.net_device* %6)
ret void
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
define void @netif_wake_subqueue(%struct.net_device* %0, i32 %1) {
%3 = tail call i32 @WARN_ON(i32 1)
%4 = tail call i32 @netif_wake_queue(%struct.net_device* %0)
ret void
}
/* Variables and functions */
double fabs(double);
int cs_tol(int i, int j, double aij, void *tol) {
  (void)i;
  (void)j;
  return (fabs(aij) > *((double *)tol));
}


x86 assembly (clang, -O0):
<cs_tol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_tol>:
andpd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @cs_tol(i32 %0, i32 %1, double %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load double, double* %7
%12 = call double @llvm.fabs.f64(double %11)
%13 = load i8*, i8** %8
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
%16 = fcmp ogt double %12, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @cs_tol(i32 %0, i32 %1, double %2, i8* nocapture %3) {
%5 = tail call double @llvm.fabs.f64(double %2)
%6 = bitcast i8* %3 to double*
%7 = load double, double* %6
%8 = fcmp ogt double %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct kaizen_raw_reliable_frame_time_scope_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int kaizen_reliable_frame_time_scope_init(
    struct kaizen_raw_reliable_frame_time_scope_s *scope) {
  assert(NULL != scope);
  (void)scope;
  return 0;
}


x86 assembly (clang, -O0):
<kaizen_reliable_frame_time_scope_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kaizen_reliable_frame_time_scope_init>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.kaizen_raw_reliable_frame_time_scope_s = type { i32 }
define i32 @kaizen_reliable_frame_time_scope_init(%struct.kaizen_raw_reliable_frame_time_scope_s* %0) {
%2 = alloca %struct.kaizen_raw_reliable_frame_time_scope_s*
store %struct.kaizen_raw_reliable_frame_time_scope_s* %0, %struct.kaizen_raw_reliable_frame_time_scope_s** %2
%3 = load %struct.kaizen_raw_reliable_frame_time_scope_s*, %struct.kaizen_raw_reliable_frame_time_scope_s** %2
%4 = icmp ne %struct.kaizen_raw_reliable_frame_time_scope_s* null, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.kaizen_raw_reliable_frame_time_scope_s*, %struct.kaizen_raw_reliable_frame_time_scope_s** %2
ret i32 0
}

LLVM IR (-O2):
%struct.kaizen_raw_reliable_frame_time_scope_s = type { i32 }
define i32 @kaizen_reliable_frame_time_scope_init(%struct.kaizen_raw_reliable_frame_time_scope_s* readnone %0) {
%2 = icmp ne %struct.kaizen_raw_reliable_frame_time_scope_s* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
scalar_t__ stat(char *, struct stat *);
bool does_not_exist(char *file) {
  struct stat s;
  return (stat(file, &s) && errno == ENOENT);
}


x86 assembly (clang, -O0):
<does_not_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1155 <does_not_exist+0x45>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<does_not_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
setne  %al
mov    0x2eba(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2ea0(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @does_not_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @ENOENT
%10 = icmp eq i64 %8, %9
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @does_not_exist(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i64 %4, 0
%6 = load i64, i64* @errno
%7 = load i64, i64* @ENOENT
%8 = icmp eq i64 %6, %7
%9 = select i1 %5, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
extern const char *onig_copyright(void) {
  static char s[58];
  sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2007 K.Kosako", 4, 4, 4);
  return s;
}


x86 assembly (clang, -O0):
<onig_copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x4,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onig_copyright>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@onig_copyright.s = internal global [58 x i8] zeroinitializer
@.str = [54 x i8] c"Oniguruma %d.%d.%d : Copyright (C) 2002-2007 K.Kosako\00"
define i8* @onig_copyright() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 4, i32 4, i32 4)
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0)
}

LLVM IR (-O2):
@onig_copyright.s = internal global [58 x i8] zeroinitializer
@.str = [54 x i8] c"Oniguruma %d.%d.%d : Copyright (C) 2002-2007 K.Kosako\00"
define i8* @onig_copyright() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 4, i32 4, i32 4)
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0)
}
void swap(char **str1, char **str2) {
  char *dummy;
  dummy = *str1;
  *str1 = *str2;
  *str2 = dummy;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void scarab_os_init() {}


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

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

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

LLVM IR (-O2):
define void @scarab_os_init() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpgrp();
int tcgetpgrp(int);
int is_fg(void) {
  pid_t pgid = getpgrp();
  pid_t tcpgid = tcgetpgrp(1);
  return (pgid != -1) && (pgid == tcpgid);
}


x86 assembly (clang, -O0):
<is_fg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getpgrp@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <tcgetpgrp@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     115a <is_fg+0x3a>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fg>:
push   %rbx
xor    %eax,%eax
call   1040 <getpgrp@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <tcgetpgrp@plt>
cmp    $0xffffffff,%ebx
setne  %cl
cmp    %eax,%ebx
sete   %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_fg() {
%1 = tail call i32 (...) @getpgrp()
%2 = tail call i32 @tcgetpgrp(i32 1)
%3 = icmp ne i32 %1, -1
%4 = icmp eq i32 %1, %2
%5 = select i1 %3, i1 %4, i1 false
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_B1int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xb1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B1int64_midword_mem>:
testb  $0xb1,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B1int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 177
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B1int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11599872
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x22() {
  Assert_real((isgraph(34)),
              "/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_isgraph.c",
              175, ("isgraph should be 1 for 0x22"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x22>:
push   %rax
mov    $0x22,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xaf,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 1 for 0x22\00"
define void @t_isgraph_0x22() {
%1 = call i32 @isgraph(i32 34)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 1 for 0x22\00"
define void @t_isgraph_0x22() {
%1 = tail call i32 @isgraph(i32 34)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void free(void *ptr) { ptr = '\0'; }


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

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

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

LLVM IR (-O2):
define void @free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void buf_free(char *buf[]) {
  int i;
  for (i = 0; i < 9; i++) {
    free(buf[i]);
  }
}


x86 assembly (clang, -O0):
<buf_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    114c <buf_free+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <buf_free+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
mov    0x20(%rbx),%rdi
call   1030 <free@plt>
mov    0x28(%rbx),%rdi
call   1030 <free@plt>
mov    0x30(%rbx),%rdi
call   1030 <free@plt>
mov    0x38(%rbx),%rdi
call   1030 <free@plt>
mov    0x40(%rbx),%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @buf_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
%7 = getelementptr inbounds i8*, i8** %0, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @free(i8* %8)
%10 = getelementptr inbounds i8*, i8** %0, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @free(i8* %11)
%13 = getelementptr inbounds i8*, i8** %0, i64 4
%14 = load i8*, i8** %13
%15 = tail call i32 @free(i8* %14)
%16 = getelementptr inbounds i8*, i8** %0, i64 5
%17 = load i8*, i8** %16
%18 = tail call i32 @free(i8* %17)
%19 = getelementptr inbounds i8*, i8** %0, i64 6
%20 = load i8*, i8** %19
%21 = tail call i32 @free(i8* %20)
%22 = getelementptr inbounds i8*, i8** %0, i64 7
%23 = load i8*, i8** %22
%24 = tail call i32 @free(i8* %23)
%25 = getelementptr inbounds i8*, i8** %0, i64 8
%26 = load i8*, i8** %25
%27 = tail call i32 @free(i8* %26)
ret void
}
/* Type definitions */
struct option_a {
  int dummy;
};

/* Variables and functions */
int _getopt_internal_a(int, char *const *, char const *,
                       struct option_a const *, int *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int getopt_a(int argc, char *const *argv, const char *optstring) {
  return _getopt_internal_a(argc, argv, optstring, (const struct option_a *)0,
                            (int *)0, 0, 0);
}


x86 assembly (clang, -O0):
<getopt_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
movl   $0x0,(%rsp)
call   1030 <_getopt_internal_a@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_a>:
push   %rax
movl   $0x0,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_getopt_internal_a@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option_a = type { i32 }
define i32 @getopt_a(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @_getopt_internal_a(i32 %7, i8** %8, i8* %9, %struct.option_a* null, i32* null, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option_a = type { i32 }
define i32 @getopt_a(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @_getopt_internal_a(i32 %0, i8** %1, i8* %2, %struct.option_a* null, i32* null, i32 0, i32 0)
ret i32 %4
}
void X509_NAME_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_dup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_action(char *, int /*<<< orphan*/);
int /*<<< orphan*/ show_actions();
char *skipspace(char *);
void cmd_action(char *arg) {
  arg = skipspace(arg);
  if (!*arg)
    show_actions();
  else
    parse_action(arg, 0);
}


x86 assembly (clang, -O0):
<cmd_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <skipspace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1162 <cmd_action+0x32>
mov    $0x0,%al
call   1030 <show_actions@plt>
jmp    116d <cmd_action+0x3d>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <parse_action@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_action>:
push   %rax
call   1050 <skipspace@plt>
cmpb   $0x0,(%rax)
je     1146 <cmd_action+0x16>
mov    %rax,%rdi
xor    %esi,%esi
pop    %rax
jmp    1040 <parse_action@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <show_actions@plt>

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

LLVM IR (-O2):
define void @cmd_action(i8* %0) {
%2 = tail call i8* @skipspace(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @show_actions()
br label %9
7: ; preds = %1
%8 = tail call i32 @parse_action(i8* %2, i32 0)
br label %9
9: ; preds = %7, %5
ret void
}
const char *Cmp_Definition(void) {
  return "struct Cmp {\n"
         "  int (*cmp)(var, var);\n"
         "};\n";
}


x86 assembly (clang, -O0):
<Cmp_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmp_Definition>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [41 x i8] c"struct Cmp {\0A int (*cmp)(var, var);\0A};\0A\00"
define i8* @Cmp_Definition() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [41 x i8] c"struct Cmp {\0A int (*cmp)(var, var);\0A};\0A\00"
define i8* @Cmp_Definition() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
void write_ds(unsigned val) {
  asm volatile("mov %0, %%ds" : : "rm"(val) : "memory");
}


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

x86 assembly (clang, -O2):
<write_ds>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%ds
ret

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

LLVM IR (-O2):
define void @write_ds(i32 %0) {
tail call void asm sideeffect "mov $0, %ds", "rm,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
void foo_2_2_1_1_2_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_1_2_1_2() {
ret void
}
/* Variables and functions */
int floor(int);
int quozienteDueNumeri(int numeroA, int numeroB) {
  return floor(numeroA / numeroB);
}


x86 assembly (clang, -O0):
<quozienteDueNumeri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quozienteDueNumeri>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%edi
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @quozienteDueNumeri(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 = load i32, i32* %4
%7 = sdiv i32 %5, %6
%8 = call i32 @floor(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @quozienteDueNumeri(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = tail call i32 @floor(i32 %3)
ret i32 %4
}
long sqr(int x) { return ((long)x * x); }


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

x86 assembly (clang, -O2):
<sqr>:
movslq %edi,%rax
imul   %rax,%rax
ret

LLVM IR (-O0):
define i64 @sqr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @sqr(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul nsw i64 %2, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void die(char const *prefix) {
  perror(prefix);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ rest__init_service_list();
int try_missing_services();
int test_find_service_empty(void) {
  rest__init_service_list();
  return try_missing_services();
}


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

x86 assembly (clang, -O2):
<test_find_service_empty>:
push   %rax
xor    %eax,%eax
call   1040 <rest__init_service_list@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <try_missing_services@plt>

LLVM IR (-O0):
define i32 @test_find_service_empty() {
%1 = call i32 (...) @rest__init_service_list()
%2 = call i32 (...) @try_missing_services()
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_find_service_empty() {
%1 = tail call i32 (...) @rest__init_service_list()
%2 = tail call i32 (...) @try_missing_services()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M583_f(char *s) {
  debug("M583_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M583_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M583_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M583_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M583_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M583_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M583_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
bool is_divisible(int num, int denom) {
  int remainder = num % denom;
  if (remainder == 0) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_divisible>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    112a <is_divisible+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <is_divisible+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_divisible>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_divisible(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void logSuiteEnded() {}


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

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

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

LLVM IR (-O2):
define void @logSuiteEnded() {
ret void
}
/* Variables and functions */
double gausdev();
double NormalRand(double m, double sd) { return (m + sd * gausdev()); }


x86 assembly (clang, -O0):
<NormalRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <gausdev@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalRand>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <gausdev@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @NormalRand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double (...) @gausdev()
%8 = call double @llvm.fmuladd.f64(double %6, double %7, double %5)
ret double %8
}

LLVM IR (-O2):
define double @NormalRand(double %0, double %1) {
%3 = tail call double (...) @gausdev()
%4 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %0)
ret double %4
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ rdbuf(int /*<<< orphan*/ *, char *, int);
int rdint(int /*<<< orphan*/ *);
char *xalloc(int);
char *rdstr(FILE *fd) {
  ssize_t len;
  char *s;
  len = rdint(fd);
  if (len == -1) {
    return NULL;
  } else {
    s = xalloc(len + 1);
    rdbuf(fd, s, len);
    s[len] = '\0';
    return s;
  }
}


x86 assembly (clang, -O0):
<rdstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <rdint@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    115f <rdstr+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1192 <rdstr+0x62>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <xalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <rdbuf@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdstr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <rdint@plt>
cmp    $0xffffffff,%eax
je     1166 <rdstr+0x36>
mov    %eax,%ebx
lea    0x1(%rbx),%edi
call   1050 <xalloc@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <rdbuf@plt>
movslq %ebx,%rax
movb   $0x0,(%r15,%rax,1)
jmp    1169 <rdstr+0x39>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @rdstr(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @rdint(i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %24
11: ; preds = %1
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = call i8* @xalloc(i32 %13)
store i8* %14, i8** %5
%15 = load i32*, i32** %3
%16 = load i8*, i8** %5
%17 = load i32, i32* %4
%18 = call i32 @rdbuf(i32* %15, i8* %16, i32 %17)
%19 = load i8*, i8** %5
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 0, i8* %22
%23 = load i8*, i8** %5
store i8* %23, i8** %2
br label %24
24: ; preds = %11, %10
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @rdstr(i32* %0) {
%2 = tail call i32 @rdint(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add nuw nsw i32 %2, 1
%6 = tail call i8* @xalloc(i32 %5)
%7 = tail call i32 @rdbuf(i32* %0, i8* %6, i32 %2)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %1, %4
%11 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int binary_search(int *, int /*<<< orphan*/, int, int);
int search(int *input_array, int array_size, int element) {
  return binary_search(input_array, 0, array_size - 1, element);
}


x86 assembly (clang, -O0):
<search>:
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),%edx
sub    $0x1,%edx
mov    -0x10(%rbp),%ecx
xor    %esi,%esi
call   1030 <binary_search@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <binary_search@plt>

LLVM IR (-O0):
define i32 @search(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 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @binary_search(i32* %7, i32 0, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @search(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @binary_search(i32* %0, i32 0, i32 %4, i32 %2)
ret i32 %5
}
unsigned long long dtolong(double d) { return *((unsigned long long *)&d); }


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

x86 assembly (clang, -O2):
<dtolong>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @dtolong(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @dtolong(double %0) {
%2 = bitcast double %0 to i64
ret i64 %2
}