xunge/DecIR huggingface dataset:
unsigned xrop3_20_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_20_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_20_0_0>:
mov    %edi,%eax
xor    %esi,%eax
shl    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_20_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_20_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %1, %0
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
ret i32 %5
}
/* Variables and functions */
int of_call_prom(char *, int, int, void const *, char const *, void const *,
                 int const);
int of_setprop(const void *phandle, const char *name, const void *buf,
               const int buflen) {
  return of_call_prom("setprop", 4, 1, phandle, name, buf, buflen);
}


x86 assembly (clang, -O0):
<of_setprop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x1c(%rbp),%eax
lea    0xec3(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %eax,(%rsp)
call   1030 <of_call_prom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_setprop>:
push   %rax
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rax
mov    %ecx,(%rsp)
lea    0xedc(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <of_call_prom@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"setprop\00"
define i32 @of_setprop(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @of_call_prom(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i8* %0, i8* %1, i8* %2, i32 %3)
ret i32 %5
}
const char *esd_audio_devices() { return "/dev/dsp, /dev/dsp2, etc."; }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"/dev/dsp, /dev/dsp2, etc.\00"
define i8* @esd_audio_devices() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [26 x i8] c"/dev/dsp, /dev/dsp2, etc.\00"
define i8* @esd_audio_devices() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("\nHello World...!!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0AHello World...!!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"\0AHello World...!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int bigrand();
int randint(int n, int u) { return n + bigrand() % (u - n + 1); }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <bigrand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <bigrand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randint(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 = call i32 (...) @bigrand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @bigrand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
int history_search(string, direction) const char *string;
int direction;
{ return (history_search_internal(string, direction, 0)); }


x86 assembly (clang, -O0):
<history_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <history_search_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<history_search>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <history_search_internal@plt>

LLVM IR (-O0):
define i32 @history_search(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 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @history_search_internal to i32 (i8*, i32, i32, ...)*)(i8* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @history_search(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @history_search_internal to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_keysym_undef(long);
void keyboard_set_unmap_any(signed long sym) { keyboard_keysym_undef(sym); }


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

x86 assembly (clang, -O2):
<keyboard_set_unmap_any>:
jmp    1030 <keyboard_keysym_undef@plt>

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

LLVM IR (-O2):
define void @keyboard_set_unmap_any(i64 %0) {
%2 = tail call i32 @keyboard_keysym_undef(i64 %0)
ret void
}
int tls13_client_hello_recv(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_hello_recv(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
long double atan2(long double, int);
long double atanl(long double x) { return atan2(x, 1.); }


x86 assembly (clang, -O0):
<atanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x1,%edi
call   1030 <atan2@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanl>:
mov    $0x1,%edi
jmp    1030 <atan2@plt>

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

LLVM IR (-O2):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @atan2(x86_fp80 %0, i32 1)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ or_1();
int /*<<< orphan*/ or_2();
int main() {
  or_1();
  or_2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <or_1@plt>
mov    $0x0,%al
call   1030 <or_2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <or_1@plt>
xor    %eax,%eax
call   1030 <or_2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @or_1()
%2 = tail call i32 (...) @or_2()
ret i32 0
}
alpha(c) char c;
{
  if (c <= 'z' && c >= 'a')
    return (1);
  if (c <= 'Z' && c >= 'A')
    return (1);
  if (c == '_')
    return (1);
  if (c == '.')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <alpha+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <alpha+0x30>
movl   $0x1,-0x4(%rbp)
jmp    118f <alpha+0x8f>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <alpha+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <alpha+0x56>
movl   $0x1,-0x4(%rbp)
jmp    118f <alpha+0x8f>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    116f <alpha+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    118f <alpha+0x8f>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    1188 <alpha+0x88>
movl   $0x1,-0x4(%rbp)
jmp    118f <alpha+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
shl    $0x18,%edi
mov    %edi,%eax
and    $0xdf000000,%eax
add    $0xbfffffff,%eax
cmp    $0x1affffff,%eax
setb   %al
cmp    $0x5f000000,%edi
sete   %cl
cmp    $0x2e000000,%edi
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @alpha(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %33
13: ; preds = %8, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 90
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %2
br label %33
22: ; preds = %17, %13
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 95
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 1, i32* %2
br label %33
27: ; preds = %22
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 46
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 1, i32* %2
br label %33
32: ; preds = %27
store i32 0, i32* %2
br label %33
33: ; preds = %32, %31, %26, %21, %12
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @alpha(i32 %0) {
%2 = shl i32 %0, 24
%3 = and i32 %2, -553648128
%4 = add i32 %3, -1073741825
%5 = icmp ult i32 %4, 452984831
%6 = icmp eq i32 %2, 1593835520
%7 = icmp eq i32 %2, 771751936
%8 = or i1 %6, %7
%9 = or i1 %8, %5
%10 = zext i1 %9 to i32
ret i32 %10
}
void simd_init(void) {}


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

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

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

LLVM IR (-O2):
define void @simd_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char const *);
void fatal_error(const char *error) {
  puts(error);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
call   1030 <puts@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @fatal_error(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
char *strchr(char *, char);
int count_iovec(char *arg) {
  int count = 1;
  char *pch = strchr(arg, ':');
  while (pch != NULL) {
    ++count;
    pch = strchr(++pch, ':');
  }
  return count;
}


x86 assembly (clang, -O0):
<count_iovec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1168 <count_iovec+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x18(%rbp)
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
jmp    1135 <count_iovec+0x25>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_iovec>:
push   %rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1149 <count_iovec+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <count_iovec+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @count_iovec(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 1, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = tail call i8* @strchr(i8* %8, i8 signext 58)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %12
}
int presetlevel2pct(unsigned char level) {
  static unsigned char table[32] = {0,  18, 21, 23, 27, 28, 31, 34, 36, 39, 42,
                                    45, 48, 51, 54, 57, 60, 63, 67, 70, 73, 76,
                                    79, 82, 85, 87, 90, 92, 95, 97, 99, 100};
  return (int)table[((31u) < (level) ? (31u) : (level))];
}


x86 assembly (clang, -O0):
<presetlevel2pct>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1f,%eax
cmp    %ecx,%eax
jae    1128 <presetlevel2pct+0x28>
mov    $0x1f,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <presetlevel2pct+0x2f>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0x2ef3(%rip),%rax
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<presetlevel2pct>:
cmp    $0x1f,%dil
mov    $0x1f,%eax
cmovb  %edi,%eax
lea    0xeed(%rip),%rcx
movzbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
@presetlevel2pct.table = internal global [32 x i8] c"\00\12\15\17\1B\1C\1F\22$'*-0369<?CFILORUWZ\\_acd"
define i32 @presetlevel2pct(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp ult i32 31, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ 31, %6 ], [ %9, %7 ]
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [32 x i8], [32 x i8]* @presetlevel2pct.table, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@presetlevel2pct.table = internal unnamed_addr constant [32 x i8] c"\00\12\15\17\1B\1C\1F\22$'*-0369<?CFILORUWZ\\_acd"
define i32 @presetlevel2pct(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ult i32 %2, 31
%4 = select i1 %3, i32 %2, i32 31
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [32 x i8], [32 x i8]* @presetlevel2pct.table, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cm_nfree_1d(void *vector) { free(vector); }


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

x86 assembly (clang, -O2):
<cm_nfree_1d>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cm_nfree_1d(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(unsigned int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void UpdateFileNidxHeader(FILE *fp, char *file_name,
                          unsigned int *pt_node_idx) {
  rewind(fp);
  if (!fwrite(pt_node_idx, sizeof(int), 1, fp)) {
    perror(file_name);
    exit(EXIT_FAILURE);
  };
  ;
}


x86 assembly (clang, -O0):
<UpdateFileNidxHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
cmp    $0x0,%eax
jne    1194 <UpdateFileNidxHeader+0x54>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpdateFileNidxHeader>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rewind@plt>
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
test   %eax,%eax
je     1172 <UpdateFileNidxHeader+0x32>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
call   1040 <perror@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @UpdateFileNidxHeader(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = call i32 @rewind(i32* %7)
%9 = load i32*, i32** %6
%10 = load i32*, i32** %4
%11 = call i32 @fwrite(i32* %9, i32 4, i32 1, i32* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call i32 @perror(i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @UpdateFileNidxHeader(i32* nocapture %0, i8* nocapture %1, i32* nocapture %2) {
%4 = tail call i32 @rewind(i32* %0)
%5 = tail call i32 @fwrite(i32* %2, i32 4, i32 1, i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = tail call i32 @perror(i8* %1)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FLEXRAM_DriverIRQHandler();
__attribute__((weak)) void FLEXRAM_IRQHandler(void) {
  FLEXRAM_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @FLEXRAM_IRQHandler() {
%1 = call i32 (...) @FLEXRAM_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @FLEXRAM_IRQHandler() {
%1 = tail call i32 (...) @FLEXRAM_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  char num[12];
  printf(">");
  scanf("%s", num);
  data(num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x1c(%rbp),%rdi
call   1040 <data@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x3e,%edi
call   1030 <putchar@plt>
lea    0xeba(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <data@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @putchar(i32 62)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @data(i8* %4)
ret i32 0
}
int cast_char_int_fast(char x) { return (int)x; }


x86 assembly (clang, -O0):
<cast_char_int_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cast_char_int_fast(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @cast_char_int_fast(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
int mystrnlen(char *data, int max_len) {
  int len = 0;
  while ((max_len--) && (*data++))
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<mystrnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1146 <mystrnlen+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1156 <mystrnlen+0x56>
jmp    1164 <mystrnlen+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <mystrnlen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrnlen>:
test   %esi,%esi
je     111f <mystrnlen+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <mystrnlen+0x22>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <mystrnlen+0x10>
ret
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mystrnlen(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
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %10, %6
%17 = phi i1 [ false, %6 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %16
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @mystrnlen(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %11
%5 = phi i32 [ %8, %11 ], [ %1, %2 ]
%6 = phi i32 [ %13, %11 ], [ 0, %2 ]
%7 = phi i8* [ %12, %11 ], [ %0, %2 ]
%8 = add nsw i32 %5, -1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %8, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %11, %2
%16 = phi i32 [ 0, %2 ], [ %1, %11 ], [ %6, %4 ]
ret i32 %16
}
/* Variables and functions */
int strlen(const char *s) {
  int n;
  n = 0;
  while (*s++)
    n++;
  return (n);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%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
ret i32 %13
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
char *read_file(filename, len)
char *filename;
int *len;
{
  if (filename[0] == '-' && filename[1] == '\0') {
    return (get_data_from_stdin(len));
  } else {
    return (get_data_from_file(filename, len));
  }
}


x86 assembly (clang, -O0):
<read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1167 <read_file+0x47>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1167 <read_file+0x47>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <get_data_from_stdin@plt>
cltq
mov    %rax,-0x8(%rbp)
jmp    117c <read_file+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <get_data_from_file@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    112c <read_file+0xc>
cmpb   $0x0,0x1(%rdi)
je     1135 <read_file+0x15>
xor    %eax,%eax
call   1030 <get_data_from_file@plt>
jmp    113f <read_file+0x1f>
mov    %rsi,%rdi
xor    %eax,%eax
call   1040 <get_data_from_stdin@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @read_file(i8* %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 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = load i32*, i32** %5
%19 = call i32 (i32*, ...) bitcast (i32 (...)* @get_data_from_stdin to i32 (i32*, ...)*)(i32* %18)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %3
br label %28
22: ; preds = %11, %2
%23 = load i8*, i8** %4
%24 = load i32*, i32** %5
%25 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @get_data_from_file to i32 (i8*, i32*, ...)*)(i8* %23, i32* %24)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %3
br label %28
28: ; preds = %22, %17
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @read_file(i8* %0, i32* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 (i32*, ...) bitcast (i32 (...)* @get_data_from_stdin to i32 (i32*, ...)*)(i32* %1)
br label %13
11: ; preds = %5, %2
%12 = tail call i32 (i8*, i32*, ...) bitcast (i32 (...)* @get_data_from_file to i32 (i8*, i32*, ...)*)(i8* %0, i32* %1)
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}
/* Variables and functions */
int euler_problem_8();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", euler_problem_8());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <euler_problem_8@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%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() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @euler_problem_8()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @euler_problem_8()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void MemFree(void *addr, size_t size) { munmap(addr, size); }


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

x86 assembly (clang, -O2):
<MemFree>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @MemFree(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
void gdk_window_set_icon_name() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_icon_name() {
ret void
}
int MAX(int X, int Y) { return ((X) > (Y)) ? (X) : (Y); }


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <MAX+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <MAX+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @MAX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @MAX(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void sequential_scheduling_setup(int n, int p, int iam) {}


x86 assembly (clang, -O0):
<sequential_scheduling_setup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sequential_scheduling_setup(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @sequential_scheduling_setup(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arg_i(void) { printf("i\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"i\00"
define void @arg_i() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int count_digits(int num) {
  int count = 0;
  do {
    count++;
    num /= 10;
  } while (num != 0);
  return count;
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    110e <count_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <count_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_digits(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = sdiv i32 %3, 10
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ help();
scalar_t__ kbd();
int /*<<< orphan*/ printf(char *, char *, int, int);
int main(int argc, char *argv[]) {
  printf("This is in main, VERSION=%s, min version=%d, major version=%d\n",
         "1.0.1", 1, 1);
  help();
  while (kbd()) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <help@plt>
mov    $0x0,%al
call   1040 <kbd@plt>
cmp    $0x0,%rax
je     117d <main+0x4d>
jmp    1167 <main+0x37>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xf00(%rip),%rsi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <help@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <kbd@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"This is in main, VERSION=%s, min version=%d, major version=%d\0A\00"
@.str.1 = [6 x i8] c"1.0.1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1)
%7 = call i32 (...) @help()
br label %8
8: ; preds = %11, %2
%9 = call i64 (...) @kbd()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %8
12: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"This is in main, VERSION=%s, min version=%d, major version=%d\0A\00"
@.str.1 = [6 x i8] c"1.0.1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1)
%4 = tail call i32 (...) @help()
br label %5
5: ; preds = %5, %2
%6 = tail call i64 (...) @kbd()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %5
8: ; preds = %5
ret i32 0
}
int stlmatch(big, small)
char *small, *big;
{
  register char *s, *b;
  s = small;
  b = big;
  do {
    if (*s == '\0')
      return (1);
  } while (*s++ == *b++);
  return (0);
}


x86 assembly (clang, -O0):
<stlmatch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <stlmatch+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1170 <stlmatch+0x70>
jmp    113d <stlmatch+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     111c <stlmatch+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stlmatch>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1127 <stlmatch+0x27>
lea    0x1(%rax),%rdx
cmp    (%rdi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <stlmatch+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @stlmatch(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %1, %2 ], [ %9, %8 ]
%5 = phi i8* [ %0, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %6, %11
br i1 %12, label %3, label %13
13: ; preds = %8, %3
%14 = phi i32 [ 1, %3 ], [ 0, %8 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_x(void *_p, int _v) {
  ((XKeyPressedEvent *)_p)->x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyPressedEvent_x>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XKeyPressedEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long blue_mask;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_blue_mask(void *_p, unsigned long _v) {
  ((XImage *)_p)->blue_mask = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XImage_blue_mask>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XImage_blue_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_35(int /*<<< orphan*/);
int gen_35(void) {
  handle_35(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<gen_35>:
push   %rax
xor    %edi,%edi
call   1030 <handle_35@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_35() {
%1 = call i32 @handle_35(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_35() {
%1 = tail call i32 @handle_35(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ remove(char *);
void edit_locker1(int ready) {
  if (ready) {
    int fd = creat("1.locker", 0666);
    close(fd);
  } else
    remove("1.locker");
}


x86 assembly (clang, -O0):
<edit_locker1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1166 <edit_locker1+0x36>
lea    0xeb4(%rip),%rdi
mov    $0x1b6,%esi
call   1050 <creat@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
jmp    1172 <edit_locker1+0x42>
lea    0xe93(%rip),%rdi
call   1030 <remove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edit_locker1>:
test   %edi,%edi
je     114e <edit_locker1+0x1e>
push   %rax
lea    0xec4(%rip),%rdi
mov    $0x1b6,%esi
call   1050 <creat@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <close@plt>
lea    0xeab(%rip),%rdi
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"1.locker\00"
define void @edit_locker1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 438)
%5 = tail call i32 @close(i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 @remove(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}