xunge/DecIR huggingface dataset:
unsigned int GPMCModuleResetStatusGet(unsigned int baseAddr) {
  unsigned int resetStat;
  resetStat =
      ((*((volatile unsigned int *)(baseAddr + (0x14)))) & (0x00000001u));
  return (resetStat);
}


x86 assembly (clang, -O0):
<GPMCModuleResetStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCModuleResetStatusGet>:
add    $0x14,%edi
mov    (%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GPMCModuleResetStatusGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 20
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @GPMCModuleResetStatusGet(i32 %0) {
%2 = add i32 %0, 20
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void empty_handler(int sig) {
  if (sig == SIGINT)
    exit(0);
  return;
}


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

x86 assembly (clang, -O2):
<empty_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
je     111e <empty_handler+0xe>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ index_dump(struct index_file *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ index_file_close(struct index_file *);
struct index_file *open_index(char const *);
int /*<<< orphan*/ stdout;
void dump_index(const char *filename) {
  struct index_file *index = open_index(filename);
  index_dump(index, stdout, "");
  index_file_close(index);
}


x86 assembly (clang, -O0):
<dump_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <open_index@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdx
call   1040 <index_dump@plt>
mov    -0x10(%rbp),%rdi
call   1030 <index_file_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_index>:
push   %rbx
call   1050 <open_index@plt>
mov    %rax,%rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdx
mov    %rbx,%rdi
call   1040 <index_dump@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <index_file_close@plt>

LLVM IR (-O0):
%struct.index_file = type { i32 }
@stdout = global i32 0
@.str = [1 x i8] zeroinitializer
define void @dump_index(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.index_file*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.index_file* @open_index(i8* %4)
store %struct.index_file* %5, %struct.index_file** %3
%6 = load %struct.index_file*, %struct.index_file** %3
%7 = load i32, i32* @stdout
%8 = call i32 @index_dump(%struct.index_file* %6, i32 %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = load %struct.index_file*, %struct.index_file** %3
%10 = call i32 @index_file_close(%struct.index_file* %9)
ret void
}

LLVM IR (-O2):
%struct.index_file = type { i32 }
@stdout = global i32 0
@.str = [1 x i8] zeroinitializer
define void @dump_index(i8* %0) {
%2 = tail call %struct.index_file* @open_index(i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @index_dump(%struct.index_file* %2, i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @index_file_close(%struct.index_file* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SA1DirectIndirectLong(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op87M1(void) { STA8(SA1DirectIndirectLong(2)); }


x86 assembly (clang, -O0):
<Op87M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1DirectIndirectLong@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op87M1>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1DirectIndirectLong@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op87M1() {
%1 = call i32 @SA1DirectIndirectLong(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op87M1() {
%1 = tail call i32 @SA1DirectIndirectLong(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
unsigned long I2CMasterLineStateGet(unsigned long ulBase) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  return ((*((volatile unsigned long *)(ulBase + 0x0000002C))));
}


x86 assembly (clang, -O0):
<I2CMasterLineStateGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterLineStateGet>:
push   %rbx
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    0x2c(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @I2CMasterLineStateGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CMasterBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 44
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @I2CMasterLineStateGet(i64 %0) {
%2 = tail call i32 @I2CMasterBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("\n**Overwritten file**\n\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"\0A**Overwritten file**\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ Pfun(int, int);
float accum_ref(int k) {
  int i;
  float tmp = 0.0;
  for (i = 0; i < 1000; i++)
    tmp += Pfun(i, k);
  return tmp;
}


x86 assembly (clang, -O0):
<accum_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    115f <accum_ref+0x4f>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <Pfun@plt>
cvtsi2ss %rax,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <accum_ref+0x1a>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accum_ref>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <Pfun@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1120 <accum_ref+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @accum_ref(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %2
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = call i64 @Pfun(i32 %9, i32 %10)
%12 = sitofp i64 %11 to float
%13 = load float, float* %4
%14 = fadd float %13, %12
store float %14, float* %4
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load float, float* %4
ret float %19
}

LLVM IR (-O2):
define float @accum_ref(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi float [ 0.000000e+00, %1 ], [ %7, %2 ]
%4 = phi i32 [ 0, %1 ], [ %8, %2 ]
%5 = tail call i64 @Pfun(i32 %4, i32 %0)
%6 = sitofp i64 %5 to float
%7 = fadd float %3, %6
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %2
10: ; preds = %2
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf(" Signal %d reçu\n", sig);
  int status;
  waitpid(-1, &status, 0);
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
call   1040 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c" Signal %d re\C3\A7u\0A\00"
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @waitpid(i32 -1, i32* %3, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c" Signal %d re\C3\A7u\0A\00"
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 0)
ret void
}
void RTCritSectInitEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCritSectInitEx() {
ret void
}
int perf_sample_get_ctr_num(void) { return 2; }


x86 assembly (clang, -O0):
<perf_sample_get_ctr_num>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @perf_sample_get_ctr_num() {
ret i32 2
}

LLVM IR (-O2):
define i32 @perf_sample_get_ctr_num() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void send(char *s) {
  while (*s) {
    write(1, s, 1);
    s++;
  }
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <send+0x3a>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <send+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <send+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <send+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @send(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @write(i32 1, i8* %5, i32 1)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int si_status;
  int /*<<< orphan*/ si_pid;
};
typedef TYPE_1__ siginfo_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void sigchld_handler(int signal, siginfo_t *siginfo, void *data) {
  pid_t pid = siginfo->si_pid;
  if (siginfo->si_status == 2)
    waitpid(pid, NULL, WNOHANG);
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x2,(%rax)
jne    114f <sigchld_handler+0x3f>
mov    -0x1c(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
cmpl   $0x2,(%rsi)
jne    1128 <sigchld_handler+0x18>
mov    0x4(%rsi),%edi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <waitpid@plt>
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 1
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i32, i32* %7
%17 = load i32, i32* @WNOHANG
%18 = call i32 @waitpid(i32 %16, i32* null, i32 %17)
br label %19
19: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = load i32, i32* @WNOHANG
%11 = tail call i32 @waitpid(i32 %9, i32* null, i32 %10)
br label %12
12: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 0;
  assert(++i > 0);
  printf("%d : Huh it was supposed to be 1!!\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"%d : Huh it was supposed to be 1!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"%d : Huh it was supposed to be 1!!\0A\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_rt_sigaction(int variant_count, int *child,
                      struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


x86 assembly (clang, -O0):
<sys_rt_sigaction>:
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
call   1030 <exec_by_all_variants@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_rt_sigaction>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_rt_sigaction(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_rt_sigaction(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
int test_imm_15uint8_reg(unsigned char val) {
  return ((val) & (0x15 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_15uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x15,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_15uint8_reg>:
test   $0x15,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_15uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 21
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int move_check_result_to_queue(char *checkresult_file) {}


x86 assembly (clang, -O0):
<move_check_result_to_queue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @move_check_result_to_queue(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int M_PI;
int cos(float);
float Interpolate(float a, float b, int x) {
  float ft = x * M_PI;
  float f = (1 - cos(ft)) * 0.5;
  return a * (1 - f) + b * f;
}


x86 assembly (clang, -O0):
<Interpolate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb9(%rip),%rcx
imul   (%rcx),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe8c(%rip),%xmm2
subss  -0x14(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interpolate>:
push   %rax
mov    0x2ed0(%rip),%rax
imul   (%rax),%edi
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %edi,%xmm0
call   1030 <cos@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xeb8(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0xeb1(%rip),%xmm0
subss  %xmm1,%xmm0
movss  (%rsp),%xmm2
mulss  %xmm1,%xmm2
mulss  0x4(%rsp),%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @Interpolate(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* @M_PI
%11 = mul nsw i32 %9, %10
%12 = sitofp i32 %11 to float
store float %12, float* %7
%13 = load float, float* %7
%14 = call i32 @cos(float %13)
%15 = sub nsw i32 1, %14
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 5.000000e-01
%18 = fptrunc double %17 to float
store float %18, float* %8
%19 = load float, float* %4
%20 = load float, float* %8
%21 = fsub float 1.000000e+00, %20
%22 = load float, float* %5
%23 = load float, float* %8
%24 = fmul float %22, %23
%25 = call float @llvm.fmuladd.f32(float %19, float %21, float %24)
ret float %25
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @Interpolate(float %0, float %1, i32 %2) {
%4 = load i32, i32* @M_PI
%5 = mul nsw i32 %4, %2
%6 = sitofp i32 %5 to float
%7 = tail call i32 @cos(float %6)
%8 = sub nsw i32 1, %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 5.000000e-01
%11 = fptrunc double %10 to float
%12 = fsub float 1.000000e+00, %11
%13 = fmul float %11, %1
%14 = tail call float @llvm.fmuladd.f32(float %0, float %12, float %13)
ret float %14
}
/* Variables and functions */
int floatToRawIntBits(float);
float intBitsToFloat(int);
float mulsignf(float x, float y) {
  return intBitsToFloat(floatToRawIntBits(x) ^
                        (floatToRawIntBits(y) & (1 << 31)));
}


x86 assembly (clang, -O0):
<mulsignf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floatToRawIntBits@plt>
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <floatToRawIntBits@plt>
mov    -0xc(%rbp),%edi
and    $0x80000000,%eax
xor    %eax,%edi
call   1030 <intBitsToFloat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulsignf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
call   1040 <floatToRawIntBits@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
call   1040 <floatToRawIntBits@plt>
and    $0x80000000,%eax
xor    %eax,%ebx
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <intBitsToFloat@plt>

LLVM IR (-O0):
define float @mulsignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call i32 @floatToRawIntBits(float %5)
%7 = load float, float* %4
%8 = call i32 @floatToRawIntBits(float %7)
%9 = and i32 %8, -2147483648
%10 = xor i32 %6, %9
%11 = call float @intBitsToFloat(i32 %10)
ret float %11
}

LLVM IR (-O2):
define float @mulsignf(float %0, float %1) {
%3 = tail call i32 @floatToRawIntBits(float %0)
%4 = tail call i32 @floatToRawIntBits(float %1)
%5 = and i32 %4, -2147483648
%6 = xor i32 %5, %3
%7 = tail call float @intBitsToFloat(i32 %6)
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x3e() {
  Assert_real((isxdigit(62) == 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_isxdigit.c",
              315, ("isxdigit should be 0 for >"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for >\00"
define void @t_isxdigit_0x3e() {
%1 = tail call i64 @isxdigit(i32 62)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float floorf(float);
float fflr_native(float f) { return floorf(f); }


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

x86 assembly (clang, -O2):
<fflr_native>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define float @fflr_native(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @fflr_native(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
dmclose(dev) {}


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

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

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

LLVM IR (-O2):
define i32 @dmclose(i32 %0) {
ret i32 undef
}
int do_833() { return 833; }


x86 assembly (clang, -O0):
<do_833>:
push   %rbp
mov    %rsp,%rbp
mov    $0x341,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_833() {
ret i32 833
}

LLVM IR (-O2):
define i32 @do_833() {
ret i32 833
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int i = 5;
  if (i < 10) {
    printf("%s\n", "kleiner 10");
  } else {
    printf("%s\n", "größer 10");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1148 <main+0x38>
lea    0xec9(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1030 <printf@plt>
jmp    115b <main+0x4b>
lea    0xeb1(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"kleiner 10\00"
@.str.2 = [12 x i8] c"gr\C3\B6\C3\9Fer 10\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"kleiner 10\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void skipWhitespace(char **in) {
  while ((**in >= 9 && **in <= 13) || **in == 32)
    (*in)++;
}


x86 assembly (clang, -O0):
<skipWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jl     1133 <skipWhitespace+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
jle    1146 <skipWhitespace+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1156 <skipWhitespace+0x56>
jmp    1169 <skipWhitespace+0x69>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skipWhitespace+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipWhitespace>:
mov    (%rdi),%rax
jmp    1113 <skipWhitespace+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
lea    -0x9(%rcx),%edx
cmp    $0x5,%dl
jb     1110 <skipWhitespace+0x10>
cmp    $0x20,%cl
je     1110 <skipWhitespace+0x10>
ret

LLVM IR (-O0):
define void @skipWhitespace(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %23, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 9
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 13
br i1 %14, label %21, label %15
15: ; preds = %9, %3
%16 = load i8**, i8*** %2
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 32
br label %21
21: ; preds = %15, %9
%22 = phi i1 [ true, %9 ], [ %20, %15 ]
br i1 %22, label %23, label %27
23: ; preds = %21
%24 = load i8**, i8*** %2
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %24
br label %3
27: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @skipWhitespace(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 13, label %6
i8 12, label %6
i8 11, label %6
i8 10, label %6
i8 9, label %6
]
6: ; preds = %3, %3, %3, %3, %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
void rop3_230_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T & S;
  stk3 = ~stk3;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_230_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_230_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %9
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_230_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void RTFileReadAllFree(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileReadAllFree() {
ret void
}
int isdigit(const int c) { return (c >= (int)'0' && c <= (int)'9') ? 1 : 0; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
double sgn(double x) { return x > 0 ? 1 : x == 0 ? 0 : -1; }


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1128 <sgn+0x28>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <sgn+0x4b>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0xffffffff,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sgn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp oeq double %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 1, %5 ], [ %10, %6 ]
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @sgn(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp une double %0, 0.000000e+00
%4 = sitofp i1 %3 to double
%5 = select i1 %2, double 1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int rot(int /*<<< orphan*/, int);
int main() { return rot(0, 1); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <rot@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rot(i32 0, i32 1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ fmt;

/* Variables and functions */
int vsprintf(char *, char const *, char *);
int sprintf(char *buf, const char *fmt, ...) {
  int len = 0;
  char *args;
  (args = ((char *)&(fmt) +
           ((sizeof(fmt) + sizeof(int) - 1) & ~(sizeof(int) - 1))));
  len = vsprintf(buf, fmt, args);
  ;
  return len;
}


x86 assembly (clang, -O0):
<sprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <vsprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintf>:
push   %rax
mov    %rsi,(%rsp)
lea    0x8(%rsp),%rdx
call   1030 <vsprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%7 = bitcast i8** %4 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 8
store i8* %8, i8** %6
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i32 @vsprintf(i8* %9, i8* %10, i8* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @sprintf(i8* nocapture %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = bitcast i8** %4 to i8*
%6 = call i32 @vsprintf(i8* %0, i8* %1, i8* %5)
ret i32 %6
}
/* Variables and functions */
void *calloc(int, unsigned int);
int /*<<< orphan*/ eprint(char *, unsigned int);
void *emallocz(unsigned int size) {
  void *res = calloc(1, size);
  if (!res)
    eprint("fatal: could not malloc() %u bytes\n", size);
  return res;
}


x86 assembly (clang, -O0):
<emallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <emallocz+0x36>
mov    -0x4(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <eprint@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emallocz>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
mov    %ebp,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <emallocz+0x27>
lea    0xec0(%rip),%rdi
mov    %ebp,%esi
call   1040 <eprint@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"fatal: could not malloc() %u bytes\0A\00"
define i8* @emallocz(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 1, i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @eprint(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [36 x i8] c"fatal: could not malloc() %u bytes\0A\00"
define noalias i8* @emallocz(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprint(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t network_to_uint64(uint8_t *addr) {
  int i;
  uint64_t out = 0;
  for (i = 0; i < 8; i++) {
    out |= (uint64_t)((uint64_t)addr[i] << (56 - 8 * i));
  }
  return out;
}


x86 assembly (clang, -O0):
<network_to_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    114f <network_to_uint64+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xc(%rbp),%edx
shl    $0x3,%edx
mov    $0x38,%ecx
sub    %edx,%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <network_to_uint64+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @network_to_uint64(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i32
store i64* %0, i64** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i64*, i64** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %9, i64 %11
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = load i32, i32* %3
%16 = mul nsw i32 8, %15
%17 = sub nsw i32 56, %16
%18 = shl i32 %14, %17
%19 = load i32, i32* %4
%20 = or i32 %19, %18
store i32 %20, i32* %4
br label %21
21: ; preds = %8
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @network_to_uint64(i64* nocapture %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ isPrime(int);
int main() {
  int n;
  for (n = 1; n <= 10000; n++)
    isPrime(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jg     1149 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <isPrime@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <isPrime@plt>
add    $0x1,%ebx
cmp    $0x2711,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @isPrime(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 10001
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void cqm_test_cleanup(void) { remove("result_cqm"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"result_cqm\00"
define void @cqm_test_cleanup() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void list_free_aux(void *x, void *pfreelist) {
  void **px = x;
  void **pfree = pfreelist;
  assert(x != NULL);
  assert(pfreelist != NULL);
  ;
  *px = *pfree;
  *pfree = px;
  ;
}


x86 assembly (clang, -O0):
<list_free_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_free_aux>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    (%r14),%rax
mov    %rax,(%rbx)
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @list_free_aux(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8**, i8*** %6
%20 = load i8*, i8** %19
%21 = load i8**, i8*** %5
store i8* %20, i8** %21
%22 = load i8**, i8*** %5
%23 = bitcast i8** %22 to i8*
%24 = load i8**, i8*** %6
store i8* %23, i8** %24
ret void
}

LLVM IR (-O2):
define void @list_free_aux(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = icmp ne i8* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne i8* %1, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = load i8*, i8** %4
store i8* %11, i8** %3
store i8* %0, i8** %4
ret void
}
/* Variables and functions */
int test();
int calltest(void) { return test(); }


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

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

LLVM IR (-O0):
define i32 @calltest() {
%1 = call i32 (...) @test()
ret i32 %1
}

LLVM IR (-O2):
define i32 @calltest() {
%1 = tail call i32 (...) @test()
ret i32 %1
}