xunge/DecIR huggingface dataset:
int test_imm_1Euint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x1E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Euint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 30
%6 = icmp ne i64 %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_1Euint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 30
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ pow(double, int);
double sqrt(scalar_t__);
double dist(double x0, double y0, double x1, double y1) {
  return sqrt(pow((x1 - x0), 2) + pow((y1 - y0), 2));
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm1,(%rsp)
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @dist(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = call i64 @pow(double %11, i32 2)
%13 = load double, double* %8
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = call i64 @pow(double %15, i32 2)
%17 = add nsw i64 %12, %16
%18 = call double @sqrt(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @dist(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = tail call i64 @pow(double %5, i32 2)
%7 = fsub double %3, %1
%8 = tail call i64 @pow(double %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call double @sqrt(i64 %9)
ret double %10
}
int test6(unsigned i, unsigned power) {
  unsigned x = (i < (1 << power) ? i : 0);
  return x != 3 ? 1 << power : i;
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jae    112c <test6+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <test6+0x36>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <test6+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     1158 <test6+0x58>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <test6+0x5e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
cmp    $0x2,%esi
mov    %edx,%eax
cmovae %edi,%eax
cmp    $0x3,%edi
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @test6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = icmp ult i32 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %10
%14 = phi i32 [ %11, %10 ], [ 0, %12 ]
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %4
%19 = shl i32 1, %18
br label %22
20: ; preds = %13
%21 = load i32, i32* %3
br label %22
22: ; preds = %20, %17
%23 = phi i32 [ %19, %17 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @test6(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = icmp eq i32 %0, 3
%5 = icmp ugt i32 %1, 1
%6 = and i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %3
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_SINGLESTEP;
int /*<<< orphan*/ perror(char *);
long ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
            int /*<<< orphan*/ *);
int proc_step(pid_t pid) {
  long ret;
  ret = ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL);
  if (ret == -1) {
    perror("ptrace singlestep");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<proc_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    116a <proc_step+0x4a>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <proc_step+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_step>:
push   %rbx
mov    %edi,%esi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0xffffffffffffffff,%rax
je     1141 <proc_step+0x21>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%ebx
jmp    113d <proc_step+0x1d>

LLVM IR (-O0):
@PTRACE_SINGLESTEP = global i32 0
@.str = [18 x i8] c"ptrace singlestep\00"
define i32 @proc_step(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* @PTRACE_SINGLESTEP
%6 = load i32, i32* %3
%7 = call i64 @ptrace(i32 %5, i32 %6, i32* null, i32* null)
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@PTRACE_SINGLESTEP = global i32 0
@.str = [18 x i8] c"ptrace singlestep\00"
define i32 @proc_step(i32 %0) {
%2 = load i32, i32* @PTRACE_SINGLESTEP
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32* null, i32* null)
%4 = icmp eq i64 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
double aleutil_minor(double A[3][3], int i, int j) {}


x86 assembly (clang, -O0):
<aleutil_minor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @aleutil_minor([3 x double]* %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca [3 x double]*
%6 = alloca i32
%7 = alloca i32
store [3 x double]* %0, [3 x double]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load double, double* %4
ret double %8
}

LLVM IR (-O2):
define double @aleutil_minor([3 x double]* nocapture readnone %0, i32 %1, i32 %2) {
ret double undef
}
/* Variables and functions */
int /*<<< orphan*/ doexit(int /*<<< orphan*/);
trap() {
  {};
  doexit(0);
}


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

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

LLVM IR (-O0):
define i32 @trap() {
%1 = alloca i32
%2 = call i32 @doexit(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @trap() {
%1 = tail call i32 @doexit(i32 0)
ret i32 undef
}
float c_to_f(float value) { return value * 1.8f + 32; }


x86 assembly (clang, -O0):
<c_to_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_to_f>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @c_to_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %4
}

LLVM IR (-O2):
define float @c_to_f(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %2
}
/* Variables and functions */
int memcmp(void *, void *, int);
int cmp_addr(void *addr1, void *addr2, int addrlen) {
  return memcmp(addr1, addr2, addrlen);
}


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

x86 assembly (clang, -O2):
<cmp_addr>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_addr(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
int stm_is_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stm_is_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ start_server(int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc != 2) {
    usage();
    return 0;
  }
  start_server(atoi(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
je     1163 <main+0x33>
mov    $0x0,%al
call   1030 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    117e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <start_server@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1148 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <start_server@plt>
jmp    114f <main+0x1f>
xor    %eax,%eax
call   1030 <usage@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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = call i32 @start_server(i32 %14)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @start_server(i32 %9)
br label %11
11: ; preds = %6, %4
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fexists(char const *);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *getFile(const char *fname, const char *mode) {
  if (0 && fexists(fname)) {
    fprintf(stderr, "\t-> File exists: %s exiting...\n", fname);
    exit(0);
  }
  FILE *fp = NULL;
  if (NULL == (fp = fopen(fname, mode))) {
    fprintf(stderr, "\t-> Error opening File handle for file:%s\n", fname);
    exit(0);
  }
  return fp;
}


x86 assembly (clang, -O0):
<getFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1187 <getFile+0x57>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe85(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFile>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <getFile+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"\09-> Error opening File handle for file:%s\0A\00"
define i32* @getFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32* null, i32** %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* null, %8
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"\09-> Error opening File handle for file:%s\0A\00"
define noalias i32* @getFile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t convert_seconds_to_nsec(double seconds) {
  return (uint64_t)(seconds * 1000000000.0);
}


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

x86 assembly (clang, -O2):
<convert_seconds_to_nsec>:
mulsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @convert_seconds_to_nsec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+09
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @convert_seconds_to_nsec(double %0) {
%2 = fmul double %0, 1.000000e+09
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ catch_sig();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ unblock_sig();
void sig_catcher(int sig) {
  static int depth = 0;
  unblock_sig();
  catch_sig();
  printf("Got sig, depth = %d\n", depth++);
  while (1) {
    printf("Sleep in catcher\n");
    sleep(10);
  }
}


x86 assembly (clang, -O0):
<sig_catcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <unblock_sig@plt>
mov    $0x0,%al
call   1040 <catch_sig@plt>
mov    0x2ee5(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2eda(%rip)
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
jmp    1178 <sig_catcher+0x38>

x86 assembly (clang, -O2):
<sig_catcher>:
push   %rbx
xor    %eax,%eax
call   1060 <unblock_sig@plt>
xor    %eax,%eax
call   1050 <catch_sig@plt>
mov    0x2ee7(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2ede(%rip)
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe92(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
jmp    1190 <sig_catcher+0x40>

LLVM IR (-O0):
@sig_catcher.depth = internal global i32 0
@.str = [21 x i8] c"Got sig, depth = %d\0A\00"
@.str.1 = [18 x i8] c"Sleep in catcher\0A\00"
define void @sig_catcher(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @unblock_sig()
%4 = call i32 (...) @catch_sig()
%5 = load i32, i32* @sig_catcher.depth
%6 = add nsw i32 %5, 1
store i32 %6, i32* @sig_catcher.depth
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %8
8: ; preds = %1, %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @sleep(i32 10)
br label %8
}

LLVM IR (-O2):
@sig_catcher.depth = internal unnamed_addr global i32 0
@.str = [21 x i8] c"Got sig, depth = %d\0A\00"
@str = [17 x i8] c"Sleep in catcher\00"
define void @sig_catcher(i32 %0) {
%2 = tail call i32 (...) @unblock_sig()
%3 = tail call i32 (...) @catch_sig()
%4 = load i32, i32* @sig_catcher.depth
%5 = add nsw i32 %4, 1
store i32 %5, i32* @sig_catcher.depth
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %7
7: ; preds = %1, %7
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @sleep(i32 10)
br label %7
}
/* Variables and functions */
int isprime(int a) {
  int i;
  for (i = 2; i < a; i++)
    if (a % i == 0)
      return false;
  return true;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isprime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isprime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isprime+0x50>
jmp    113b <isprime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isprime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isprime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isprime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
int string_match(const char *s1, const char *s2) {
  for (; *s2; ++s2)
    if (*s1++ != *s2) {
      return 0;
    }
  return 1;
}


x86 assembly (clang, -O0):
<string_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <string_match+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1146 <string_match+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1163 <string_match+0x63>
jmp    114b <string_match+0x4b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <string_match+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_match>:
mov    (%rsi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1122 <string_match+0x22>
xor    %edx,%edx
nopl   (%rax)
cmp    %cl,(%rdi,%rdx,1)
jne    1123 <string_match+0x23>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <string_match+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_match(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %6
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i32 [ 1, %2 ], [ 1, %11 ], [ 0, %5 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ str_index_dfl(char const *, char, int);
ssize_t str_index(const char *s, char c) { return str_index_dfl(s, c, -1); }


x86 assembly (clang, -O0):
<str_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%edx
movsbl -0x9(%rbp),%esi
call   1030 <str_index_dfl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_index>:
mov    $0xffffffff,%edx
jmp    1030 <str_index_dfl@plt>

LLVM IR (-O0):
define i32 @str_index(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @str_index_dfl(i8* %5, i8 signext %6, i32 -1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @str_index(i8* %0, i8 signext %1) {
%3 = tail call i32 @str_index_dfl(i8* %0, i8 signext %1, i32 -1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_c_empty_comments() {
  test_parser_verify_parse(test_parser_sourcefile("c", " //\n"), "c", "",
                           "//\n", 0);
}


x86 assembly (clang, -O0):
<test_c_empty_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeb5(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_c_empty_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"c\00"
@.str.1 = [5 x i8] c" //\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"//\0A\00"
define void @test_c_empty_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
@.str.1 = [5 x i8] c" //\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"//\0A\00"
define void @test_c_empty_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void _feinitialise(void) {}


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

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

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

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

/* Variables and functions */
void EMACTimestampEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000700))) |= 0x00000001;
  if (!((*((volatile uint32_t *)(ui32Base + 0x00000700))) & 0x00000004)) {
    (*((volatile uint32_t *)(ui32Base + 0x00000700))) |= 0x00000004;
  }
}


x86 assembly (clang, -O0):
<EMACTimestampEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x700,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x700,%eax
cltq
mov    (%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
jne    1141 <EMACTimestampEnable+0x41>
mov    -0x4(%rbp),%eax
add    $0x700,%eax
cltq
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampEnable>:
movslq %edi,%rax
orl    $0x1,0x700(%rax)
testl  $0x4,0x700(%rax)
jne    111d <EMACTimestampEnable+0x1d>
orl    $0x4,0x700(%rax)
ret

LLVM IR (-O0):
define void @EMACTimestampEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1792
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1792
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, 4
%15 = icmp ne i32 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %1
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1792
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load volatile i32, i32* %20
%22 = or i32 %21, 4
store volatile i32 %22, i32* %20
br label %23
23: ; preds = %16, %1
ret void
}

LLVM IR (-O2):
define void @EMACTimestampEnable(i32 %0) {
%2 = add nsw i32 %0, 1792
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
%7 = load volatile i32, i32* %4
%8 = and i32 %7, 4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load volatile i32, i32* %4
%12 = or i32 %11, 4
store volatile i32 %12, i32* %4
br label %13
13: ; preds = %10, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ athrs26_phy_setup(int);
void ag7240_phy_setup(int unit) {
  { athrs26_phy_setup(unit); }
}


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

x86 assembly (clang, -O2):
<ag7240_phy_setup>:
jmp    1030 <athrs26_phy_setup@plt>

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

LLVM IR (-O2):
define void @ag7240_phy_setup(i32 %0) {
%2 = tail call i32 @athrs26_phy_setup(i32 %0)
ret void
}
void debug_dma_dump_mappings(struct device *dev) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @debug_dma_dump_mappings(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @debug_dma_dump_mappings(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key(unsigned char key, int x, int y) {
  if (key == 27)
    exit(0);
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    1138 <key+0x28>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
cmp    $0x1b,%dil
je     1117 <key+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
char *mmalloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *ok(void) {
  char *output = mmalloc(4);
  strcpy(output, "ok\n");
  return output;
}


x86 assembly (clang, -O0):
<ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <mmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok>:
push   %rbx
mov    $0x4,%edi
call   1040 <mmalloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"ok\0A\00"
define i8* @ok() {
%1 = tail call i8* @mmalloc(i32 4)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char const *, char const *);
int osapi_is_inpath(const char *rpath, const char *file) {
  if (strstr(file, rpath) == NULL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<osapi_is_inpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
jne    1143 <osapi_is_inpath+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <osapi_is_inpath+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osapi_is_inpath>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @osapi_is_inpath(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t PackRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
  return r | (g << 8) | (b << 16) | (a << 24);
}


x86 assembly (clang, -O0):
<PackRGBA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PackRGBA>:
mov    %ecx,%eax
shl    $0x8,%esi
or     %edi,%esi
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @PackRGBA(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = shl i32 %10, 8
%12 = or i32 %9, %11
%13 = load i32, i32* %7
%14 = shl i32 %13, 16
%15 = or i32 %12, %14
%16 = load i32, i32* %8
%17 = shl i32 %16, 24
%18 = or i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @PackRGBA(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 8
%6 = or i32 %5, %0
%7 = shl i32 %2, 16
%8 = or i32 %6, %7
%9 = shl i32 %3, 24
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  for (;;) {
    sleep(1000);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @sleep(i32 1000)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 1000)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xf0() {
  Assert_real((isgraph(240) == 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",
              1205, ("isgraph should be 0 for 0xf0"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xf0>:
push   %rax
mov    $0xf0,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b5,%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 0xf0\00"
define void @t_isgraph_0xf0() {
%1 = call i64 @isgraph(i32 240)
%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 1205, 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 0xf0\00"
define void @t_isgraph_0xf0() {
%1 = tail call i64 @isgraph(i32 240)
%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 1205, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t arrlen(char *arr) {
  size_t len = 0;
  while (arr[len++] != '\0')
    continue;
  return (len - 1);
}


x86 assembly (clang, -O0):
<arrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1135 <arrlen+0x35>
jmp    1110 <arrlen+0x10>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <arrlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @arrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %3
}
char bin2hex(int val) {
  int i;
  i = val & 0x0F;
  if (i >= 0 && i < 10)
    return '0' + i;
  else
    return 'A' + (i - 10);
}


x86 assembly (clang, -O0):
<bin2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1132 <bin2hex+0x32>
cmpl   $0xa,-0xc(%rbp)
jge    1132 <bin2hex+0x32>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    113e <bin2hex+0x3e>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin2hex>:
and    $0xf,%edi
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
cmp    $0xa,%edi
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @bin2hex(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ult i32 %2, 10
%4 = trunc i32 %2 to i8
%5 = or i8 %4, 48
%6 = add nuw nsw i8 %4, 55
%7 = select i1 %3, i8 %5, i8 %6
ret i8 %7
}
/* Variables and functions */
long rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
long int randon(long int min, long int max) {
  long int num;
  srand((unsigned)time(NULL));
  num = min + (rand() % max);
  return num;
}


x86 assembly (clang, -O0):
<randon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
cqto
idivq  -0x10(%rbp)
mov    -0x20(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randon>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1165 <randon+0x35>
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    116b <randon+0x3b>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @randon(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = call i32 @srand(i32 %7)
%9 = load i64, i64* %3
%10 = call i64 (...) @rand()
%11 = load i64, i64* %4
%12 = srem i64 %10, %11
%13 = add nsw i64 %9, %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
define i64 @randon(i64 %0, i64 %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i64 (...) @rand()
%7 = srem i64 %6, %1
%8 = add nsw i64 %7, %0
ret i64 %8
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int trigger_time_katcp(struct katcp_dispatch *, void *, int /*<<< orphan*/);
int trigger_at_time_katcp(struct katcp_dispatch *d, void *data) {
  return trigger_time_katcp(d, data, 0);
}


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

x86 assembly (clang, -O2):
<trigger_at_time_katcp>:
xor    %edx,%edx
jmp    1030 <trigger_time_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i32 @trigger_at_time_katcp(%struct.katcp_dispatch* %0, i8* %1) {
%3 = alloca %struct.katcp_dispatch*
%4 = alloca i8*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %3
store i8* %1, i8** %4
%5 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %3
%6 = load i8*, i8** %4
%7 = call i32 @trigger_time_katcp(%struct.katcp_dispatch* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @trigger_at_time_katcp(%struct.katcp_dispatch* %0, i8* %1) {
%3 = tail call i32 @trigger_time_katcp(%struct.katcp_dispatch* %0, i8* %1, i32 0)
ret i32 %3
}
void strike_on(void) {}


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

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

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

LLVM IR (-O2):
define void @strike_on() {
ret void
}
/* Variables and functions */
unsigned int __builtin_arm_get_fpscr();
int /*<<< orphan*/ __builtin_arm_set_fpscr(unsigned int volatile);
void test_fpscr() {
  volatile unsigned int status = __builtin_arm_get_fpscr();
  __builtin_arm_set_fpscr(status);
}


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

x86 assembly (clang, -O2):
<test_fpscr>:
push   %rax
xor    %eax,%eax
call   1030 <__builtin_arm_get_fpscr@plt>
mov    %eax,0x4(%rsp)
mov    0x4(%rsp),%edi
pop    %rax
jmp    1040 <__builtin_arm_set_fpscr@plt>

LLVM IR (-O0):
define void @test_fpscr() {
%1 = alloca i32
%2 = call i32 (...) @__builtin_arm_get_fpscr()
store volatile i32 %2, i32* %1
%3 = load volatile i32, i32* %1
%4 = call i32 @__builtin_arm_set_fpscr(i32 %3)
ret void
}

LLVM IR (-O2):
define void @test_fpscr() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @__builtin_arm_get_fpscr()
store volatile i32 %3, i32* %1
%4 = load volatile i32, i32* %1
%5 = tail call i32 @__builtin_arm_set_fpscr(i32 %4)
ret void
}