xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int is_pentagonal(int);
void is_pentagonal_test(void) {
  assert(is_pentagonal(782));
  assert(!is_pentagonal(426));
}


x86 assembly (clang, -O0):
<is_pentagonal_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30e,%edi
call   1040 <is_pentagonal@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x1aa,%edi
call   1040 <is_pentagonal@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pentagonal_test>:
push   %rax
mov    $0x30e,%edi
call   1040 <is_pentagonal@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x1aa,%edi
call   1040 <is_pentagonal@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @is_pentagonal_test() {
%1 = call i32 @is_pentagonal(i32 782)
%2 = call i32 @assert(i32 %1)
%3 = call i32 @is_pentagonal(i32 426)
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @is_pentagonal_test() {
%1 = tail call i32 @is_pentagonal(i32 782)
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @is_pentagonal(i32 426)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void testTaintSystemCall() {
  char buffer[156];
  char addr[128];
  scanf("%s", addr);
  system(addr);
  sprintf(buffer, "/bin/mail %s < /tmp/email", addr);
  system(buffer);
}


x86 assembly (clang, -O0):
<testTaintSystemCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x120(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x120(%rbp),%rdi
call   1030 <system@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <system@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTaintSystemCall>:
push   %r14
push   %rbx
sub    $0x128,%rsp
lea    0xebf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
lea    0xea8(%rip),%rsi
lea    0x80(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <system@plt>
add    $0x128,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"/bin/mail %s < /tmp/email\00"
define void @testTaintSystemCall() {
%1 = alloca [156 x i8]
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = call i32 @system(i8* %5)
%7 = getelementptr inbounds [156 x i8], [156 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [156 x i8], [156 x i8]* %1, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"/bin/mail %s < /tmp/email\00"
define void @testTaintSystemCall() {
%1 = alloca [156 x i8]
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [156 x i8], [156 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @system(i8* %4)
%7 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = call i32 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_d_sub(int /*<<< orphan*/, double, int /*<<< orphan*/,
                              int);
void mpfrdsub(mpfr_t r2, double *d, mpfr_t r1, mpfr_rnd_t *irnd) {
  double d1;
  int n1;
  d1 = *d;
  n1 = *irnd;
  mpfr_d_sub(r2, d1, r1, n1);
}


x86 assembly (clang, -O0):
<mpfrdsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x28(%rbp),%xmm0
mov    -0x14(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1030 <mpfr_d_sub@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfrdsub>:
movsd  (%rsi),%xmm0
mov    (%rcx),%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <mpfr_d_sub@plt>

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

LLVM IR (-O2):
define void @mpfrdsub(i32 %0, double* nocapture %1, i32 %2, i32* nocapture %3) {
%5 = load double, double* %1
%6 = load i32, i32* %3
%7 = tail call i32 @mpfr_d_sub(i32 %0, double %5, i32 %2, i32 %6)
ret void
}
OP(fd, ca) { op_ca(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_ca@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ca()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ saxpy(int const *, float const *, float const *, int const *,
                         float *, int const *);
void c_saxpy(const int N, const float alpha, const float *X, const int strideX,
             float *Y, const int strideY) {
  saxpy(&N, &alpha, X, &strideX, Y, &strideY);
}


x86 assembly (clang, -O0):
<c_saxpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    -0x24(%rbp),%r9
call   1030 <saxpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_saxpy>:
sub    $0x18,%rsp
mov    %rcx,%r10
mov    %rsi,%rax
mov    %edi,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %r8d,0x8(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r9
mov    %rax,%rdx
mov    %r10,%r8
call   1030 <saxpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @c_saxpy(i32 %0, float %1, float* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float*
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32
store i32 %0, i32* %7
store float %1, float* %8
store float* %2, float** %9
store i32 %3, i32* %10
store float* %4, float** %11
store i32 %5, i32* %12
%13 = load float*, float** %9
%14 = load float*, float** %11
%15 = call i32 @saxpy(i32* %7, float* %8, float* %13, i32* %10, float* %14, i32* %12)
ret void
}

LLVM IR (-O2):
define void @c_saxpy(i32 %0, float %1, float* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store float %1, float* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%11 = call i32 @saxpy(i32* %7, float* %8, float* %2, i32* %9, float* %4, i32* %10)
ret void
}
/* Variables and functions */
int NI_USUAL_PFI_SELECT(unsigned int);
unsigned NI_CDIO_SCAN_BEGIN_SRC_PFI(unsigned pfi_channel) {
  return NI_USUAL_PFI_SELECT(pfi_channel);
}


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

x86 assembly (clang, -O2):
<NI_CDIO_SCAN_BEGIN_SRC_PFI>:
jmp    1030 <NI_USUAL_PFI_SELECT@plt>

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

LLVM IR (-O2):
define i32 @NI_CDIO_SCAN_BEGIN_SRC_PFI(i32 %0) {
%2 = tail call i32 @NI_USUAL_PFI_SELECT(i32 %0)
ret i32 %2
}
void write_kernels_ic_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @write_kernels_ic_adios_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void seedRandomizer(void) { srand((unsigned)time(NULL)); }


x86 assembly (clang, -O0):
<seedRandomizer>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seedRandomizer>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @seedRandomizer() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @seedRandomizer() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  int y = 3;
  printf("SKDUHASDIJSAOIDJ HOLA %d\n", y);
  puts("HOLA ASYGHUISAOJKAOSUHJAIGSA");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"SKDUHASDIJSAOIDJ HOLA %d\0A\00"
@.str.1 = [29 x i8] c"HOLA ASYGHUISAOJKAOSUHJAIGSA\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [26 x i8] c"SKDUHASDIJSAOIDJ HOLA %d\0A\00"
@.str.1 = [29 x i8] c"HOLA ASYGHUISAOJKAOSUHJAIGSA\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
unsigned int bitcount_64_bit(unsigned long i) {
  return ((unsigned int)__builtin_popcountl(i));
}


x86 assembly (clang, -O0):
<bitcount_64_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount_64_bit>:
mov    %rdi,%rax
shr    %rax
movabs $0x5555555555555555,%rcx
55 55 55
and    %rax,%rcx
sub    %rcx,%rdi
movabs $0x3333333333333333,%rax
33 33 33
mov    %rdi,%rcx
and    %rax,%rcx
shr    $0x2,%rdi
and    %rdi,%rax
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rax,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rcx,%rdx
movabs $0x101010101010101,%rax
01 01 01
imul   %rdx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i32 @bitcount_64_bit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctpop.i64(i64 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @bitcount_64_bit(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wins_nwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wins_nwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_wins_nwstr+0x2a>
jmp    1170 <cmd_wins_nwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wins_nwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wins_nwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wins_nwstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wins_nwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int dashd(const char *file) {
  if (file == NULL)
    return 0;
  struct stat st;
  return (stat(file, &st) == 0 && S_ISDIR(st.st_mode));
}


x86 assembly (clang, -O0):
<dashd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <dashd+0x23>
movl   $0x0,-0x4(%rbp)
jmp    117f <dashd+0x5f>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    1174 <dashd+0x54>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dashd>:
test   %rdi,%rdi
je     113d <dashd+0x1d>
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1140 <dashd+0x20>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dashd(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @stat(i8* %9, %struct.stat* %4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i64 @S_ISDIR(i32 %14)
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %12, %8
%18 = phi i1 [ false, %8 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dashd(i8* %0) {
%2 = alloca %struct.stat
%3 = icmp eq i8* %0, null
br i1 %3, label %16, label %4
4: ; preds = %1
%5 = bitcast %struct.stat* %2 to i8*
%6 = call i64 @stat(i8* %0, %struct.stat* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISDIR(i32 %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %4
%15 = phi i32 [ 0, %4 ], [ %13, %8 ]
br label %16
16: ; preds = %1, %14
%17 = phi i32 [ %15, %14 ], [ 0, %1 ]
ret i32 %17
}
int mcmp(char *a, char *b, int n) {
  int ret;
  while (n--) {
    ret = *a++ - *b++;
    if (ret)
      return ret;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1166 <mcmp+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1161 <mcmp+0x61>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <mcmp+0x6d>
jmp    110f <mcmp+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcmp>:
mov    %edx,%r8d
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %edx,%r8d
je     1126 <mcmp+0x26>
movsbl (%rdi,%rdx,1),%eax
movsbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
sub    %ecx,%eax
je     1110 <mcmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %14, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %4
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %13, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %4, label %19
19: ; preds = %4, %9
%20 = phi i32 [ %17, %9 ], [ 0, %4 ]
ret i32 %20
}
unsigned int I2CMasterIntStatusEx(unsigned int baseAdd, unsigned int intFlag) {
  return (((*((volatile unsigned int *)(baseAdd + (0x28))))) & (intFlag));
}


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

x86 assembly (clang, -O2):
<I2CMasterIntStatusEx>:
mov    %esi,%eax
add    $0x28,%edi
and    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @I2CMasterIntStatusEx(i32 %0, i32 %1) {
%3 = add i32 %0, 40
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int, int);
void swapIfNeeded(int *array, int a, int b) {
  if (array[a] > array[b]) {
    swap(array, a, b);
  }
}


x86 assembly (clang, -O0):
<swapIfNeeded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    114d <swapIfNeeded+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapIfNeeded>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
movslq %edx,%rcx
cmp    (%rdi,%rcx,4),%eax
jle    1123 <swapIfNeeded+0x13>
jmp    1030 <swap@plt>
ret

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

LLVM IR (-O2):
define void @swapIfNeeded(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %6, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = tail call i32 @swap(i32* %0, i32 %1, i32 %2)
br label %13
13: ; preds = %11, %3
ret void
}
/* Variables and functions */
char *strchr(const char *s, int ch) {
  for (;; s++) {
    if (*s == (char)ch)
      return (char *)s;
    if (*s == 0)
      return (char *)NULL;
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <strchr+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114a <strchr+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1160 <strchr+0x60>
jmp    114f <strchr+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
void posix_class_neg2NP_LOWER() {}


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

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

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

LLVM IR (-O2):
define void @posix_class_neg2NP_LOWER() {
ret void
}
unsigned int asn1_simple_hdr_len(const unsigned char *p, unsigned int len) {
  if (len <= 2 || p[0] > 0x31)
    return 0;
  return (p[1] & 0x80) ? (2 + (p[1] & 0x7f)) : 2;
}


x86 assembly (clang, -O0):
<asn1_simple_hdr_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jbe    1125 <asn1_simple_hdr_len+0x25>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x31,%eax
jle    1131 <asn1_simple_hdr_len+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1170 <asn1_simple_hdr_len+0x70>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     115d <asn1_simple_hdr_len+0x5d>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x7f,%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    116a <asn1_simple_hdr_len+0x6a>
mov    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    116a <asn1_simple_hdr_len+0x6a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_simple_hdr_len>:
xor    %eax,%eax
cmp    $0x3,%esi
jb     1122 <asn1_simple_hdr_len+0x22>
cmpb   $0x31,(%rdi)
ja     1122 <asn1_simple_hdr_len+0x22>
movzbl 0x1(%rdi),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
add    $0x2,%ecx
test   $0x80,%al
mov    $0x2,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @asn1_simple_hdr_len(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ule i32 %6, 2
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp sgt i32 %12, 49
br i1 %13, label %14, label %15
14: ; preds = %8, %2
store i32 0, i32* %3
br label %32
15: ; preds = %8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, 128
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %15
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = and i32 %26, 127
%28 = add nsw i32 2, %27
br label %30
29: ; preds = %15
br label %30
30: ; preds = %29, %22
%31 = phi i32 [ %28, %22 ], [ 2, %29 ]
store i32 %31, i32* %3
br label %32
32: ; preds = %30, %14
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @asn1_simple_hdr_len(i8* nocapture %0, i32 %1) {
%3 = icmp ult i32 %1, 3
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp ugt i8 %5, 49
br i1 %6, label %16, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, 128
%12 = icmp eq i32 %11, 0
%13 = and i32 %10, 127
%14 = add nuw nsw i32 %13, 2
%15 = select i1 %12, i32 2, i32 %14
br label %16
16: ; preds = %2, %4, %7
%17 = phi i32 [ %15, %7 ], [ 0, %4 ], [ 0, %2 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ is_bigendian();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (is_bigendian()) {
    printf("System is big endian.\n");
  } else {
    printf("System is little endian.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <is_bigendian@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
jmp    115d <main+0x3d>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"System is big endian.\0A\00"
@.str.1 = [26 x i8] c"System is little endian.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @is_bigendian()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"System is little endian.\00"
@str.2 = [22 x i8] c"System is big endian.\00"
define i32 @main() {
%1 = tail call i64 (...) @is_bigendian()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
char *find_first_not(char *s, char c) {
  char *p = s;
  while (*p && *p == c) {
    ++p;
  }
  return p;
}


x86 assembly (clang, -O0):
<find_first_not>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113e <find_first_not+0x3e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114e <find_first_not+0x4e>
jmp    115f <find_first_not+0x5f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <find_first_not+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first_not>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <find_first_not+0x21>
cmp    %sil,%cl
je     1110 <find_first_not+0x10>
ret

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

LLVM IR (-O2):
define i8* @find_first_not(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = and i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %3, label %10
10: ; preds = %3
ret i8* %4
}
void nr_finalize(struct CalculationInfo *info) {}


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

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

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

LLVM IR (-O2):
%struct.CalculationInfo = type opaque
define void @nr_finalize(%struct.CalculationInfo* nocapture %0) {
ret void
}
/* Variables and functions */
float sqrt(float);
float soluc(float x, float y) {
  float r;
  r = sqrt(x * x + y * y);
  return r;
}


x86 assembly (clang, -O0):
<soluc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soluc>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <soluc+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @soluc(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %3
%8 = load float, float* %4
%9 = load float, float* %4
%10 = fmul float %8, %9
%11 = call float @llvm.fmuladd.f32(float %6, float %7, float %10)
%12 = call float @sqrt(float %11)
store float %12, float* %5
%13 = load float, float* %5
ret float %13
}

LLVM IR (-O2):
define float @soluc(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrt(float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  const char *s;
  if (argc < 2) {
    s = "Hello, world!";
  } else {
    s = argv[1];
  }
  fprintf(stdout, "%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1140 <main+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    114c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    111f <main+0xf>
lea    0xee3(%rip),%rdx
jmp    1123 <main+0x13>
mov    0x8(%rsi),%rdx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void invalid_command_msg(char *buffer) {
  printf("Invalid command: %s", buffer);
}


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

x86 assembly (clang, -O2):
<invalid_command_msg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"Invalid command: %s\00"
define void @invalid_command_msg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *reallocarray(int /*<<< orphan*/ *, size_t const, int);
int wcslen(int /*<<< orphan*/ const *);
int /*<<< orphan*/ wcsncpy(int /*<<< orphan*/ *const,
                           int /*<<< orphan*/ const *, size_t const);
wchar_t *vifm_wcsdup(const wchar_t ws[]) {
  const size_t len = wcslen(ws) + 1;
  wchar_t *const result = reallocarray(NULL, len, sizeof(wchar_t));
  if (result == NULL) {
    return NULL;
  }
  wcsncpy(result, ws, len);
  return result;
}


x86 assembly (clang, -O0):
<vifm_wcsdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wcslen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
mov    $0x4,%edx
call   1030 <reallocarray@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117c <vifm_wcsdup+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    1195 <vifm_wcsdup+0x65>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <wcsncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vifm_wcsdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <wcslen@plt>
add    $0x1,%eax
movslq %eax,%r15
xor    %edi,%edi
mov    %r15,%rsi
mov    $0x4,%edx
call   1030 <reallocarray@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1168 <vifm_wcsdup+0x38>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <wcsncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32* @vifm_wcsdup(i32* %0) {
%2 = tail call i32 @wcslen(i32* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i32* @reallocarray(i32* null, i64 %4, i32 4)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @wcsncpy(i32* %5, i32* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i32* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_epu8(int /*<<< orphan*/ const,
                                int /*<<< orphan*/ const);
__m128i apply_filter_avg(const __m128i v_a_b, const __m128i v_b_b,
                         const __m128i v_filter_b) {
  (void)v_filter_b;
  return _mm_avg_epu8(v_a_b, v_b_b);
}


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

x86 assembly (clang, -O2):
<apply_filter_avg>:
jmp    1030 <_mm_avg_epu8@plt>

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

LLVM IR (-O2):
define i32 @apply_filter_avg(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_avg_epu8(i32 %0, i32 %1)
ret i32 %4
}
int _() {}


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

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

LLVM IR (-O0):
define i32 @_() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @_() {
ret i32 undef
}
/* Variables and functions */
char *ap_cvt(double, int, int *, int *, int);
char *ap_ecvt(double arg, int ndigits, int *decpt, int *sign) {
  return (ap_cvt(arg, ndigits, decpt, sign, 1));
}


x86 assembly (clang, -O0):
<ap_ecvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <ap_cvt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_ecvt>:
mov    $0x1,%ecx
jmp    1030 <ap_cvt@plt>

LLVM IR (-O0):
define i8* @ap_ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i8* @ap_cvt(double %9, i32 %10, i32* %11, i32* %12, i32 1)
ret i8* %13
}

LLVM IR (-O2):
define i8* @ap_ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i8* @ap_cvt(double %0, i32 %1, i32* %2, i32* %3, i32 1)
ret i8* %5
}
/* Variables and functions */
int rand();
void *nextChar(void *env) {
  char ret = rand() % 256;
  return (void *)ret;
}


x86 assembly (clang, -O0):
<nextChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x9(%rbp)
movsbq -0x9(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextChar>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movsbq %al,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @nextChar(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 256
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @nextChar(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rand()
%3 = zext i32 %2 to i64
%4 = shl i64 %3, 56
%5 = ashr exact i64 %4, 56
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
extern void impl_ondisk(void) {}


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

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

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

LLVM IR (-O2):
define void @impl_ondisk() {
ret void
}
/* Variables and functions */
bool datalink_lost(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @datalink_lost() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void my_itoa(int value, char *buff, int protocol) {
  sprintf(buff, "%d", value);
}


x86 assembly (clang, -O0):
<my_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed0(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_itoa>:
mov    %rsi,%rax
mov    %edi,%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @my_itoa(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ munmap(void *, int);
void cleangpio(int fd, void *ptr1) {
  munmap(ptr1, (4 * 1024));
  close(fd);
}


x86 assembly (clang, -O0):
<cleangpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1000,%esi
call   1040 <munmap@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleangpio>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    $0x1000,%esi
call   1040 <munmap@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @cleangpio(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @munmap(i8* %5, i32 4096)
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
ret void
}

LLVM IR (-O2):
define void @cleangpio(i32 %0, i8* %1) {
%3 = tail call i32 @munmap(i8* %1, i32 4096)
%4 = tail call i32 @close(i32 %0)
ret void
}