xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *mymalloc(size_t size) {
  void *p = malloc(size);
  if (!p) {
    printf("Out of memory!\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <mymalloc+0x3e>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <mymalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [15 x i8] c"Out of memory!\00"
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_spaces(FILE *f, int nspaces) {
  int i;
  for (i = 0; i < nspaces; i++) {
    fprintf(f, " ");
  }
}


x86 assembly (clang, -O0):
<print_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <print_spaces+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_spaces+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spaces>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <print_spaces+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <print_spaces+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @print_spaces(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_spaces(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 32, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  int /*<<< orphan*/ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int semop(int, struct sembuf *, int);
int sem_p(int semid) {
  struct sembuf buf = {
      .sem_num = 0,
      .sem_op = -1,
      .sem_flg = SEM_UNDO,
  };
  return semop(semid, &buf, 1);
}


x86 assembly (clang, -O0):
<sem_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_p>:
sub    $0x18,%rsp
movl   $0xffffffff,0x8(%rsp)
ff
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define i32 @sem_p(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
%6 = load i32, i32* @SEM_UNDO
store i32 %6, i32* %5
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i32 0, i32* %7
%8 = load i32, i32* %2
%9 = call i32 @semop(i32 %8, %struct.sembuf* %3, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define i32 @sem_p(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
%6 = load i32, i32* @SEM_UNDO
store i32 %6, i32* %5
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 2
store i32 0, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %8
}
void foo146() {}


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

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

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

LLVM IR (-O2):
define void @foo146() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void didSucceed() { printf("Hey, the process ended successfully.\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Hey, the process ended successfully.\0A\00"
define void @didSucceed() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Hey, the process ended successfully.\00"
define void @didSucceed() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void write_16_le(unsigned char bytes[2], uint32_t v) {
  for (int i = 0; i < 2; i++) {
    bytes[i] = v & 0xff;
    v >>= 8;
  }
}


x86 assembly (clang, -O0):
<write_16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1148 <write_16_le+0x48>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <write_16_le+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_16_le>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @write_16_le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
void initTimer() {
  (*(unsigned int *)0x40048080) |= 1 << 7;
  (*(unsigned int *)0x4000C004) |= 1;
  (*(unsigned int *)0x4000C004) &= ~2;
  (*(unsigned int *)0x4000C00C) = 1 * 12 - 1;
}


x86 assembly (clang, -O0):
<initTimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40048080,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    $0x40048080,%eax
mov    %ecx,(%rax)
mov    $0x4000c004,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x4000c004,%eax
mov    %ecx,(%rax)
mov    $0x4000c004,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0x4000c004,%eax
mov    %ecx,(%rax)
mov    $0x4000c00c,%eax
movl   $0xb,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initTimer>:
orb    $0x80,0x40048080
80
mov    0x4000c004,%eax
and    $0xfffffffc,%eax
or     $0x1,%eax
mov    %eax,0x4000c004
movl   $0xb,0x4000c00c
ret

LLVM IR (-O0):
define void @initTimer() {
%1 = load i32, i32* inttoptr (i64 1074036864 to i32*)
%2 = or i32 %1, 128
store i32 %2, i32* inttoptr (i64 1074036864 to i32*)
%3 = load i32, i32* inttoptr (i64 1073790980 to i32*)
%4 = or i32 %3, 1
store i32 %4, i32* inttoptr (i64 1073790980 to i32*)
%5 = load i32, i32* inttoptr (i64 1073790980 to i32*)
%6 = and i32 %5, -3
store i32 %6, i32* inttoptr (i64 1073790980 to i32*)
store i32 11, i32* inttoptr (i64 1073790988 to i32*)
ret void
}

LLVM IR (-O2):
define void @initTimer() {
%1 = load i32, i32* inttoptr (i64 1074036864 to i32*)
%2 = or i32 %1, 128
store i32 %2, i32* inttoptr (i64 1074036864 to i32*)
%3 = load i32, i32* inttoptr (i64 1073790980 to i32*)
%4 = and i32 %3, -4
%5 = or i32 %4, 1
store i32 %5, i32* inttoptr (i64 1073790980 to i32*)
store i32 11, i32* inttoptr (i64 1073790988 to i32*)
ret void
}
int main(void) {
  int a[4][5] = {0};
  *(*a + 3 + 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x [5 x i32]]
%2 = bitcast [4 x [5 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [5 x i32]], [4 x [5 x i32]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%5 = getelementptr inbounds i32, i32* %4, i64 3
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char *pluginsRepositoryURL() { return "unknown"; }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @pluginsRepositoryURL() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @pluginsRepositoryURL() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void uart_usage(void) {
  printf("  uart - Use UART connection\n");
  printf("    uart:device[:baud[:flow]] UART server\n");
  printf("    uart:device[:baud[:flow]] UART client\n");
}


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

x86 assembly (clang, -O2):
<uart_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" uart - Use UART connection\0A\00"
@.str.1 = [43 x i8] c" uart:device[:baud[:flow]] UART server\0A\00"
@.str.2 = [43 x i8] c" uart:device[:baud[:flow]] UART client\0A\00"
define void @uart_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c" uart - Use UART connection\00"
@str.3 = [42 x i8] c" uart:device[:baud[:flow]] UART server\00"
@str.4 = [42 x i8] c" uart:device[:baud[:flow]] UART client\00"
define void @uart_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
ret void
}
int main() { return 0 + 1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char const *pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ geteuid();
struct passwd *getpwuid(int /*<<< orphan*/);
const char *get_user_name() {
  uid_t uid = geteuid();
  struct passwd *pw = getpwuid(uid);
  if (pw != NULL) {
    return pw->pw_name;
  }
  return "";
}


x86 assembly (clang, -O0):
<get_user_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <get_user_name+0x39>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <get_user_name+0x44>
lea    0xea0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_name>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1139 <get_user_name+0x19>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xec0(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [1 x i8] zeroinitializer
define i8* @get_user_name() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca %struct.passwd*
%4 = call i32 (...) @geteuid()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %3
%7 = load %struct.passwd*, %struct.passwd** %3
%8 = icmp ne %struct.passwd* %7, null
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load %struct.passwd*, %struct.passwd** %3
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i32 0, i32 0
%12 = load i8*, i8** %11
store i8* %12, i8** %1
br label %14
13: ; preds = %0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
br label %14
14: ; preds = %13, %9
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [1 x i8] zeroinitializer
define i8* @get_user_name() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %0, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
int pow(int /*<<< orphan*/, double);
double f_prime4(double x) { return (1 / 3) * pow(fabs((x - 1)), -2.0 / 3.0); }


x86 assembly (clang, -O0):
<f_prime4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
movsd  0xeb3(%rip),%xmm0
call   1040 <pow@plt>
imul   $0x0,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_prime4>:
push   %rax
addsd  0xed7(%rip),%xmm0
call   1030 <fabs@plt>
movsd  0xed2(%rip),%xmm0
mov    %eax,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f_prime4(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+00
%5 = call i32 @fabs(double %4)
%6 = call i32 @pow(i32 %5, double 0xBFE5555555555555)
%7 = mul nsw i32 0, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @f_prime4(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = tail call i32 @fabs(double %2)
%4 = tail call i32 @pow(i32 %3, double 0xBFE5555555555555)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ sortedListToBST(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  sortedListToBST(NULL);
  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)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <sortedListToBST@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sortedListToBST(i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xab() {
  Assert_real((isgraph(171) == 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_isgraph.c",
              860, ("isgraph should be 0 for 0xab"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xab>:
push   %rax
mov    $0xab,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x35c,%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 0 for 0xab\00"
define void @t_isgraph_0xab() {
%1 = call i64 @isgraph(i32 171)
%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 860, 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 0 for 0xab\00"
define void @t_isgraph_0xab() {
%1 = tail call i64 @isgraph(i32 171)
%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 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int str_len(char *f_str) {
  int count;
  for (count = 0; *(f_str + count) != '\0'; count++)
    ;
  return count;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <str_len+0x37>
jmp    1129 <str_len+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __dbg_check_enable();
int /*<<< orphan*/ port_enable();
void chSysEnable(void) {
  __dbg_check_enable();
  port_enable();
}


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

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

LLVM IR (-O0):
define void @chSysEnable() {
%1 = call i32 (...) @__dbg_check_enable()
%2 = call i32 (...) @port_enable()
ret void
}

LLVM IR (-O2):
define void @chSysEnable() {
%1 = tail call i32 (...) @__dbg_check_enable()
%2 = tail call i32 (...) @port_enable()
ret void
}
int calculateCompressedLen(int normalLen) {
  return (normalLen / 21) + ((normalLen % 21) ? 1 : 0);
}


x86 assembly (clang, -O0):
<calculateCompressedLen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x15,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x15,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateCompressedLen>:
movslq %edi,%rcx
imul   $0x30c30c31,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
imul   $0x3cf3cf3d,%ecx,%ecx
add    $0x6186186,%ecx
cmp    $0xc30c30d,%ecx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @calculateCompressedLen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 21
%5 = load i32, i32* %2
%6 = srem i32 %5, 21
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = add nsw i32 %4, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @calculateCompressedLen(i32 %0) {
%2 = sdiv i32 %0, 21
%3 = srem i32 %0, 21
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
ret i32 %6
}
void console_prompt_set(const char *prompt, const char *line) {}


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

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

LLVM IR (-O0):
define void @console_prompt_set(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @console_prompt_set(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void x400pconf_int(int argc, char *argv[]) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @x400pconf_int(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @x400pconf_int(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int threads_new_rt_prio(int /*<<< orphan*/ *, void *(*)(void *), void *,
                        int /*<<< orphan*/);
bool threads_new_rt(pthread_t *thread, void *(*start_routine)(void *),
                    void *arg) {
  return threads_new_rt_prio(thread, start_routine, arg, 0);
}


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

x86 assembly (clang, -O2):
<threads_new_rt>:
xor    %ecx,%ecx
jmp    1030 <threads_new_rt_prio@plt>

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

LLVM IR (-O2):
define i32 @threads_new_rt(i32* %0, i8* (i8*)* %1, i8* %2) {
%4 = tail call i32 @threads_new_rt_prio(i32* %0, i8* (i8*)* %1, i8* %2, i32 0)
ret i32 %4
}
/* Variables and functions */
size_t reduce(void **array, void *res, size_t len,
              void (*func)(void *, void *)) {
  size_t i;
  for (i = 0; i < len; i++) {
    func(res, array[i]);
  }
  return i;
}


x86 assembly (clang, -O0):
<reduce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1155 <reduce+0x55>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    (%rcx,%rdx,8),%rsi
call   *%rax
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1120 <reduce+0x20>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r13
test   %rdx,%rdx
je     1133 <reduce+0x33>
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r12,%rbx,8),%rsi
mov    %r15,%rdi
call   *%r14
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1120 <reduce+0x20>
mov    %r13,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @reduce(i8** nocapture %0, i8* %1, i64 %2, void (i8*, i8*)* nocapture %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %12, label %6
6: ; preds = %4, %6
%7 = phi i64 [ %10, %6 ], [ 0, %4 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void %3(i8* %1, i8* %9)
%10 = add nuw i64 %7, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %6
12: ; preds = %6, %4
ret i64 %2
}
/* Variables and functions */
int Q_strlen(char const *);
char *Q_strchr(const char *s, char c) {
  int len = Q_strlen(s);
  while (len--) {
    if (*++s == c)
      return (char *)s;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Q_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Q_strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1173 <Q_strchr+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    116e <Q_strchr+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <Q_strchr+0x6b>
jmp    112e <Q_strchr+0x1e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <Q_strlen@plt>
nopl   (%rax)
sub    $0x1,%eax
jb     1134 <Q_strchr+0x24>
lea    0x1(%rbx),%rcx
cmp    %bpl,0x1(%rbx)
mov    %rcx,%rbx
jne    1120 <Q_strchr+0x10>
jmp    1136 <Q_strchr+0x26>
xor    %ecx,%ecx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @Q_strchr(i8* %0, i8 signext %1) {
%3 = tail call i32 @Q_strlen(i8* %0)
br label %4
4: ; preds = %8, %2
%5 = phi i8* [ %0, %2 ], [ %10, %8 ]
%6 = phi i32 [ %3, %2 ], [ %9, %8 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = add nsw i32 %6, -1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %8
%14 = phi i8* [ %10, %8 ], [ null, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int scanf(char *, long *);
int /*<<< orphan*/ stdin;
void readLong1(long *variableAddress) {
  bool ret;
  do {
    ret = scanf("\n%ld", variableAddress);
    __fpurge(stdin);
  } while (ret != true);
}


x86 assembly (clang, -O0):
<readLong1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0xc(%rbp)
jne    112c <readLong1+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLong1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xecf(%rip),%r14
mov    0x2eb0(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %eax,%ebp
mov    (%r15),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1140 <readLong1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%ld\00"
@stdin = global i32 0
define void @readLong1(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
br label %4
4: ; preds = %9, %1
%5 = load i64*, i64** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %5)
store i32 %6, i32* %3
%7 = load i32, i32* @stdin
%8 = call i32 @__fpurge(i32 %7)
br label %9
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 1
br i1 %11, label %4, label %12
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%ld\00"
@stdin = global i32 0
define void @readLong1(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %0)
%4 = load i32, i32* @stdin
%5 = tail call i32 @__fpurge(i32 %4)
%6 = icmp eq i32 %3, 1
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
char *strcpy(char *dest, char *src) {
  char *dst;
  dst = dest;
  while (*src != 0) {
    *dst = *src;
    dst++;
    src++;
  }
  *dst = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <strcpy+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i8* @strcpy(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
store i8* %6, i8** %5
br label %7
7: ; preds = %12, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = load i8*, i8** %5
store i8 %14, i8* %15
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
br label %7
20: ; preds = %7
%21 = load i8*, i8** %5
store i8 0, i8* %21
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
scalar_t__ wpa_key_mgmt_wpa_ieee8021x(int);
scalar_t__ wpa_key_mgmt_wpa_psk(int);
int wpa_key_mgmt_wpa(int akm) {
  return wpa_key_mgmt_wpa_ieee8021x(akm) || wpa_key_mgmt_wpa_psk(akm);
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_wpa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <wpa_key_mgmt_wpa_ieee8021x@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <wpa_key_mgmt_wpa+0x37>
mov    -0x4(%rbp),%edi
call   1030 <wpa_key_mgmt_wpa_psk@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_wpa>:
push   %rbx
mov    %edi,%ebx
call   1040 <wpa_key_mgmt_wpa_ieee8021x@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <wpa_key_mgmt_wpa+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <wpa_key_mgmt_wpa_psk@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_wpa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @wpa_key_mgmt_wpa_ieee8021x(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @wpa_key_mgmt_wpa_psk(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_wpa(i32 %0) {
%2 = tail call i64 @wpa_key_mgmt_wpa_ieee8021x(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @wpa_key_mgmt_wpa_psk(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ IsFiqMode();
scalar_t__ IsIrqMode();
bool IsInterruptMode(void) { return IsFiqMode() || IsIrqMode(); }


x86 assembly (clang, -O0):
<IsInterruptMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <IsFiqMode@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1152 <IsInterruptMode+0x32>
mov    $0x0,%al
call   1030 <IsIrqMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsInterruptMode>:
push   %rax
xor    %eax,%eax
call   1040 <IsFiqMode@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <IsInterruptMode+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <IsIrqMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsInterruptMode() {
%1 = call i64 (...) @IsFiqMode()
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @IsIrqMode()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @IsInterruptMode() {
%1 = tail call i64 (...) @IsFiqMode()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @IsIrqMode()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ QCMD(int /*<<< orphan*/, int /*<<< orphan*/);
int QCMD_FIXED(uint32_t cmd, uint32_t type) { return (int)QCMD(cmd, type); }


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

x86 assembly (clang, -O2):
<QCMD_FIXED>:
jmp    1030 <QCMD@plt>

LLVM IR (-O0):
define i32 @QCMD_FIXED(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 = call i64 @QCMD(i32 %5, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @QCMD_FIXED(i32 %0, i32 %1) {
%3 = tail call i64 @QCMD(i32 %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int byte_order() {
  int one = 1;
  char *endptr = (char *)&one;
  return (*endptr);
}


x86 assembly (clang, -O0):
<byte_order>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @byte_order() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @byte_order() {
ret i32 1
}
/* Variables and functions */
bool nrf52_errata_212(void) { return false; }


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

x86 assembly (clang, -O2):
<nrf52_errata_212>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nrf52_errata_212() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_212() {
ret i32 0
}
int pipe(f)
int f[2];
{
  long x;
  x = _xpipe();
  if (x == -1)
    return -1;
  f[0] = x;
  f[1] = x >> 16;
  return 0;
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_xpipe@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    1140 <pipe+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <pipe+0x54>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <_xpipe@plt>
cmp    $0xffffffff,%eax
je     112e <pipe+0x1e>
mov    %eax,(%rbx)
sar    $0x10,%eax
mov    %eax,0x4(%rbx)
jmp    1133 <pipe+0x23>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @pipe(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @_xpipe()
%3 = icmp eq i32 %2, -1
br i1 %3, label %7, label %4
4: ; preds = %1
store i32 %2, i32* %0
%5 = ashr i32 %2, 16
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %8
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/iamrekcah/"
                        "cyclone/refs/heads/master/bin/genfiles/cf_flowinfo.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/iamrekcah/cyclone/refs/heads/master/bin/genfiles/cf_flowinfo.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/iamrekcah/cyclone/refs/heads/master/bin/genfiles/cf_flowinfo.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
unsigned long SIO1_readBaud32(void) { return 0; }


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

x86 assembly (clang, -O2):
<SIO1_readBaud32>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @SIO1_readBaud32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1_readBaud32() {
ret i64 0
}