xunge/DecIR huggingface dataset:
int mul_digit(char a, char b, int carry, char *c) {
  int res;
  res = (a - '0') * (b - '0') + carry;
  carry = res / 10;
  *c = res % 10 + '0';
  return carry;
}


x86 assembly (clang, -O0):
<mul_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
movsbl -0x2(%rbp),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_digit>:
add    $0xffffffd0,%edi
add    $0xffffffd0,%esi
imul   %edi,%esi
add    %edx,%esi
movslq %esi,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%edx
add    $0x30,%dl
mov    %dl,(%rcx)
ret

LLVM IR (-O0):
define i32 @mul_digit(i8 signext %0, i8 signext %1, i32 %2, i8* %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
%16 = mul nsw i32 %12, %15
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
store i32 %18, i32* %9
%19 = load i32, i32* %9
%20 = sdiv i32 %19, 10
store i32 %20, i32* %7
%21 = load i32, i32* %9
%22 = srem i32 %21, 10
%23 = add nsw i32 %22, 48
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %8
store i8 %24, i8* %25
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @mul_digit(i8 signext %0, i8 signext %1, i32 %2, i8* nocapture writeonly %3) {
%5 = sext i8 %0 to i32
%6 = add nsw i32 %5, -48
%7 = sext i8 %1 to i32
%8 = add nsw i32 %7, -48
%9 = mul nsw i32 %8, %6
%10 = add nsw i32 %9, %2
%11 = sdiv i32 %10, 10
%12 = srem i32 %10, 10
%13 = trunc i32 %12 to i8
%14 = add nsw i8 %13, 48
store i8 %14, i8* %3
ret i32 %11
}
/* Variables and functions */
double sla_drange_(double *);
double slaDrange(double angle) {
  double ANGLE;
  double result;
  ANGLE = angle;
  result = sla_drange_(&ANGLE);
  return result;
}


x86 assembly (clang, -O0):
<slaDrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <sla_drange_@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDrange>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_drange_@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @slaDrange(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
%6 = call double @sla_drange_(double* %3)
store double %6, double* %4
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @slaDrange(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double %0, double* %2
%4 = call double @sla_drange_(double* %2)
ret double %4
}
/* Type definitions */
struct ibv_cq {
  int dummy;
};

/* Variables and functions */
int ibv_destroy_cq(struct ibv_cq *);
int mlx4_glue_destroy_cq(struct ibv_cq *cq) { return ibv_destroy_cq(cq); }


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

x86 assembly (clang, -O2):
<mlx4_glue_destroy_cq>:
jmp    1030 <ibv_destroy_cq@plt>

LLVM IR (-O0):
%struct.ibv_cq = type { i32 }
define i32 @mlx4_glue_destroy_cq(%struct.ibv_cq* %0) {
%2 = alloca %struct.ibv_cq*
store %struct.ibv_cq* %0, %struct.ibv_cq** %2
%3 = load %struct.ibv_cq*, %struct.ibv_cq** %2
%4 = call i32 @ibv_destroy_cq(%struct.ibv_cq* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.ibv_cq = type { i32 }
define i32 @mlx4_glue_destroy_cq(%struct.ibv_cq* %0) {
%2 = tail call i32 @ibv_destroy_cq(%struct.ibv_cq* %0)
ret i32 %2
}
int is_v1(const char *buf) {
  return buf[0] == 'T' && buf[1] == 'A' && buf[2] == 'G';
}


x86 assembly (clang, -O0):
<is_v1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x54,%ecx
mov    %al,-0x9(%rbp)
jne    1144 <is_v1+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x9(%rbp)
jne    1144 <is_v1+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x47,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_v1>:
xor    %eax,%eax
cmpb   $0x54,(%rdi)
jne    1116 <is_v1+0x16>
cmpb   $0x41,0x1(%rdi)
jne    1116 <is_v1+0x16>
xor    %eax,%eax
cmpb   $0x47,0x2(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_v1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 84
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 65
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 71
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %4, %1
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
void uint64Clear(uint64_t *data) { *data = 0; }


x86 assembly (clang, -O0):
<uint64Clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint64Clear>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @uint64Clear(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
store i64 0, i64* %3
ret void
}

LLVM IR (-O2):
define void @uint64Clear(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
void clean_name_for_stat(char *name) { (void)name; }


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

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

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

LLVM IR (-O2):
define void @clean_name_for_stat(i8* nocapture %0) {
ret void
}
unsigned long long sched_clock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @sched_clock() {
ret i64 0
}
/* Type definitions */
typedef scalar_t__ u_char;

/* Variables and functions */
int /*<<< orphan*/ cd_present();
long raw_track_length(scalar_t__);
unsigned long cd_track_length_frames(u_char trknum) {
  long frames = raw_track_length(trknum);
  long prevframes = raw_track_length(trknum - 1);
  if (!cd_present())
    return 0;
  frames -= prevframes;
  return frames;
}


x86 assembly (clang, -O0):
<cd_track_length_frames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <raw_track_length@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <raw_track_length@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <cd_present@plt>
cmp    $0x0,%eax
jne    1167 <cd_track_length_frames+0x47>
movq   $0x0,-0x8(%rbp)
jmp    117e <cd_track_length_frames+0x5e>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_track_length_frames>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <raw_track_length@plt>
mov    %rax,%r14
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rdi
call   1030 <raw_track_length@plt>
mov    %rax,%r15
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <cd_present@plt>
sub    %r15,%r14
test   %eax,%eax
cmovne %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @cd_track_length_frames(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = call i64 @raw_track_length(i64 %6)
store i64 %7, i64* %4
%8 = load i64, i64* %3
%9 = sub nsw i64 %8, 1
%10 = call i64 @raw_track_length(i64 %9)
store i64 %10, i64* %5
%11 = call i32 (...) @cd_present()
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %1
store i64 0, i64* %2
br label %19
14: ; preds = %1
%15 = load i64, i64* %5
%16 = load i64, i64* %4
%17 = sub nsw i64 %16, %15
store i64 %17, i64* %4
%18 = load i64, i64* %4
store i64 %18, i64* %2
br label %19
19: ; preds = %14, %13
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @cd_track_length_frames(i64 %0) {
%2 = tail call i64 @raw_track_length(i64 %0)
%3 = add nsw i64 %0, -1
%4 = tail call i64 @raw_track_length(i64 %3)
%5 = tail call i32 (...) @cd_present()
%6 = icmp eq i32 %5, 0
%7 = sub nsw i64 %2, %4
%8 = select i1 %6, i64 0, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ xlFmtError(char *);
void checkizero(long iarg) {
  if (iarg == 0)
    xlFmtError("division by zero");
}


x86 assembly (clang, -O0):
<checkizero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <checkizero+0x23>
lea    0xed2(%rip),%rdi
call   1030 <xlFmtError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkizero>:
test   %rdi,%rdi
je     1116 <checkizero+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <xlFmtError@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"division by zero\00"
define void @checkizero(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @xlFmtError(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"division by zero\00"
define void @checkizero(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @xlFmtError(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double genRandom(double Low, double High) {
  return ((double)rand() / RAND_MAX) * (High - Low) + Low;
}


x86 assembly (clang, -O0):
<genRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genRandom>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @genRandom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %8, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @genRandom(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
void SV_Frame(double time) {}


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

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

LLVM IR (-O0):
define void @SV_Frame(double %0) {
%2 = alloca double
store double %0, double* %2
ret void
}

LLVM IR (-O2):
define void @SV_Frame(double %0) {
ret void
}
void sysfs_remove_group(struct kobject *x, struct attribute_group *y) {
  return;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define void @sysfs_remove_group(%struct.kobject* %0, %struct.attribute_group* %1) {
%3 = alloca %struct.kobject*
%4 = alloca %struct.attribute_group*
store %struct.kobject* %0, %struct.kobject** %3
store %struct.attribute_group* %1, %struct.attribute_group** %4
ret void
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define void @sysfs_remove_group(%struct.kobject* nocapture %0, %struct.attribute_group* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *IntToStr(int v) {
  char *buffer = (char *)malloc(32);
  sprintf(buffer, "%i", v);
  return buffer;
}


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

x86 assembly (clang, -O2):
<IntToStr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i8* @IntToStr(i32 %0) {
%2 = tail call i64 @malloc(i32 32)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %3
}
int lib2t12(void) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @lib2t12() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ IsElmLL(int /*<<< orphan*/);
int /*<<< orphan*/ PrevElmLL(void *);
int IsFirstElmLL(void *el) { return !IsElmLL(PrevElmLL(el)); }


x86 assembly (clang, -O0):
<IsFirstElmLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <PrevElmLL@plt>
mov    %eax,%edi
call   1030 <IsElmLL@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsFirstElmLL>:
push   %rax
call   1040 <PrevElmLL@plt>
mov    %eax,%edi
call   1030 <IsElmLL@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsFirstElmLL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @PrevElmLL(i8* %3)
%5 = call i32 @IsElmLL(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @IsFirstElmLL(i8* %0) {
%2 = tail call i32 @PrevElmLL(i8* %0)
%3 = tail call i32 @IsElmLL(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
const char *Show_Definition(void) {
  return "struct Show {\n"
         "  int (*show)(var, var, int);\n"
         "  int (*look)(var, var, int);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [78 x i8] c"struct Show {\0A int (*show)(var, var, int);\0A int (*look)(var, var, int);\0A};\0A\00"
define i8* @Show_Definition() {
ret i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [78 x i8] c"struct Show {\0A int (*show)(var, var, int);\0A int (*look)(var, var, int);\0A};\0A\00"
define i8* @Show_Definition() {
ret i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct ds_var_field {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ds_var_field_free(struct ds_var_field *);
void _exit_clean(struct ds_var_field *var_field) {
  ds_var_field_free(var_field);
}


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

x86 assembly (clang, -O2):
<_exit_clean>:
jmp    1030 <ds_var_field_free@plt>

LLVM IR (-O0):
%struct.ds_var_field = type { i32 }
define void @_exit_clean(%struct.ds_var_field* %0) {
%2 = alloca %struct.ds_var_field*
store %struct.ds_var_field* %0, %struct.ds_var_field** %2
%3 = load %struct.ds_var_field*, %struct.ds_var_field** %2
%4 = call i32 @ds_var_field_free(%struct.ds_var_field* %3)
ret void
}

LLVM IR (-O2):
%struct.ds_var_field = type { i32 }
define void @_exit_clean(%struct.ds_var_field* %0) {
%2 = tail call i32 @ds_var_field_free(%struct.ds_var_field* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ remove_pidfile();
void sig_handler_child(int sig) {
  remove_pidfile();
  exit(0);
}


x86 assembly (clang, -O0):
<sig_handler_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <remove_pidfile@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler_child>:
push   %rax
xor    %eax,%eax
call   1030 <remove_pidfile@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sig_handler_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @remove_pidfile()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sig_handler_child(i32 %0) {
%2 = tail call i32 (...) @remove_pidfile()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_MultiplyMat4_init(void) {
  _hmt_register_covercase("HMM_MultiplyMat4", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_MultiplyMat4_init>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"HMM_MultiplyMat4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyMat4_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"HMM_MultiplyMat4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyMat4_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_DBint32_reg(int val) { return ((val) & (0xDB << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_DBint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xdb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DBint32_reg(i32 %0) {
%2 = and i32 %0, 219
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int lps(char *);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  char seq[] = "BBABCBABACBAB";
  int n = strlen(seq);
  printf("The length of the LPS is %d\n", lps(seq));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
lea    -0x12(%rbp),%rdi
call   1050 <lps@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x42414243414241,%rax
mov    %rax,0x6(%rsp)
movabs $0x4241424342414242,%rax
42 41 42
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
call   1050 <lps@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.seq = [14 x i8] c"BBABCBABACBAB\00"
@.str = [29 x i8] c"The length of the LPS is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [14 x i8]* %2 to i8*
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%8 = call i32 @lps(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.seq = [14 x i8] c"BBABCBABACBAB\00"
@.str = [29 x i8] c"The length of the LPS is %d\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @lps(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int isInRange(char c) { return (c >= 97 && c <= 122); }


x86 assembly (clang, -O0):
<isInRange>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isInRange+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInRange>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isInRange(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isInRange(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int ThreeAndFiveMultiples(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int max;
  int result;
  printf("Insert your max: ");
  scanf("%d", &max);
  result = ThreeAndFiveMultiples(max);
  printf("This is your result: %d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <ThreeAndFiveMultiples@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <ThreeAndFiveMultiples@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Insert your max: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"This is your result: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @ThreeAndFiveMultiples(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Insert your max: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"This is your result: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @ThreeAndFiveMultiples(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *child(void *ignored) {
  sleep(3);
  printf("Child is done sleeping 3 seconds.\n");
  return NULL;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rax
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Child is done sleeping 3 seconds.\0A\00"
define i8* @child(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [34 x i8] c"Child is done sleeping 3 seconds.\00"
define noalias i8* @child(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 3)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i8* null
}
void dump_packet(const char *buf, int buflen) {}


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

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

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

LLVM IR (-O2):
define void @dump_packet(i8* nocapture %0, i32 %1) {
ret void
}
void __attribute__((weak)) i2c1_er_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<i2c1_er_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_er_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.i2c1_er_isr = [12 x i8] c"i2c1_er_isr\00"
define weak void @i2c1_er_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c1_er_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.i2c1_er_isr = [12 x i8] c"i2c1_er_isr\00"
define weak void @i2c1_er_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c1_er_isr, i64 0, i64 0))
ret void
}
void gdk_pango_attr_embossed_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pango_attr_embossed_new() {
ret void
}
void arch_init(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_init() {
ret void
}
/* Type definitions */
struct tls {
  int dummy;
};

/* Variables and functions */
int tls_accept_fds(struct tls *, struct tls **, int, int);
int tls_accept_socket(struct tls *ctx, struct tls **cctx, int s) {
  return (tls_accept_fds(ctx, cctx, s, s));
}


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

x86 assembly (clang, -O2):
<tls_accept_socket>:
mov    %edx,%ecx
jmp    1030 <tls_accept_fds@plt>

LLVM IR (-O0):
%struct.tls = type { i32 }
define i32 @tls_accept_socket(%struct.tls* %0, %struct.tls** %1, i32 %2) {
%4 = alloca %struct.tls*
%5 = alloca %struct.tls**
%6 = alloca i32
store %struct.tls* %0, %struct.tls** %4
store %struct.tls** %1, %struct.tls*** %5
store i32 %2, i32* %6
%7 = load %struct.tls*, %struct.tls** %4
%8 = load %struct.tls**, %struct.tls*** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @tls_accept_fds(%struct.tls* %7, %struct.tls** %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.tls = type { i32 }
define i32 @tls_accept_socket(%struct.tls* %0, %struct.tls** %1, i32 %2) {
%4 = tail call i32 @tls_accept_fds(%struct.tls* %0, %struct.tls** %1, i32 %2, i32 %2)
ret i32 %4
}
/* Type definitions */
struct stat {
  scalar_t__ st_mode;
};

/* Variables and functions */
scalar_t__ S_IFREG;
int /*<<< orphan*/ fstat(int, struct stat *);
extern bool isaregfile(int fd) {
  struct stat info;
  fstat(fd, &info);
  if (info.st_mode == S_IFREG)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<isaregfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
mov    -0x10(%rbp),%rax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
jne    1147 <isaregfile+0x37>
movl   $0x1,-0x4(%rbp)
jmp    114e <isaregfile+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaregfile>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    (%rsp),%rcx
mov    0x2ec4(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@S_IFREG = global i64 0
define i32 @isaregfile(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @fstat(i32 %5, %struct.stat* %4)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* @S_IFREG
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@S_IFREG = global i64 0
define i32 @isaregfile(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @S_IFREG
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
unsigned int shift6(unsigned int a) { return a << 6; }


x86 assembly (clang, -O0):
<shift6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift6>:
mov    %edi,%eax
shl    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @shift6(i32 %0) {
%2 = shl i32 %0, 6
ret i32 %2
}
int main(int argc, char *argv[], char *envp[]) {
  int *s = 0x0;
  *s = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32* null, i32** %8
%9 = load i32*, i32** %8
store i32 1, i32* %9
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int check_primo(int);
int potencia(int, int);
int /*<<< orphan*/ pseudo_fermat(int, int);
int main() {
  int num, retorno_check_primo, producto_potencia;
  for (num = 2; num < 32; num++) {
    retorno_check_primo = check_primo(num);
    if (retorno_check_primo == 1)
      ;
    else {
      producto_potencia = potencia(2, num);
      pseudo_fermat(producto_potencia, num);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1198 <main+0x68>
mov    -0x8(%rbp),%edi
call   1030 <check_primo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    116a <main+0x3a>
jmp    1185 <main+0x55>
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1050 <potencia@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <pseudo_fermat@plt>
jmp    118a <main+0x5a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%ebx
jmp    1148 <main+0x18>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x20,%ebx
je     116b <main+0x3b>
mov    %ebx,%edi
call   1030 <check_primo@plt>
cmp    $0x1,%eax
je     1140 <main+0x10>
mov    $0x2,%edi
mov    %ebx,%esi
call   1050 <potencia@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <pseudo_fermat@plt>
jmp    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 2, %0 ], [ %9, %8 ]
%3 = tail call i32 @check_primo(i32 %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @potencia(i32 2, i32 %2)
%7 = tail call i32 @pseudo_fermat(i32 %6, i32 %2)
br label %8
8: ; preds = %5, %1
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %1
11: ; preds = %8
ret i32 0
}
/* Variables and functions */
scalar_t__ lua_openstring(char *);
scalar_t__ lua_parse();
int lua_dostring(char *string) {
  if (lua_openstring(string))
    return 1;
  if (lua_parse())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<lua_dostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lua_openstring@plt>
cmp    $0x0,%rax
je     114b <lua_dostring+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    116f <lua_dostring+0x4f>
mov    $0x0,%al
call   1040 <lua_parse@plt>
cmp    $0x0,%rax
je     1168 <lua_dostring+0x48>
movl   $0x1,-0x4(%rbp)
jmp    116f <lua_dostring+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_dostring>:
push   %rax
call   1030 <lua_openstring@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1135 <lua_dostring+0x15>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <lua_parse@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lua_dostring(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @lua_openstring(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %13
8: ; preds = %1
%9 = call i64 (...) @lua_parse()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %2
br label %13
12: ; preds = %8
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @lua_dostring(i8* %0) {
%2 = tail call i64 @lua_openstring(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 (...) @lua_parse()
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void epit1_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @epit1_iomux_config() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int timespec_milliseconds(struct timespec *a) {
  return a->tv_sec * 1000 + a->tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<timespec_milliseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_milliseconds>:
imul   $0x3e8,(%rdi),%ecx
movslq 0x4(%rdi),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @timespec_milliseconds(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @timespec_milliseconds(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000000
%8 = add nsw i32 %7, %4
ret i32 %8
}
int test_imm_CEuint8_mem(unsigned char *val) {
  return ((*val) & (0xCE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CEuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -50
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *createFixedStr(const char *in, size_t len) {
  char *str = malloc(sizeof(char) * len);
  memcpy(str, in, len);
  return str;
}


x86 assembly (clang, -O0):
<createFixedStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createFixedStr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %r15d,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @createFixedStr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @createFixedStr(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ at_init();
int /*<<< orphan*/ mem_remap_top_384k();
void ibm_at_init() {
  at_init();
  mem_remap_top_384k();
}


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

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

LLVM IR (-O0):
define void @ibm_at_init() {
%1 = call i32 (...) @at_init()
%2 = call i32 (...) @mem_remap_top_384k()
ret void
}

LLVM IR (-O2):
define void @ibm_at_init() {
%1 = tail call i32 (...) @at_init()
%2 = tail call i32 (...) @mem_remap_top_384k()
ret void
}
int GetSocketKeepAlive(const int fd __attribute__((__unused__))) {
  ;
  return (-1);
}


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

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

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

LLVM IR (-O2):
define i32 @GetSocketKeepAlive(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_I2C_BUS1_SDA_PIN() { return 0x01 & (inp_emulate(0x35) >> 5); }


x86 assembly (clang, -O0):
<TOSH_READ_I2C_BUS1_SDA_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
sar    $0x5,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_I2C_BUS1_SDA_PIN>:
push   %rax
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
shr    $0x5,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_I2C_BUS1_SDA_PIN() {
%1 = call i32 @inp_emulate(i32 53)
%2 = ashr i32 %1, 5
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_I2C_BUS1_SDA_PIN() {
%1 = tail call i32 @inp_emulate(i32 53)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 5
%4 = and i8 %3, 1
ret i8 %4
}