xunge/DecIR huggingface dataset:
char encrypt(char c, int key) {
  if (c < 'A' || 'Z' < c)
    return c;
  else
    return (char)('A' + (c - 'A' + key) % 26);
}


x86 assembly (clang, -O0):
<encrypt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     112b <encrypt+0x2b>
movsbl -0x2(%rbp),%ecx
mov    $0x5a,%eax
cmp    %ecx,%eax
jge    1136 <encrypt+0x36>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1150 <encrypt+0x50>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    -0x8(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt>:
mov    %edi,%eax
lea    -0x5b(%rax),%ecx
cmp    $0xe6,%cl
jb     1134 <encrypt+0x34>
movzbl %al,%eax
add    %esi,%eax
add    $0xffffffbf,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x41,%al
ret

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

LLVM IR (-O2):
define signext i8 @encrypt(i8 signext %0, i32 %1) {
%3 = add i8 %0, -91
%4 = icmp ult i8 %3, -26
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = zext i8 %0 to i32
%7 = add nsw i32 %6, -65
%8 = add nsw i32 %7, %1
%9 = srem i32 %8, 26
%10 = trunc i32 %9 to i8
%11 = add nsw i8 %10, 65
br label %12
12: ; preds = %2, %5
%13 = phi i8 [ %11, %5 ], [ %0, %2 ]
ret i8 %13
}
/* Type definitions */
struct mntent {
  int dummy;
};
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct mntent *getmntent_r(int /*<<< orphan*/ *, struct mntent *, char *, int);
struct mntent *getmntent(FILE *f) {
  static char buf[1024];
  static struct mntent mnt;
  return getmntent_r(f, &mnt, buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<getmntent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x3319(%rip),%rsi
lea    0x2f12(%rip),%rdx
mov    $0x400,%ecx
call   1030 <getmntent_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmntent>:
lea    0x3329(%rip),%rsi
lea    0x2f22(%rip),%rdx
mov    $0x400,%ecx
jmp    1030 <getmntent_r@plt>

LLVM IR (-O0):
%struct.mntent = type { i32 }
@getmntent.buf = internal global [1024 x i8] zeroinitializer
@getmntent.mnt = internal global %struct.mntent zeroinitializer
define %struct.mntent* @getmntent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.mntent* @getmntent_r(i32* %3, %struct.mntent* @getmntent.mnt, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getmntent.buf, i64 0, i64 0), i32 1024)
ret %struct.mntent* %4
}

LLVM IR (-O2):
%struct.mntent = type { i32 }
@getmntent.buf = internal global [1024 x i8] zeroinitializer
@getmntent.mnt = internal global %struct.mntent zeroinitializer
define %struct.mntent* @getmntent(i32* %0) {
%2 = tail call %struct.mntent* @getmntent_r(i32* %0, %struct.mntent* @getmntent.mnt, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getmntent.buf, i64 0, i64 0), i32 1024)
ret %struct.mntent* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i = 2;
  int j = 3;
  int k = i / j;
  printf("%d\n", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
double Mfunc1D(double x, double gamma, double h) {
  return gamma * 2 * (h + (1. - 2 * h) * x) * x * (1. - x);
}


x86 assembly (clang, -O0):
<Mfunc1D>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xeed(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xeca(%rip),%xmm1
subsd  %xmm3,%xmm1
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mfunc1D>:
addsd  %xmm1,%xmm1
movapd %xmm2,%xmm4
addsd  %xmm2,%xmm4
movsd  0xeec(%rip),%xmm3
movapd %xmm3,%xmm5
subsd  %xmm4,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm2,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm0,%xmm5
subsd  %xmm0,%xmm3
mulsd  %xmm5,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @Mfunc1D(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fmul double %7, 2.000000e+00
%9 = load double, double* %6
%10 = load double, double* %6
%11 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %10, double 1.000000e+00)
%12 = load double, double* %4
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double %9)
%14 = fmul double %8, %13
%15 = load double, double* %4
%16 = fmul double %14, %15
%17 = load double, double* %4
%18 = fsub double 1.000000e+00, %17
%19 = fmul double %16, %18
ret double %19
}

LLVM IR (-O2):
define double @Mfunc1D(double %0, double %1, double %2) {
%4 = fmul double %1, 2.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %2, double -2.000000e+00, double 1.000000e+00)
%6 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %2)
%7 = fmul double %4, %6
%8 = fmul double %7, %0
%9 = fsub double 1.000000e+00, %0
%10 = fmul double %9, %8
ret double %10
}
int isqrt(int x) {
  int count = 0, sum = 1;
  while (sum <= x) {
    ++count;
    sum += 2 * count + 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<isqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113e <isqrt+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <isqrt+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isqrt>:
xor    %eax,%eax
test   %edi,%edi
jle    111f <isqrt+0x1f>
mov    $0x1,%ecx
mov    $0x2,%edx
add    $0x1,%eax
add    %edx,%ecx
add    $0x1,%ecx
add    $0x2,%edx
cmp    %edi,%ecx
jle    1110 <isqrt+0x10>
ret

LLVM IR (-O0):
define i32 @isqrt(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 = %9, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = mul nsw i32 2, %12
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @isqrt(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = shl nuw nsw i32 %6, 1
%8 = add i32 %4, 1
%9 = add i32 %8, %7
%10 = icmp sgt i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ analyze_hand(int **);
int /*<<< orphan*/ print_result();
int /*<<< orphan*/ read_cards(int **);
int main(void) {
  int player_hand[5][2];
  while (1) {
    read_cards(player_hand);
    analyze_hand(player_hand);
    print_result();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <read_cards@plt>
lea    -0x30(%rbp),%rdi
call   1050 <analyze_hand@plt>
mov    $0x0,%al
call   1040 <print_result@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <read_cards@plt>
mov    %rbx,%rdi
call   1050 <analyze_hand@plt>
xor    %eax,%eax
call   1040 <print_result@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [2 x i32]]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = getelementptr inbounds [5 x [2 x i32]], [5 x [2 x i32]]* %2, i64 0, i64 0
%5 = bitcast [2 x i32]* %4 to i32**
%6 = call i32 @read_cards(i32** %5)
%7 = getelementptr inbounds [5 x [2 x i32]], [5 x [2 x i32]]* %2, i64 0, i64 0
%8 = bitcast [2 x i32]* %7 to i32**
%9 = call i32 @analyze_hand(i32** %8)
%10 = call i32 (...) @print_result()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x [2 x i32]]
%2 = bitcast [5 x [2 x i32]]* %1 to i8*
%3 = bitcast [5 x [2 x i32]]* %1 to i32**
br label %4
4: ; preds = %4, %0
%5 = call i32 @read_cards(i32** %3)
%6 = call i32 @analyze_hand(i32** %3)
%7 = call i32 (...) @print_result()
br label %4
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_echo_wchar(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


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

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

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

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

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *path) {
  int retval = 0;
  struct stat buffer;
  if (stat(path, &buffer) == 0)
    retval = 1;
  return retval;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1141 <file_exists+0x31>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int toc_got_im(char **args) {
  printf("msg: %s %s", args[0], args[1]);
  return 1;
}


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

x86 assembly (clang, -O2):
<toc_got_im>:
push   %rax
mov    (%rdi),%rsi
mov    0x8(%rdi),%rdx
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"msg: %s %s\00"
define i32 @toc_got_im(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 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [11 x i8] c"msg: %s %s\00"
define i32 @toc_got_im(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %4)
ret i32 1
}
__attribute__((always_)) void print_modules(void) {}


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

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

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

LLVM IR (-O2):
define void @print_modules() {
ret void
}
/* Variables and functions */
int random();
void Code(char *data, size_t len) {
  for (size_t i = 0; i < len; i++)
    data[i] += (char)(random() % 255);
}


x86 assembly (clang, -O0):
<Code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116c <Code+0x5c>
mov    $0x0,%al
call   1030 <random@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%esi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <Code+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Code>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     115f <Code+0x4f>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
add    %cl,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <Code+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @Code(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %13, %5 ], [ 0, %2 ]
%7 = tail call i32 (...) @random()
%8 = srem i32 %7, 255
%9 = getelementptr inbounds i8, i8* %0, i64 %6
%10 = load i8, i8* %9
%11 = trunc i32 %8 to i8
%12 = add i8 %10, %11
store i8 %12, i8* %9
%13 = add nuw i64 %6, 1
%14 = icmp eq i64 %13, %1
br i1 %14, label %4, label %5
}
int log2_b(int n) {
  int log2_a = 0;
  while (n) {
    n = n >> 1;
    log2_a++;
  }
  return log2_a - 1;
}


x86 assembly (clang, -O0):
<log2_b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <log2_b+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <log2_b+0xe>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_b>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111c <log2_b+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <log2_b+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2_b(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %4, %3 ]
ret i32 %10
}
void removeBottomWall(int (*maze)[13], int startRow, int startCol) {
  int removeRow, removeCol;
  removeRow = (startRow + 1) * 2;
  removeCol = (startCol)*2 - 1 + 2;
  maze[removeRow][removeCol] = 0;
}


x86 assembly (clang, -O0):
<removeBottomWall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x34,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeBottomWall>:
lea    (%rsi,%rsi,1),%eax
add    $0x2,%eax
lea    (%rdx,%rdx,1),%ecx
add    $0x1,%ecx
cltq
movslq %ecx,%rcx
imul   $0x34,%rax,%rax
add    %rdi,%rax
movl   $0x0,(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @removeBottomWall([13 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [13 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [13 x i32]* %0, [13 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 2
%14 = sub nsw i32 %13, 1
%15 = add nsw i32 %14, 2
store i32 %15, i32* %8
%16 = load [13 x i32]*, [13 x i32]** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [13 x i32], [13 x i32]* %16, i64 %18
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [13 x i32], [13 x i32]* %19, i64 0, i64 %21
store i32 0, i32* %22
ret void
}

LLVM IR (-O2):
define void @removeBottomWall([13 x i32]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 1
%5 = add i32 %4, 2
%6 = shl nsw i32 %2, 1
%7 = or i32 %6, 1
%8 = sext i32 %5 to i64
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds [13 x i32], [13 x i32]* %0, i64 %8, i64 %9
store i32 0, i32* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void handle(int sig, siginfo_t *info, void *vctxt) {
  printf("Got signal %d\n", sig);
  exit(0);
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Got signal %d\0A\00"
define void @handle(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Got signal %d\0A\00"
define void @handle(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned int iphash_v4(char const *, unsigned int);
unsigned int iphash_v6(char const *, unsigned int);
int /*<<< orphan*/ *strchr(char const *, char);
unsigned int bmy_iphash(const char *ip, unsigned int nhash) {
  return (strchr(ip, ':') != NULL) ? iphash_v6(ip, nhash)
                                   : iphash_v4(ip, nhash);
}


x86 assembly (clang, -O0):
<bmy_iphash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     116b <bmy_iphash+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <iphash_v6@plt>
mov    %eax,-0x10(%rbp)
jmp    117a <bmy_iphash+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <iphash_v4@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmy_iphash>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
test   %rax,%rax
je     1157 <bmy_iphash+0x27>
pop    %rbx
pop    %rbp
jmp    1040 <iphash_v6@plt>
pop    %rbx
pop    %rbp
jmp    1050 <iphash_v4@plt>

LLVM IR (-O0):
define i32 @bmy_iphash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32* @strchr(i8* %5, i8 signext 58)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @iphash_v6(i8* %9, i32 %10)
br label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @iphash_v4(i8* %13, i32 %14)
br label %16
16: ; preds = %12, %8
%17 = phi i32 [ %11, %8 ], [ %15, %12 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @bmy_iphash(i8* %0, i32 %1) {
%3 = tail call i32* @strchr(i8* %0, i8 signext 58)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @iphash_v6(i8* %0, i32 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @iphash_v4(i8* %0, i32 %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
float fresnelReflectanceAtNormal(float index) {
  float partial = (1 - index) / (1 + index);
  return partial * partial;
}


x86 assembly (clang, -O0):
<fresnelReflectanceAtNormal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fresnelReflectanceAtNormal>:
movss  0xef8(%rip),%xmm2
movaps %xmm2,%xmm1
subss  %xmm0,%xmm1
addss  %xmm2,%xmm0
divss  %xmm0,%xmm1
mulss  %xmm1,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fresnelReflectanceAtNormal(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float 1.000000e+00, %4
%6 = load float, float* %2
%7 = fadd float 1.000000e+00, %6
%8 = fdiv float %5, %7
store float %8, float* %3
%9 = load float, float* %3
%10 = load float, float* %3
%11 = fmul float %9, %10
ret float %11
}

LLVM IR (-O2):
define float @fresnelReflectanceAtNormal(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fadd float %0, 1.000000e+00
%4 = fdiv float %2, %3
%5 = fmul float %4, %4
ret float %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
int get_XEvent_type(void *_p) { return (int)((XEvent *)_p)->type; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int ft_label_chars(char c) {
  int i;
  i = -1;
  while ("abcdefghijklmnopqrstuvwxyz_0123456789"[++i])
    if ("abcdefghijklmnopqrstuvwxyz_0123456789"[i] == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_label_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq %eax,%rcx
lea    0xedc(%rip),%rax
cmpb   $0x0,(%rax,%rcx,1)
je     115a <ft_label_chars+0x5a>
movslq -0xc(%rbp),%rcx
lea    0xec7(%rip),%rax
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <ft_label_chars+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1161 <ft_label_chars+0x61>
jmp    1111 <ft_label_chars+0x11>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_label_chars>:
mov    $0x1,%ecx
lea    0xef4(%rip),%rdx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %dil,-0x1(%rcx,%rdx,1)
je     113a <ft_label_chars+0x3a>
cmp    $0x25,%rcx
je     113b <ft_label_chars+0x3b>
lea    0x2(%rcx),%rsi
cmp    %dil,(%rcx,%rdx,1)
mov    %rsi,%rcx
jne    1120 <ft_label_chars+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"abcdefghijklmnopqrstuvwxyz_0123456789\00"
define i32 @ft_label_chars(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 -1, i32* %4
br label %5
5: ; preds = %22, %1
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
store i32 %7, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [38 x i8], [38 x i8]* @.str, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %5
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [38 x i8], [38 x i8]* @.str, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %12
store i32 1, i32* %2
br label %24
22: ; preds = %12
br label %5
23: ; preds = %5
store i32 0, i32* %2
br label %24
24: ; preds = %23, %21
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [38 x i8] c"abcdefghijklmnopqrstuvwxyz_0123456789\00"
define i32 @ft_label_chars(i8 signext %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i64 [ -1, %1 ], [ %9, %11 ]
%4 = add nsw i64 %3, 1
%5 = getelementptr inbounds [38 x i8], [38 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %0
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = add nsw i64 %3, 2
%10 = icmp eq i64 %9, 37
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = getelementptr inbounds [38 x i8], [38 x i8]* @.str, i64 0, i64 %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %0
br i1 %14, label %15, label %2
15: ; preds = %11, %8, %2
%16 = phi i32 [ 1, %2 ], [ 0, %8 ], [ 1, %11 ]
ret i32 %16
}
/* Variables and functions */
size_t unum_digits(unsigned long, int);
size_t num_digits(signed long num, int base, int force_sign_symbol) {
  if (num < 0)
    return unum_digits((unsigned long)-num, base) + 1;
  else
    return unum_digits((unsigned long)num, base) + (!!(force_sign_symbol));
}


x86 assembly (clang, -O0):
<num_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    114a <num_digits+0x3a>
xor    %eax,%eax
mov    %eax,%edi
sub    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <unum_digits@plt>
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <num_digits+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <unum_digits@plt>
cmpl   $0x0,-0x18(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_digits>:
push   %rbx
test   %rdi,%rdi
js     1126 <num_digits+0x16>
mov    %edx,%ebx
call   1030 <unum_digits@plt>
cmp    $0x1,%ebx
sbb    $0xffffffffffffffff,%rax
pop    %rbx
ret
neg    %rdi
call   1030 <unum_digits@plt>
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @num_digits(i64 %0, i32 %1, i32 %2) {
%4 = icmp slt i64 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = sub nsw i64 0, %0
%7 = tail call i64 @unum_digits(i64 %6, i32 %1)
%8 = add i64 %7, 1
br label %14
9: ; preds = %3
%10 = tail call i64 @unum_digits(i64 %0, i32 %1)
%11 = icmp ne i32 %2, 0
%12 = zext i1 %11 to i64
%13 = add i64 %10, %12
br label %14
14: ; preds = %9, %5
%15 = phi i64 [ %8, %5 ], [ %13, %9 ]
ret i64 %15
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void timer_timeout_int_clr(uint32_t *timer) { timer[0x024 / 4] |= 1; }


x86 assembly (clang, -O0):
<timer_timeout_int_clr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
or     $0x1,%ecx
mov    %ecx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_timeout_int_clr>:
orb    $0x1,0x24(%rdi)
ret

LLVM IR (-O0):
define void @timer_timeout_int_clr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 9
%5 = load i32, i32* %4
%6 = or i32 %5, 1
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @timer_timeout_int_clr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = load i32, i32* %2
%4 = or i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage: %s [ --cpuoffset n ] [ --jitter n ] [ --ncycles n ] "
          "[ --noise_size n ] [ --test_cycle_tb_mask 0xhh ] "
          "[ --v ]\n",
          prog);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [117 x i8] c"Usage: %s [ --cpuoffset n ] [ --jitter n ] [ --ncycles n ] [ --noise_size n ] [ --test_cycle_tb_mask 0xhh ] [ --v ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [117 x i8] c"Usage: %s [ --cpuoffset n ] [ --jitter n ] [ --ncycles n ] [ --noise_size n ] [ --test_cycle_tb_mask 0xhh ] [ --v ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ p16_eeprom();
int /*<<< orphan*/ p16_int_pin();
int /*<<< orphan*/ p16_int_portb();
int /*<<< orphan*/ p16_tmr0();
int /*<<< orphan*/ p16_tmr1();
int /*<<< orphan*/ p16_tmr2();
int /*<<< orphan*/ p16_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC16F648A_periferic(void) {
  p16_int_pin();
  p16_int_portb();
  p16_tmr0();
  p16_wdt();
  p16_eeprom();
  p16_tmr1();
  p16_tmr2();
  serial(0);
}


x86 assembly (clang, -O0):
<PIC16F648A_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10a0 <p16_int_pin@plt>
mov    $0x0,%al
call   1060 <p16_int_portb@plt>
mov    $0x0,%al
call   1030 <p16_tmr0@plt>
mov    $0x0,%al
call   1080 <p16_wdt@plt>
mov    $0x0,%al
call   1090 <p16_eeprom@plt>
mov    $0x0,%al
call   1070 <p16_tmr1@plt>
mov    $0x0,%al
call   1040 <p16_tmr2@plt>
xor    %edi,%edi
call   1050 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F648A_periferic>:
push   %rax
xor    %eax,%eax
call   10a0 <p16_int_pin@plt>
xor    %eax,%eax
call   1060 <p16_int_portb@plt>
xor    %eax,%eax
call   1030 <p16_tmr0@plt>
xor    %eax,%eax
call   1080 <p16_wdt@plt>
xor    %eax,%eax
call   1090 <p16_eeprom@plt>
xor    %eax,%eax
call   1070 <p16_tmr1@plt>
xor    %eax,%eax
call   1040 <p16_tmr2@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <serial@plt>

LLVM IR (-O0):
define void @PIC16F648A_periferic() {
%1 = call i32 (...) @p16_int_pin()
%2 = call i32 (...) @p16_int_portb()
%3 = call i32 (...) @p16_tmr0()
%4 = call i32 (...) @p16_wdt()
%5 = call i32 (...) @p16_eeprom()
%6 = call i32 (...) @p16_tmr1()
%7 = call i32 (...) @p16_tmr2()
%8 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F648A_periferic() {
%1 = tail call i32 (...) @p16_int_pin()
%2 = tail call i32 (...) @p16_int_portb()
%3 = tail call i32 (...) @p16_tmr0()
%4 = tail call i32 (...) @p16_wdt()
%5 = tail call i32 (...) @p16_eeprom()
%6 = tail call i32 (...) @p16_tmr1()
%7 = tail call i32 (...) @p16_tmr2()
%8 = tail call i32 @serial(i32 0)
ret void
}
/* Variables and functions */
int strnicmp(char const *, char const *, size_t);
int strncasecmp(const char *s1, const char *s2, size_t n) {
  return strnicmp(s1, s2, n);
}


x86 assembly (clang, -O0):
<strncasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strnicmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp>:
jmp    1030 <strnicmp@plt>

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

LLVM IR (-O2):
define i32 @strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strnicmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reset_virtual_fifo();
void _cc3_fifo_reset() {
  printf("cc3_fifo_reset()\n");
  reset_virtual_fifo();
}


x86 assembly (clang, -O0):
<_cc3_fifo_reset>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <reset_virtual_fifo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_fifo_reset>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reset_virtual_fifo@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"cc3_fifo_reset()\0A\00"
define void @_cc3_fifo_reset() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @reset_virtual_fifo()
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"cc3_fifo_reset()\00"
define void @_cc3_fifo_reset() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @reset_virtual_fifo()
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};
struct UPnPDevice {
  int dummy;
};

/* Variables and functions */
struct UPnPService *RNDGetService(struct UPnPDevice *, char *, int);
struct UPnPService *RNDGetService_ConnectionManager(struct UPnPDevice *device) {
  return (RNDGetService(
      device, "urn:schemas-upnp-org:service:ConnectionManager:1", 48));
}


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

x86 assembly (clang, -O2):
<RNDGetService_ConnectionManager>:
lea    0xee9(%rip),%rsi
mov    $0x30,%edx
jmp    1030 <RNDGetService@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
%struct.UPnPDevice = type { i32 }
@.str = [49 x i8] c"urn:schemas-upnp-org:service:ConnectionManager:1\00"
define %struct.UPnPService* @RNDGetService_ConnectionManager(%struct.UPnPDevice* %0) {
%2 = alloca %struct.UPnPDevice*
store %struct.UPnPDevice* %0, %struct.UPnPDevice** %2
%3 = load %struct.UPnPDevice*, %struct.UPnPDevice** %2
%4 = call %struct.UPnPService* @RNDGetService(%struct.UPnPDevice* %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 48)
ret %struct.UPnPService* %4
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
%struct.UPnPDevice = type { i32 }
@.str = [49 x i8] c"urn:schemas-upnp-org:service:ConnectionManager:1\00"
define %struct.UPnPService* @RNDGetService_ConnectionManager(%struct.UPnPDevice* %0) {
%2 = tail call %struct.UPnPService* @RNDGetService(%struct.UPnPDevice* %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 48)
ret %struct.UPnPService* %2
}
void free_splitted_string(char **list, int n) {
  int index = 0;
  for (index = 0; index < n; index++)
    free(list[index]);
  free(list);
}


x86 assembly (clang, -O0):
<free_splitted_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <free_splitted_string+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <free_splitted_string+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_splitted_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_splitted_string+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_splitted_string+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_splitted_string(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, j;
  i = 1;
  j = 1;
  while (i < 16) {
    i += 4;
    j++;
  }
  printf("%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(char const);
scalar_t__ isxdigit(char const);
char tolower(char const);
unsigned int xtoi(const char x) {
  if (isdigit(x))
    return x - '0';
  else if (isxdigit(x))
    return tolower(x) - 'a' + 10;
  else
    return 0;
}


x86 assembly (clang, -O0):
<xtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1160 <xtoi+0x30>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <xtoi+0x64>
movsbl -0x5(%rbp),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%rax
je     118d <xtoi+0x5d>
movsbl -0x5(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <xtoi+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtoi>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1145 <xtoi+0x15>
movsbl %bl,%eax
add    $0xffffffd0,%eax
pop    %rbx
ret
movsbl %bl,%ebx
mov    %ebx,%edi
call   1050 <isxdigit@plt>
test   %rax,%rax
je     1163 <xtoi+0x33>
mov    %ebx,%edi
call   1040 <tolower@plt>
movsbl %al,%eax
add    $0xffffffa9,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xtoi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isdigit(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %2
br label %22
11: ; preds = %1
%12 = load i8, i8* %3
%13 = call i64 @isxdigit(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8, i8* %3
%17 = call signext i8 @tolower(i8 signext %16)
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 97
%20 = add nsw i32 %19, 10
store i32 %20, i32* %2
br label %22
21: ; preds = %11
store i32 0, i32* %2
br label %22
22: ; preds = %21, %15, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @xtoi(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = sext i8 %0 to i32
%6 = add nsw i32 %5, -48
br label %14
7: ; preds = %1
%8 = tail call i64 @isxdigit(i8 signext %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = tail call signext i8 @tolower(i8 signext %0)
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, -87
br label %14
14: ; preds = %7, %10, %4
%15 = phi i32 [ %6, %4 ], [ %13, %10 ], [ 0, %7 ]
ret i32 %15
}