xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ bit_array_to_byte_array(int /*<<< orphan*/ *, int,
                                           int /*<<< orphan*/ *);
int /*<<< orphan*/ byte_array_reserve(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ byte_array_to_bit_array(int /*<<< orphan*/ *, int,
                                           int /*<<< orphan*/ *);
void double_to_bit_array_diy_little(double f, uint8_t *bit_array) {
  uint8_t byte_array[8];
  bit_array_to_byte_array(bit_array, 8, byte_array);
  byte_array_reserve(byte_array, 8);
  byte_array_to_bit_array(byte_array, 8, bit_array);
}


x86 assembly (clang, -O0):
<double_to_bit_array_diy_little>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x8,%esi
call   1050 <bit_array_to_byte_array@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1040 <byte_array_reserve@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x8,%esi
call   1030 <byte_array_to_bit_array@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_bit_array_diy_little>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x8,%esi
mov    %r14,%rdx
call   1050 <bit_array_to_byte_array@plt>
mov    %r14,%rdi
mov    $0x8,%esi
call   1040 <byte_array_reserve@plt>
mov    %r14,%rdi
mov    $0x8,%esi
mov    %rbx,%rdx
call   1030 <byte_array_to_bit_array@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @double_to_bit_array_diy_little(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca [8 x i32]
store double %0, double* %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%8 = call i32 @bit_array_to_byte_array(i32* %6, i32 8, i32* %7)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%10 = call i32 @byte_array_reserve(i32* %9, i32 8)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%12 = load i32*, i32** %4
%13 = call i32 @byte_array_to_bit_array(i32* %11, i32 8, i32* %12)
ret void
}

LLVM IR (-O2):
define void @double_to_bit_array_diy_little(double %0, i32* %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @bit_array_to_byte_array(i32* %1, i32 8, i32* %5)
%7 = call i32 @byte_array_reserve(i32* %5, i32 8)
%8 = call i32 @byte_array_to_bit_array(i32* %5, i32 8, i32* %1)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int const);
int open(char const *, int);
void create_file(const char *path) {
  const int scratchfd = open(path, O_CREAT | O_WRONLY);
  assert(-1 != scratchfd);
  close(scratchfd);
}


x86 assembly (clang, -O0):
<create_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e80(%rip),%rax
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    $0xffffffff,%eax
cmp    -0xc(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_file>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    0x2e91(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
call   1040 <assert@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
define void @create_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_CREAT
%6 = load i32, i32* @O_WRONLY
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 -1, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
ret void
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
define void @create_file(i8* nocapture %0) {
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_WRONLY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @close(i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_synchronous_connection_complete_get_retransmission_interval(
    const uint8_t *event) {
  return event[13];
}


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

x86 assembly (clang, -O2):
<hci_event_synchronous_connection_complete_get_retransmission_interval>:
mov    0x34(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_synchronous_connection_complete_get_retransmission_interval(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 13
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_synchronous_connection_complete_get_retransmission_interval(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 13
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_array(int *, unsigned int const);
void print_matrix(int *matrix[], const unsigned rows, const unsigned columns) {
  unsigned i;
  for (i = 0; i < rows; i++) {
    print_array(matrix[i], columns);
  }
}


x86 assembly (clang, -O0):
<print_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1156 <print_matrix+0x46>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%esi
call   1030 <print_array@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print_matrix+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_matrix>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1145 <print_matrix+0x35>
mov    %edx,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
mov    %r14d,%esi
call   1030 <print_array@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <print_matrix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_matrix(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = load i32*, i32** %9
%11 = tail call i32 @print_array(i32* %10, i32 %2)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
int areaOfTriangle(int base, int height) { return (0.5 * base * height); }


x86 assembly (clang, -O0):
<areaOfTriangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaOfTriangle>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @areaOfTriangle(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 = sitofp i32 %5 to double
%7 = fmul double 5.000000e-01, %6
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fmul double %7, %9
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @areaOfTriangle(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 5.000000e-01
%5 = sitofp i32 %1 to double
%6 = fmul double %4, %5
%7 = fptosi double %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test() {
  int i;
  for (i = 0; i <= 41; i++) {
    {
      hash(1);
      hash(i);
    };
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x29,-0x4(%rbp)
jg     1149 <test+0x39>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @hash(i32 1)
%4 = tail call i32 @hash(i32 %2)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 42
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ stderr;
void eval_number(double value) { fprintf(stderr, "%f", value); }


x86 assembly (clang, -O0):
<eval_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_number>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%f\00"
define void @eval_number(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @stderr
%4 = load double, double* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%f\00"
define void @eval_number(double %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
double dot_product3d(double *v1, double *v2) {
  return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]);
}


x86 assembly (clang, -O0):
<dot_product3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_product3d>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot_product3d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dot_product3d(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f,
          "Usage: %s [OPTIONS] ARG\n\n"
          "Options:\n"
          " -s or --string STRING Set string.\n"
          " -n or --number NUMBER Set number.\n"
          " -h or --help          Display this message.\n"
          " -V or --version       Display the version.\n"
          "",
          applet(arg0));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <applet@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [194 x i8] c"Usage: %s [OPTIONS] ARG\0A\0AOptions:\0A -s or --string STRING Set string.\0A -n or --number NUMBER Set number.\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(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 = load i8*, i8** %4
%7 = call i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [194 x i8] c"Usage: %s [OPTIONS] ARG\0A\0AOptions:\0A -s or --string STRING Set string.\0A -n or --number NUMBER Set number.\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
long factorial(int k) {
  long r = k;
  for (k--; k > 1; k--) {
    r *= k;
  }
  return r;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    113d <factorial+0x3d>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1118 <factorial+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
movslq %edi,%rax
cmp    $0x3,%eax
jl     1121 <factorial+0x21>
mov    %edi,%ecx
add    $0x1,%rcx
xchg   %ax,%ax
lea    -0x2(%rcx),%edx
imul   %rdx,%rax
add    $0xffffffffffffffff,%rcx
cmp    $0x3,%rcx
ja     1110 <factorial+0x10>
ret

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

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
%2 = sext i32 %0 to i64
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %9, %6 ]
%8 = phi i64 [ %2, %4 ], [ %11, %6 ]
%9 = add nsw i64 %7, -1
%10 = and i64 %9, 4294967295
%11 = mul nsw i64 %8, %10
%12 = icmp ugt i64 %7, 3
br i1 %12, label %6, label %13
13: ; preds = %6, %1
%14 = phi i64 [ %2, %1 ], [ %11, %6 ]
ret i64 %14
}
/* Variables and functions */
scalar_t__ isalnum(unsigned char);
int line_contains_alnum(const char *ptr, long size) {
  while (size--)
    if (isalnum((unsigned char)*(ptr++)))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<line_contains_alnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     116b <line_contains_alnum+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     1166 <line_contains_alnum+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1172 <line_contains_alnum+0x62>
jmp    1120 <line_contains_alnum+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_contains_alnum>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r15
xor    %r14d,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %rbx,%r12
je     114e <line_contains_alnum+0x3e>
movzbl (%r15,%rbx,1),%edi
call   1030 <isalnum@plt>
add    $0x1,%rbx
test   %rax,%rax
je     1130 <line_contains_alnum+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @line_contains_alnum(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = add nsw i64 %7, -1
store i64 %8, i64* %5
%9 = icmp ne i64 %7, 0
br i1 %9, label %10, label %18
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 = call i64 @isalnum(i8 zeroext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %19
17: ; preds = %10
br label %6
18: ; preds = %6
store i32 0, i32* %3
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @line_contains_alnum(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %9, %7 ]
%5 = phi i64 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i64 %5, -1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = tail call i64 @isalnum(i8 zeroext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %3, label %13
13: ; preds = %3, %7
%14 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %14
}
/* Variables and functions */
size_t ZOBRIST_ENPASSANT_FILE_INDEX(size_t const);
size_t ZOBRIST_ENPASSANT_INDEX(int sq) {
  const size_t file = sq % 8;
  return ZOBRIST_ENPASSANT_FILE_INDEX(file);
}


x86 assembly (clang, -O0):
<ZOBRIST_ENPASSANT_INDEX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ZOBRIST_ENPASSANT_FILE_INDEX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZOBRIST_ENPASSANT_INDEX>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
sub    %eax,%edi
movslq %edi,%rdi
jmp    1030 <ZOBRIST_ENPASSANT_FILE_INDEX@plt>

LLVM IR (-O0):
define i64 @ZOBRIST_ENPASSANT_INDEX(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 8
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i64 @ZOBRIST_ENPASSANT_FILE_INDEX(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @ZOBRIST_ENPASSANT_INDEX(i32 %0) {
%2 = srem i32 %0, 8
%3 = sext i32 %2 to i64
%4 = tail call i64 @ZOBRIST_ENPASSANT_FILE_INDEX(i64 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Before: my pid is %d\n", getpid());
  fork();
  fork();
  fork();
  printf("After: my pid is %d\n", getpid());
  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)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe96(%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 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Before: my pid is %d\0A\00"
@.str.1 = [21 x i8] c"After: my pid is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getpid()
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @fork()
%9 = call i32 (...) @fork()
%10 = call i32 (...) @fork()
%11 = call i32 (...) @getpid()
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Before: my pid is %d\0A\00"
@.str.1 = [21 x i8] c"After: my pid is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @fork()
%6 = tail call i32 (...) @fork()
%7 = tail call i32 (...) @fork()
%8 = tail call i32 (...) @getpid()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pm_error(char *);
void NotifyDecodeServerReady(int const id) {
  pm_error("This version of Ppmtompeg cannot run parallel mode because "
           "it does not have socket capability.");
}


x86 assembly (clang, -O0):
<NotifyDecodeServerReady>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <pm_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [95 x i8] c"This version of Ppmtompeg cannot run parallel mode because it does not have socket capability.\00"
define void @NotifyDecodeServerReady(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pm_error(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [95 x i8] c"This version of Ppmtompeg cannot run parallel mode because it does not have socket capability.\00"
define void @NotifyDecodeServerReady(i32 %0) {
%2 = tail call i32 @pm_error(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}
int rho_ruby_get_bool(unsigned long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_get_bool(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void version(const char *target) {
  printf("%s from "
         "GPushD"
         " v"
         "2"
         "."
         "2"
         "\n",
         target);
}


x86 assembly (clang, -O0):
<version>:
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):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"%s from GPushD v2.2\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *strcpy(char *s, const char *t) {
  char *os;
  os = s;
  while ((*s++ = *t++) != 0)
    ;
  return os;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int intel_piix4_gpo_set(int, int);
int intel_piix4_gpo22_raise(void) { return intel_piix4_gpo_set(22, 1); }


x86 assembly (clang, -O0):
<intel_piix4_gpo22_raise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
mov    $0x1,%esi
call   1030 <intel_piix4_gpo_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_piix4_gpo22_raise>:
mov    $0x16,%edi
mov    $0x1,%esi
jmp    1030 <intel_piix4_gpo_set@plt>

LLVM IR (-O0):
define i32 @intel_piix4_gpo22_raise() {
%1 = call i32 @intel_piix4_gpo_set(i32 22, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intel_piix4_gpo22_raise() {
%1 = tail call i32 @intel_piix4_gpo_set(i32 22, i32 1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ print_prime_factors_iosync(int /*<<< orphan*/,
                                              int /*<<< orphan*/ *);
void print_prime_factors(uint64_t n) { print_prime_factors_iosync(n, NULL); }


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

x86 assembly (clang, -O2):
<print_prime_factors>:
xor    %esi,%esi
jmp    1030 <print_prime_factors_iosync@plt>

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

LLVM IR (-O2):
define void @print_prime_factors(i32 %0) {
%2 = tail call i32 @print_prime_factors_iosync(i32 %0, i32* null)
ret void
}
/* Variables and functions */
int resta(int, int);
int suma(int a, int b) { return resta(a, -1 * b); }


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

x86 assembly (clang, -O2):
<suma>:
neg    %esi
jmp    1030 <resta@plt>

LLVM IR (-O0):
define i32 @suma(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 -1, %6
%8 = call i32 @resta(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @resta(i32 %0, i32 %3)
ret i32 %4
}
int write_to_all_logs(char *buffer, unsigned long data_type) {}


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

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

LLVM IR (-O0):
define i32 @write_to_all_logs(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @write_to_all_logs(i8* nocapture readnone %0, i64 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ do_while_sub(char *, int);
char *malloc(int);
void do_while_Good() {
  char *a = malloc(10);
  do_while_sub(a, 10);
}


x86 assembly (clang, -O0):
<do_while_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <do_while_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_while_Good>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
mov    $0xa,%esi
pop    %rax
jmp    1040 <do_while_sub@plt>

LLVM IR (-O0):
define void @do_while_Good() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 10)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @do_while_sub(i8* %3, i32 10)
ret void
}

LLVM IR (-O2):
define void @do_while_Good() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @do_while_sub(i8* %1, i32 10)
ret void
}
void set_bitvector(unsigned int idx, int *bitvec) {
  unsigned int neighbor_id = idx;
  int dword = (neighbor_id >> 5);
  int bit = neighbor_id & 0x1F;
  unsigned int current_value = bitvec[dword];
  if ((current_value & (1 << bit)) == 0) {
    bitvec[dword] = current_value | (1 << bit);
  }
}


x86 assembly (clang, -O0):
<set_bitvector>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1165 <set_bitvector+0x65>
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bitvector>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x5,%eax
mov    (%rsi,%rax,4),%edx
mov    $0x1,%edi
shl    %cl,%edi
bt     %ecx,%edx
jae    1117 <set_bitvector+0x17>
ret
or     %edi,%edx
mov    %edx,(%rsi,%rax,4)
ret

LLVM IR (-O0):
define void @set_bitvector(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%9 = load i32, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = lshr i32 %10, 5
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = and i32 %12, 31
store i32 %13, i32* %7
%14 = load i32*, i32** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = shl i32 1, %20
%22 = and i32 %19, %21
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %33
24: ; preds = %2
%25 = load i32, i32* %8
%26 = load i32, i32* %7
%27 = shl i32 1, %26
%28 = or i32 %25, %27
%29 = load i32*, i32** %4
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
store i32 %28, i32* %32
br label %33
33: ; preds = %24, %2
ret void
}

LLVM IR (-O2):
define void @set_bitvector(i32 %0, i32* nocapture %1) {
%3 = lshr i32 %0, 5
%4 = and i32 %0, 31
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = shl nuw i32 1, %4
%9 = and i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = or i32 %7, %8
store i32 %12, i32* %6
br label %13
13: ; preds = %11, %2
ret void
}
int x30_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x30_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ out1fmt(char *, char *);
int aboutcmd(int argc, char **argv) {
  out1fmt("CBSD Project. Version %s\n", "10.2.0");
  return 0;
}


x86 assembly (clang, -O0):
<aboutcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xeed(%rip),%rsi
call   1030 <out1fmt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"CBSD Project. Version %s\0A\00"
@.str.1 = [7 x i8] c"10.2.0\00"
define i32 @aboutcmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @out1fmt(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"CBSD Project. Version %s\0A\00"
@.str.1 = [7 x i8] c"10.2.0\00"
define i32 @aboutcmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @out1fmt(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void CAN1_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<CAN1_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <CAN1_Handler+0x9>
jmp    1109 <CAN1_Handler+0x9>

x86 assembly (clang, -O2):
<CAN1_Handler>:
jmp    1100 <CAN1_Handler>

LLVM IR (-O0):
define void @CAN1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @CAN1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surfids(char *);
void fgmvwrite_surfids_(char *surfids) { gmvwrite_surfids(surfids); }


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

x86 assembly (clang, -O2):
<fgmvwrite_surfids_>:
jmp    1030 <gmvwrite_surfids@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_surfids_(i8* %0) {
%2 = tail call i32 @gmvwrite_surfids(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f();
main() {
  if (f() < 0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x0,%rax
jge    1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
test   %rax,%rax
jns    1144 <main+0x14>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @f()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int compare(int *, int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[7] = {0, 1, 2, 3, 4, 4, 5};
  int b[6] = {0, 1, 2, 3, 4, 5};
  int comp = compare(a, b, 7, 6);
  printf("%d\n", comp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x7,%edx
mov    $0x6,%ecx
call   1040 <compare@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeed(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x7,%edx
mov    $0x6,%ecx
call   1040 <compare@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 4, i32 5]
@__const.main.b = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [7 x i32]* %1 to i8*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @compare(i32* %5, i32* %6, i32 7, i32 6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_copy_from_dobldobl_systems_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(464, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_from_dobldobl_systems_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1d0,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_from_dobldobl_systems_container>:
mov    $0x1d0,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_copy_from_dobldobl_systems_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 464, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_copy_from_dobldobl_systems_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 464, i32* undef, i32* undef, double* undef)
ret i32 %1
}
int test_imm_8Fuint16_reg(unsigned short val) {
  return ((val) & (-0x8F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff71,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Fuint16_reg>:
test   $0xff71,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -143
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void INT_Excep_CAN1_RXM1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN1_RXM1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ffmpeg(int, int);
int /*<<< orphan*/ json(int, int);
int /*<<< orphan*/ math(int, int);
int native_sdk(int arg) {
  math(1, 2);
  ffmpeg(1, 2);
  json(1, 2);
  return 0;
}


x86 assembly (clang, -O0):
<native_sdk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <math@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <ffmpeg@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <json@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_sdk>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <math@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <ffmpeg@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <json@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @native_sdk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @math(i32 1, i32 2)
%4 = call i32 @ffmpeg(i32 1, i32 2)
%5 = call i32 @json(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @native_sdk(i32 %0) {
%2 = tail call i32 @math(i32 1, i32 2)
%3 = tail call i32 @ffmpeg(i32 1, i32 2)
%4 = tail call i32 @json(i32 1, i32 2)
ret i32 0
}
/* Type definitions */
struct found_file_sys {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freemem(struct found_file_sys *);
void del_found_file_sys(void *m) {
  struct found_file_sys *ffs = (struct found_file_sys *)m;
  freemem(ffs);
}


x86 assembly (clang, -O0):
<del_found_file_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <freemem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_found_file_sys>:
jmp    1030 <freemem@plt>

LLVM IR (-O0):
%struct.found_file_sys = type { i32 }
define void @del_found_file_sys(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.found_file_sys*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.found_file_sys*
store %struct.found_file_sys* %5, %struct.found_file_sys** %3
%6 = load %struct.found_file_sys*, %struct.found_file_sys** %3
%7 = call i32 @freemem(%struct.found_file_sys* %6)
ret void
}

LLVM IR (-O2):
%struct.found_file_sys = type { i32 }
define void @del_found_file_sys(i8* %0) {
%2 = bitcast i8* %0 to %struct.found_file_sys*
%3 = tail call i32 @freemem(%struct.found_file_sys* %2)
ret void
}