xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
unsigned int alarm(int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
extern int alarm_(int *sec, void (*proc)()) {
  register unsigned lt;
  lt = alarm(1000);
  if (*sec)
    signal(SIGALRM, proc);
  alarm(*sec);
  return (lt);
}


x86 assembly (clang, -O0):
<alarm_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3e8,%edi
call   1030 <alarm@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     115c <alarm_+0x3c>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1040 <signal@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <alarm@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarm_>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x3e8,%edi
call   1030 <alarm@plt>
mov    %eax,%ebp
cmpl   $0x0,(%rbx)
je     1150 <alarm_+0x30>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
call   1040 <signal@plt>
mov    (%rbx),%edi
jmp    1152 <alarm_+0x32>
xor    %edi,%edi
call   1030 <alarm@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
define i32 @alarm_(i32* %0, void (...)* %1) {
%3 = alloca i32*
%4 = alloca void (...)*
%5 = alloca i32
store i32* %0, i32** %3
store void (...)* %1, void (...)** %4
%6 = call i32 @alarm(i32 1000)
store i32 %6, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @SIGALRM
%12 = load void (...)*, void (...)** %4
%13 = call i32 @signal(i32 %11, void (...)* %12)
br label %14
14: ; preds = %10, %2
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = call i32 @alarm(i32 %16)
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define i32 @alarm_(i32* nocapture %0, void (...)* %1) {
%3 = tail call i32 @alarm(i32 1000)
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @SIGALRM
%8 = tail call i32 @signal(i32 %7, void (...)* %1)
%9 = load i32, i32* %0
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
%12 = tail call i32 @alarm(i32 %11)
ret i32 %3
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
typedef int /*<<< orphan*/ query;

/* Variables and functions */
int /*<<< orphan*/ sqlSafef(char *, int, char *, char *, char *, char *);
int /*<<< orphan*/ sqlUpdate(struct sqlConnection *, char *);
void liftOverChainRemove(struct sqlConnection *conn, char *tableName,
                         char *fromDb, char *toDb) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "delete from %s where fromDb = '%s' and toDb = '%s'", tableName,
           fromDb, toDb);
  sqlUpdate(conn, query);
}


x86 assembly (clang, -O0):
<liftOverChainRemove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    $0x100,%esi
lea    0xea6(%rip),%rdx
call   1030 <sqlSafef@plt>
mov    -0x8(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1040 <sqlUpdate@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liftOverChainRemove>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xec3(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1030 <sqlSafef@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <sqlUpdate@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [51 x i8] c"delete from %s where fromDb = '%s' and toDb = '%s'\00"
define void @liftOverChainRemove(%struct.sqlConnection* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.sqlConnection*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [256 x i8]
store %struct.sqlConnection* %0, %struct.sqlConnection** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @sqlSafef(i8* %10, i32 256, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %13)
%15 = load %struct.sqlConnection*, %struct.sqlConnection** %5
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = call i32 @sqlUpdate(%struct.sqlConnection* %15, i8* %16)
ret void
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [51 x i8] c"delete from %s where fromDb = '%s' and toDb = '%s'\00"
define void @liftOverChainRemove(%struct.sqlConnection* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 @sqlSafef(i8* %6, i32 256, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%8 = call i32 @sqlUpdate(%struct.sqlConnection* %0, i8* %6)
ret void
}
/* Variables and functions */
unsigned short logical_truth_counter(int, int /*<<< orphan*/, int *,
                                     unsigned short);
bool logical_xor(unsigned short array_size, bool *boolean_list) {
  bool result = false;
  unsigned short num_of_truths =
      logical_truth_counter(false, 0, boolean_list, array_size);
  if (num_of_truths > 0u && num_of_truths % 2u) {
    result = true;
  }
  return result;
}


x86 assembly (clang, -O0):
<logical_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
movzwl -0x2(%rbp),%ecx
call   1030 <logical_truth_counter@plt>
mov    %ax,-0x16(%rbp)
movzwl -0x16(%rbp),%eax
cmp    $0x0,%eax
jbe    1163 <logical_xor+0x53>
movzwl -0x16(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1163 <logical_xor+0x53>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_xor>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%ecx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <logical_truth_counter@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @logical_xor(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i16
store i16 %0, i16* %3
store i32* %1, i32** %4
store i32 0, i32* %5
%7 = load i32*, i32** %4
%8 = load i16, i16* %3
%9 = call zeroext i16 @logical_truth_counter(i32 0, i32 0, i32* %7, i16 zeroext %8)
store i16 %9, i16* %6
%10 = load i16, i16* %6
%11 = zext i16 %10 to i32
%12 = icmp ugt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i16, i16* %6
%15 = zext i16 %14 to i32
%16 = urem i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %5
br label %19
19: ; preds = %18, %13, %2
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @logical_xor(i16 zeroext %0, i32* %1) {
%3 = tail call zeroext i16 @logical_truth_counter(i32 0, i32 0, i32* %1, i16 zeroext %0)
%4 = and i16 %3, 1
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ playsound(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ say_xy(char *, int /*<<< orphan*/, int);
void hit(void) {
  say_xy("wscream.wav/22050Hz - Chealse in Stonebrook", 0, 380);
  playsound(12, 22050, 0, 0, 0);
}


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
xor    %esi,%esi
mov    $0x17c,%edx
call   1030 <say_xy@plt>
mov    $0xc,%edi
mov    $0x5622,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <playsound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
mov    $0x17c,%edx
call   1030 <say_xy@plt>
mov    $0xc,%edi
mov    $0x5622,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rax
jmp    1040 <playsound@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"wscream.wav/22050Hz - Chealse in Stonebrook\00"
define void @hit() {
%1 = call i32 @say_xy(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 0, i32 380)
%2 = call i32 @playsound(i32 12, i32 22050, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"wscream.wav/22050Hz - Chealse in Stonebrook\00"
define void @hit() {
%1 = tail call i32 @say_xy(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 0, i32 380)
%2 = tail call i32 @playsound(i32 12, i32 22050, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int __infer_nondet_int();
int isalpha(int x) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
void HSV255toH360S1V1(double h1, double s1, double v1, double *h2, double *s2,
                      double *v2) {
  *h2 = (h1 * 360.) / 255.;
  *s2 = s1 / 255.;
  *v2 = v1 / 255.;
}


x86 assembly (clang, -O0):
<HSV255toH360S1V1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  0xee1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSV255toH360S1V1>:
mulsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm3
divsd  %xmm3,%xmm0
movsd  %xmm0,(%rdi)
divsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
divsd  %xmm3,%xmm2
movsd  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define void @HSV255toH360S1V1(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %7
%14 = fmul double %13, 3.600000e+02
%15 = fdiv double %14, 2.550000e+02
%16 = load double*, double** %10
store double %15, double* %16
%17 = load double, double* %8
%18 = fdiv double %17, 2.550000e+02
%19 = load double*, double** %11
store double %18, double* %19
%20 = load double, double* %9
%21 = fdiv double %20, 2.550000e+02
%22 = load double*, double** %12
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @HSV255toH360S1V1(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fmul double %0, 3.600000e+02
%8 = fdiv double %7, 2.550000e+02
store double %8, double* %3
%9 = fdiv double %1, 2.550000e+02
store double %9, double* %4
%10 = fdiv double %2, 2.550000e+02
store double %10, double* %5
ret void
}
int f(long long a, long long b) { return (a == b) + 1; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = select i1 %3, i32 2, i32 1
ret i32 %4
}
int isopp(char c) {
  switch (c) {
  case '+':
    return 1;
  case '-':
    return 2;
  case '*':
    return 3;
  case '/':
    return 4;
  case '^':
    return 5;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isopp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     117b <isopp+0x7b>
jmp    111f <isopp+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1163 <isopp+0x63>
jmp    1130 <isopp+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     116f <isopp+0x6f>
jmp    1141 <isopp+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1187 <isopp+0x87>
jmp    1152 <isopp+0x52>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     1193 <isopp+0x93>
jmp    119f <isopp+0x9f>
movl   $0x1,-0x4(%rbp)
jmp    11a6 <isopp+0xa6>
movl   $0x2,-0x4(%rbp)
jmp    11a6 <isopp+0xa6>
movl   $0x3,-0x4(%rbp)
jmp    11a6 <isopp+0xa6>
movl   $0x4,-0x4(%rbp)
jmp    11a6 <isopp+0xa6>
movl   $0x5,-0x4(%rbp)
jmp    11a6 <isopp+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isopp>:
lea    -0x2a(%rdi),%ecx
cmp    $0x5,%ecx
ja     1123 <isopp+0x23>
mov    $0x1,%eax
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x3,%eax
ret
cmp    $0x5e,%edi
jne    112e <isopp+0x2e>
mov    $0x5,%eax
ret
xor    %eax,%eax
ret
mov    $0x2,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @isopp(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 43, label %6
i32 45, label %7
i32 42, label %8
i32 47, label %9
i32 94, label %10
]
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
store i32 2, i32* %2
br label %12
8: ; preds = %1
store i32 3, i32* %2
br label %12
9: ; preds = %1
store i32 4, i32* %2
br label %12
10: ; preds = %1
store i32 5, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @isopp(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 43, label %8
i32 45, label %3
i32 42, label %4
i32 47, label %5
i32 94, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 0, %7 ], [ 5, %6 ], [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int myIntFunction(int arg) {
  static int sint = 0;
  printf("myIntFunction() => %d\n", sint);
  return sint += arg;
}


x86 assembly (clang, -O0):
<myIntFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0b(%rip),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    0x2ef6(%rip),%eax
mov    %eax,0x2ef0(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myIntFunction>:
push   %rbx
mov    %edi,%ebx
mov    0x2f13(%rip),%esi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
add    0x2f01(%rip),%ebx
mov    %ebx,0x2efb(%rip)
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@myIntFunction.sint = internal global i32 0
@.str = [23 x i8] c"myIntFunction() => %d\0A\00"
define i32 @myIntFunction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @myIntFunction.sint
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @myIntFunction.sint
%7 = add nsw i32 %6, %5
store i32 %7, i32* @myIntFunction.sint
ret i32 %7
}

LLVM IR (-O2):
@myIntFunction.sint = internal unnamed_addr global i32 0
@.str = [23 x i8] c"myIntFunction() => %d\0A\00"
define i32 @myIntFunction(i32 %0) {
%2 = load i32, i32* @myIntFunction.sint
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @myIntFunction.sint
%5 = add nsw i32 %4, %0
store i32 %5, i32* @myIntFunction.sint
ret i32 %5
}
/* Variables and functions */
int search(int, unsigned int *);
int findN(unsigned int *a) {
  int i = 0, x = 1;
  while (1) {
    i = x - 1;
    if (!a[i])
      break;
    x = x * 2;
  }
  return search(x / 2, a);
}


x86 assembly (clang, -O0):
<findN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    114a <findN+0x3a>
jmp    1158 <findN+0x48>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <findN+0x1a>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <search@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findN>:
mov    %rdi,%rsi
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
movslq %eax,%rcx
lea    (%rcx,%rcx,1),%eax
cmpl   $0x0,-0x4(%rsi,%rcx,4)
jne    1120 <findN+0x10>
shr    %edi
jmp    1030 <search@plt>

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

LLVM IR (-O2):
define i32 @findN(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %9, %2 ]
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = shl nsw i32 %3, 1
br i1 %8, label %10, label %2
10: ; preds = %2
%11 = lshr i32 %3, 1
%12 = tail call i32 @search(i32 %11, i32* %0)
ret i32 %12
}
int fn6(int a, int b) {
  int tem1 = b ^ a;
  int tem2 = a & b;
  return tem1 + tem2;
}


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn6(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void MPURegionEnable(uint32_t ui32Region) {
  ASSERT(ui32Region < 8);
  (*((volatile uint32_t *)(0xE000ED98))) = ui32Region;
  (*((volatile uint32_t *)(0xE000EDA0))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<MPURegionEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%ecx
mov    $0xe000ed98,%eax
mov    %ecx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0xe000eda0,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionEnable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x8,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0xe000eda0,%eax
mov    %ebx,-0x8(%rax)
orl    $0x1,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @MPURegionEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 8
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
store volatile i32 %7, i32* inttoptr (i64 3758157208 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 3758157216 to i32*)
%9 = or i32 %8, 1
store volatile i32 %9, i32* inttoptr (i64 3758157216 to i32*)
ret void
}

LLVM IR (-O2):
define void @MPURegionEnable(i32 %0) {
%2 = icmp slt i32 %0, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
store volatile i32 %0, i32* inttoptr (i64 3758157208 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 3758157216 to i32*)
%6 = or i32 %5, 1
store volatile i32 %6, i32* inttoptr (i64 3758157216 to i32*)
ret void
}
/* Variables and functions */
int check_for_version_file_in_share_dir(char const *);
int check_for_known_file_in_share_dir(const char *dir) {
  return check_for_version_file_in_share_dir(dir);
}


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

x86 assembly (clang, -O2):
<check_for_known_file_in_share_dir>:
jmp    1030 <check_for_version_file_in_share_dir@plt>

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

LLVM IR (-O2):
define i32 @check_for_known_file_in_share_dir(i8* %0) {
%2 = tail call i32 @check_for_version_file_in_share_dir(i8* %0)
ret i32 %2
}
/* Variables and functions */
unsigned char _utf8_shiftpos(unsigned int, unsigned int);
unsigned long _utf8_continuation_value(unsigned char cont, unsigned w,
                                       unsigned n) {
  return (cont & 0x3f) << _utf8_shiftpos(w, n);
}


x86 assembly (clang, -O0):
<_utf8_continuation_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_utf8_shiftpos@plt>
mov    %al,%cl
mov    -0x10(%rbp),%eax
movzbl %cl,%ecx
shl    %cl,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_utf8_continuation_value>:
push   %rbx
mov    %edi,%ebx
and    $0x3f,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <_utf8_shiftpos@plt>
mov    %eax,%ecx
shl    %cl,%ebx
movslq %ebx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @_utf8_continuation_value(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = and i32 %8, 63
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call zeroext i8 @_utf8_shiftpos(i32 %10, i32 %11)
%13 = zext i8 %12 to i32
%14 = shl i32 %9, %13
%15 = sext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @_utf8_continuation_value(i8 zeroext %0, i32 %1, i32 %2) {
%4 = and i8 %0, 63
%5 = zext i8 %4 to i32
%6 = tail call zeroext i8 @_utf8_shiftpos(i32 %1, i32 %2)
%7 = zext i8 %6 to i32
%8 = shl i32 %5, %7
%9 = sext i32 %8 to i64
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ io_send_byte(char);
void keyboard_out_tty(char ch) { io_send_byte(ch); }


x86 assembly (clang, -O0):
<keyboard_out_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <io_send_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_out_tty>:
jmp    1030 <io_send_byte@plt>

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

LLVM IR (-O2):
define void @keyboard_out_tty(i8 signext %0) {
%2 = tail call i32 @io_send_byte(i8 signext %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Nvm_Update();
int /*<<< orphan*/ Nvm_Write(int, int *, int);
int /*<<< orphan*/ Protocol_BufferSynchronize();
void Settings_StoreStartupLine(uint8_t n, char *line) {
  Protocol_BufferSynchronize();
  uint32_t addr = n * (80 + 1) + 768U;
  Nvm_Write(addr, (uint8_t *)line, 80);
  Nvm_Update();
}


x86 assembly (clang, -O0):
<Settings_StoreStartupLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <Protocol_BufferSynchronize@plt>
imul   $0x51,-0x4(%rbp),%eax
add    $0x300,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x50,%edx
call   1030 <Nvm_Write@plt>
mov    $0x0,%al
call   1050 <Nvm_Update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Settings_StoreStartupLine>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <Protocol_BufferSynchronize@plt>
lea    (%rbx,%rbx,8),%eax
lea    (%rax,%rax,8),%edi
add    $0x300,%edi
mov    %r14,%rsi
mov    $0x50,%edx
call   1030 <Nvm_Write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <Nvm_Update@plt>

LLVM IR (-O0):
define void @Settings_StoreStartupLine(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 (...) @Protocol_BufferSynchronize()
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 81
%9 = add i32 %8, 768
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = call i32 @Nvm_Write(i32 %10, i32* %12, i32 80)
%14 = call i32 (...) @Nvm_Update()
ret void
}

LLVM IR (-O2):
define void @Settings_StoreStartupLine(i32 %0, i8* %1) {
%3 = tail call i32 (...) @Protocol_BufferSynchronize()
%4 = mul nsw i32 %0, 81
%5 = add i32 %4, 768
%6 = bitcast i8* %1 to i32*
%7 = tail call i32 @Nvm_Write(i32 %5, i32* %6, i32 80)
%8 = tail call i32 (...) @Nvm_Update()
ret void
}
void SIG_IGN(sig) int sig;
{ setsighandler(sig, SIG_IGN); }


x86 assembly (clang, -O0):
<SIG_IGN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rsi
mov    $0x0,%al
call   1030 <setsighandler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIG_IGN>:
mov    0x2ed1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <setsighandler@plt>

LLVM IR (-O0):
define void @SIG_IGN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, void (...)*, ...) bitcast (i32 (...)* @setsighandler to i32 (i32, void (...)*, ...)*)(i32 %3, void (...)* bitcast (void (i32)* @SIG_IGN to void (...)*))
ret void
}

LLVM IR (-O2):
define void @SIG_IGN(i32 %0) {
%2 = tail call i32 (i32, void (...)*, ...) bitcast (i32 (...)* @setsighandler to i32 (i32, void (...)*, ...)*)(i32 %0, void (...)* bitcast (void (i32)* @SIG_IGN to void (...)*))
ret void
}
int HelpItem42(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem42() {
ret i32 0
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int inet_pton(int /*<<< orphan*/, char const *, unsigned char *);
int validator_ip(const char *ip) {
  unsigned char buf[sizeof(struct in_addr)];
  return inet_pton(AF_INET, ip, buf) == 1 ? 1 : 0;
}


x86 assembly (clang, -O0):
<validator_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validator_ip>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rdx
call   1030 <inet_pton@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @validator_ip(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i32, i32* @AF_INET
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = call i32 @inet_pton(i32 %4, i8* %5, i8* %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @validator_ip(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @AF_INET
%5 = call i32 @inet_pton(i32 %4, i8* %0, i8* %3)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}
void strip_ctrl(char *s) {
  while (*s) {
    if (*s < ' ' || ((unsigned)*s >= 128 && (unsigned)*s < 128 + ' '))
      *s = 'M';
    s += 1;
  }
}


x86 assembly (clang, -O0):
<strip_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <strip_ctrl+0x61>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jl     1149 <strip_ctrl+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x80,%eax
jb     1150 <strip_ctrl+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa0,%eax
jae    1150 <strip_ctrl+0x50>
mov    -0x8(%rbp),%rax
movb   $0x4d,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strip_ctrl+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_ctrl>:
mov    (%rdi),%al
test   %al,%al
je     1125 <strip_ctrl+0x25>
add    $0x1,%rdi
jmp    111b <strip_ctrl+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <strip_ctrl+0x25>
cmp    $0x1f,%al
jg     1110 <strip_ctrl+0x10>
movb   $0x4d,-0x1(%rdi)
jmp    1110 <strip_ctrl+0x10>
ret

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

LLVM IR (-O2):
define void @strip_ctrl(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = icmp slt i8 %5, 32
br i1 %7, label %8, label %9
8: ; preds = %4
store i8 77, i8* %6
br label %9
9: ; preds = %4, %8
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %1
ret void
}
char showAlphabetInN(int i) {
  if (i > 26)
    return -1;
  return "abcdefghijklmnopqrstuvwxyz"[i];
}


x86 assembly (clang, -O0):
<showAlphabetInN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jle    111a <showAlphabetInN+0x1a>
movb   $0xff,-0x1(%rbp)
jmp    112b <showAlphabetInN+0x2b>
movslq -0x8(%rbp),%rcx
lea    0xedb(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<showAlphabetInN>:
mov    $0xff,%al
cmp    $0x1a,%edi
jg     1114 <showAlphabetInN+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define signext i8 @showAlphabetInN(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 26
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 -1, i8* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %2
br label %12
12: ; preds = %7, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define signext i8 @showAlphabetInN(i32 %0) {
%2 = icmp sgt i32 %0, 26
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ -1, %1 ]
ret i8 %8
}
int is_even(void *val) {
  int *i = (int *)val;
  if (*i % 2 == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1133 <is_even+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <is_even+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    (%rdi),%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_even(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 0
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):
define i32 @is_even(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}
extern const char *rs_str(void) { return "Hello World"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i8* @rs_str() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i8* @rs_str() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int ft_isdigit(int);
int check_dump(char *src) {
  int check;
  check = 1;
  while (check && *src)
    check = ft_isdigit((int)*src++);
  return (check);
}


x86 assembly (clang, -O0):
<check_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1142 <check_dump+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1152 <check_dump+0x42>
jmp    1171 <check_dump+0x61>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ft_isdigit@plt>
mov    %eax,-0xc(%rbp)
jmp    1123 <check_dump+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_dump>:
push   %rbx
mov    (%rdi),%cl
test   %cl,%cl
je     1139 <check_dump+0x29>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %cl,%edi
call   1030 <ft_isdigit@plt>
test   %eax,%eax
je     1140 <check_dump+0x30>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1120 <check_dump+0x10>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_dump(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %11
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %11, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = tail call i32 @ft_isdigit(i32 %10)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %7, %1
%15 = phi i32 [ 1, %1 ], [ %12, %4 ], [ 0, %7 ]
ret i32 %15
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int permutation_after_standard_loop(int d, int *permutation) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc4c(52, a, permutation, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<permutation_after_standard_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x34,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutation_after_standard_loop>:
mov    %rsi,%rdx
mov    $0x34,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @permutation_after_standard_loop(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %4
%10 = load double*, double** %7
%11 = call i32 @_ada_use_c2phc4c(i32 52, i32* %8, i32* %9, double* %10, i32 0)
store i32 %11, i32* %6
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @permutation_after_standard_loop(i32 %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc4c(i32 52, i32* undef, i32* %1, double* undef, i32 0)
ret i32 %3
}
int left(int i) { return i; }


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

x86 assembly (clang, -O2):
<left>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @left(i32 returned %0) {
ret i32 %0
}
unsigned int test_13(unsigned int a, int b) { return (a >> 3) | (b << 31); }


x86 assembly (clang, -O0):
<test_13>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_13>:
shr    $0x3,%edi
shl    $0x1f,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @test_13(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 = lshr i32 %5, 3
%7 = load i32, i32* %4
%8 = shl i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_13(i32 %0, i32 %1) {
%3 = lshr i32 %0, 3
%4 = shl i32 %1, 31
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
char *dupfmt(char *, char *, int, char *);
char *http_success(char *mimetype, int stuff_cr, char *document) {
  return dupfmt("HTTP/1.1 200 OK\r\n"
                "Date: %D\r\n"
                "Expires: %D\r\n"
                "Server: "
                "agedu"
                "\r\n"
                "Connection: close\r\n"
                "Content-Type: %s\r\n"
                "\r\n"
                "%S",
                mimetype, stuff_cr, document);
}


x86 assembly (clang, -O0):
<http_success>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <dupfmt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_success>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <dupfmt@plt>

LLVM IR (-O0):
@.str = [97 x i8] c"HTTP/1.1 200 OK\0D\0ADate: %D\0D\0AExpires: %D\0D\0AServer: agedu\0D\0AConnection: close\0D\0AContent-Type: %s\0D\0A\0D\0A%S\00"
define i8* @http_success(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i8* @dupfmt(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [97 x i8] c"HTTP/1.1 200 OK\0D\0ADate: %D\0D\0AExpires: %D\0D\0AServer: agedu\0D\0AConnection: close\0D\0AContent-Type: %s\0D\0A\0D\0A%S\00"
define i8* @http_success(i8* %0, i32 %1, i8* %2) {
%4 = tail call i8* @dupfmt(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret i8* %4
}
void ikt_object_end(void) {}


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

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

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

LLVM IR (-O2):
define void @ikt_object_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
__attribute__((unused)) void *UTIL_realloc(void *ptr, size_t size) {
  void *const newptr = realloc(ptr, size);
  if (newptr)
    return newptr;
  free(ptr);
  return NULL;
}


x86 assembly (clang, -O0):
<UTIL_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <UTIL_realloc+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <UTIL_realloc+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <UTIL_realloc+0x1c>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @UTIL_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %17
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
store i8* null, i8** %3
br label %17
17: ; preds = %14, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @UTIL_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
void xp_log(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @xp_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
void sigint_handler(int val) {
  kill(0, val);
  exit(val);
}


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

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <kill@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @kill(i32 0, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @kill(i32 0, i32 %0)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s && *s != c)
    s++;
  return *s ? (char *)s : NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1130 <strchr+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <strchr+0x40>
jmp    1151 <strchr+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116e <strchr+0x6e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1179 <strchr+0x79>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1179 <strchr+0x79>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <strchr+0x20>
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
xor    %edx,%edx
test   %cl,%cl
cmove  %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = select i1 %6, i8* null, i8* %4
ret i8* %12
}