xunge/DecIR huggingface dataset:
int my_strncmp(char *s, char *t, int n) {
  for (int i = 0; i < n; ++i) {
    if (*s < *t) {
      return -1;
    } else if (*s > *t) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_strncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    117e <my_strncmp+0x7e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1144 <my_strncmp+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <my_strncmp+0x85>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    1166 <my_strncmp+0x66>
movl   $0x1,-0x4(%rbp)
jmp    1185 <my_strncmp+0x85>
jmp    116b <my_strncmp+0x6b>
jmp    1170 <my_strncmp+0x70>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <my_strncmp+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strncmp>:
test   %edx,%edx
jle    1117 <my_strncmp+0x17>
mov    (%rdi),%al
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%al
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_strncmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %33, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %36
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8*, i8** %6
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp slt i32 %16, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 -1, i32* %4
br label %37
22: ; preds = %13
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i8*, i8** %6
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp sgt i32 %25, %28
br i1 %29, label %30, label %31
30: ; preds = %22
store i32 1, i32* %4
br label %37
31: ; preds = %22
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %9
36: ; preds = %9
store i32 0, i32* %4
br label %37
37: ; preds = %36, %30, %21
%38 = load i32, i32* %4
ret i32 %38
}

LLVM IR (-O2):
define i32 @my_strncmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = load i8, i8* %0
%7 = load i8, i8* %1
%8 = icmp slt i8 %6, %7
%9 = icmp eq i8 %6, %7
%10 = select i1 %8, i32 -1, i32 1
%11 = select i1 %9, i32 0, i32 %10
br label %12
12: ; preds = %5, %3
%13 = phi i32 [ 0, %3 ], [ %11, %5 ]
ret i32 %13
}
short dns_cache_events(struct dns_cache *cache) { return 0; }


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

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

LLVM IR (-O0):
%struct.dns_cache = type opaque
define signext i16 @dns_cache_events(%struct.dns_cache* %0) {
%2 = alloca %struct.dns_cache*
store %struct.dns_cache* %0, %struct.dns_cache** %2
ret i16 0
}

LLVM IR (-O2):
%struct.dns_cache = type opaque
define signext i16 @dns_cache_events(%struct.dns_cache* nocapture readnone %0) {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ little_endian();
int big_endian() { return (!little_endian()); }


x86 assembly (clang, -O0):
<big_endian>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <little_endian@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @big_endian() {
%1 = call i32 (...) @little_endian()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @big_endian() {
%1 = tail call i32 (...) @little_endian()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ in_current_set(unsigned char);
int /*<<< orphan*/ set_up_table(unsigned char const *, int);
size_t xstrspn(const char *src, const char *set) {
  size_t i;
  set_up_table((const unsigned char *)set, false);
  for (i = 0; in_current_set((unsigned char)src[i]); i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<xstrspn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <set_up_table@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <in_current_set@plt>
cmp    $0x0,%rax
je     1174 <xstrspn+0x54>
jmp    1163 <xstrspn+0x43>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1143 <xstrspn+0x23>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrspn>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <set_up_table@plt>
mov    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%r14,%rbx,1),%edi
call   1040 <in_current_set@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1140 <xstrspn+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @xstrspn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @set_up_table(i8* %6, i32 0)
store i64 0, i64* %5
br label %8
8: ; preds = %16, %2
%9 = load i8*, i8** %3
%10 = load i64, i64* %5
%11 = getelementptr inbounds i8, i8* %9, i64 %10
%12 = load i8, i8* %11
%13 = call i64 @in_current_set(i8 zeroext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %8
19: ; preds = %8
%20 = load i64, i64* %5
ret i64 %20
}

LLVM IR (-O2):
define i64 @xstrspn(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @set_up_table(i8* %1, i32 0)
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ 0, %2 ], [ %10, %4 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i64 @in_current_set(i8 zeroext %7)
%9 = icmp eq i64 %8, 0
%10 = add i64 %5, 1
br i1 %9, label %11, label %4
11: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void spaces(int x) {
  do {
    printf(" ");
  } while (--x > 0);
}


x86 assembly (clang, -O0):
<spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jg     111b <spaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaces>:
push   %rbx
mov    %edi,%ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jg     1120 <spaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @spaces(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i32 @putchar(i32 32)
%5 = add nsw i32 %3, -1
%6 = icmp sgt i32 %3, 1
br i1 %6, label %2, label %7
7: ; preds = %2
ret void
}
int eround(flnum)
double flnum;
{ return ((flnum >= 0.0) ? (int)(flnum + 0.5) : (int)(flnum - 0.5)); }


x86 assembly (clang, -O0):
<eround>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <eround+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <eround+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eround>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @eround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i32
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = fptosi double %11 to i32
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @eround(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
int cplml_vi_platform_init();
int cplml_vi_init(void) { return cplml_vi_platform_init(); }


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

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

LLVM IR (-O0):
define i32 @cplml_vi_init() {
%1 = call i32 (...) @cplml_vi_platform_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @cplml_vi_init() {
%1 = tail call i32 (...) @cplml_vi_platform_init()
ret i32 %1
}
void ar2315_arch_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ar2315_arch_init() {
ret void
}
/* Variables and functions */
scalar_t__ blake2b_selftest();
int /*<<< orphan*/ printf(char *, char *);
void self_test() {
  printf("blake2b_selftest() = %s\n", blake2b_selftest() ? "FAIL" : "OK");
}


x86 assembly (clang, -O0):
<self_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <blake2b_selftest@plt>
mov    %rax,%rcx
lea    0xee9(%rip),%rsi
lea    0xedd(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<self_test>:
push   %rax
xor    %eax,%eax
call   1040 <blake2b_selftest@plt>
test   %rax,%rax
lea    0xeec(%rip),%rax
lea    0xee0(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"blake2b_selftest() = %s\0A\00"
@.str.1 = [5 x i8] c"FAIL\00"
@.str.2 = [3 x i8] c"OK\00"
define void @self_test() {
%1 = call i64 (...) @blake2b_selftest()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"blake2b_selftest() = %s\0A\00"
@.str.1 = [5 x i8] c"FAIL\00"
@.str.2 = [3 x i8] c"OK\00"
define void @self_test() {
%1 = tail call i64 (...) @blake2b_selftest()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void testCopying() {
  struct a {
    int a[10];
    char c;
  } a, b;
  a.c = 37;
  b.c = 38;
  b = a;
  printf("testCopying: %d == %d\n", a.c, b.c);
}


x86 assembly (clang, -O0):
<testCopying>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movb   $0x25,-0x8(%rbp)
movb   $0x26,-0x38(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
movsbl -0x8(%rbp),%esi
movsbl -0x38(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCopying>:
lea    0xee9(%rip),%rdi
mov    $0x25,%esi
mov    $0x25,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.a = type { [10 x i32], i8 }
@.str = [23 x i8] c"testCopying: %d == %d\0A\00"
define void @testCopying() {
%1 = alloca %struct.a
%2 = alloca %struct.a
%3 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
store i8 37, i8* %3
%4 = getelementptr inbounds %struct.a, %struct.a* %2, i32 0, i32 1
store i8 38, i8* %4
%5 = bitcast %struct.a* %2 to i8*
%6 = bitcast %struct.a* %1 to i8*
%7 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds %struct.a, %struct.a* %2, i32 0, i32 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"testCopying: %d == %d\0A\00"
define void @testCopying() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 37, i32 37)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
scalar_t__ pthread_mutex_destroy(int /*<<< orphan*/ *);
scalar_t__ pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int mutex_reinit(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) {
  int result = 1;
  if (pthread_mutex_destroy(mutex) == 0 && pthread_mutex_init(mutex, attr) == 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<mutex_reinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
cmp    $0x0,%rax
jne    1168 <mutex_reinit+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_mutex_init@plt>
cmp    $0x0,%rax
jne    1168 <mutex_reinit+0x48>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_reinit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <pthread_mutex_destroy@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1152 <mutex_reinit+0x32>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <pthread_mutex_init@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @mutex_reinit(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 1, i32* %5
%6 = load i32*, i32** %3
%7 = call i64 @pthread_mutex_destroy(i32* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32*, i32** %4
%12 = call i64 @pthread_mutex_init(i32* %10, i32* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 0, i32* %5
br label %15
15: ; preds = %14, %9, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @mutex_reinit(i32* %0, i32* %1) {
%3 = tail call i64 @pthread_mutex_destroy(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @pthread_mutex_init(i32* %0, i32* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ handle_48(int /*<<< orphan*/);
int gen_48() { handle_48(0); }


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

x86 assembly (clang, -O2):
<gen_48>:
xor    %edi,%edi
jmp    1030 <handle_48@plt>

LLVM IR (-O0):
define i32 @gen_48() {
%1 = alloca i32
%2 = call i32 @handle_48(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_48() {
%1 = tail call i32 @handle_48(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ times();
main() {
  foo();
  times();
  times();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @times()
%3 = tail call i32 (...) @times()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VDP_drawText(char *, int, int);
int /*<<< orphan*/ VDP_init();
int /*<<< orphan*/ showExceptionDump(int);
void _errorexception_callback() {
  VDP_init();
  VDP_drawText("EXCEPTION ERROR !", 5, 3);
  showExceptionDump(5);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_errorexception_callback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VDP_init@plt>
lea    0xebe(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
call   1050 <VDP_drawText@plt>
mov    $0x5,%edi
call   1040 <showExceptionDump@plt>
jmp    115b <_errorexception_callback+0x2b>

x86 assembly (clang, -O2):
<_errorexception_callback>:
push   %rax
xor    %eax,%eax
call   1030 <VDP_init@plt>
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
call   1050 <VDP_drawText@plt>
mov    $0x5,%edi
call   1040 <showExceptionDump@plt>
nopl   0x0(%rax,%rax,1)
jmp    1160 <_errorexception_callback+0x30>

LLVM IR (-O0):
@.str = [18 x i8] c"EXCEPTION ERROR !\00"
define void @_errorexception_callback() {
%1 = call i32 (...) @VDP_init()
%2 = call i32 @VDP_drawText(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5, i32 3)
%3 = call i32 @showExceptionDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"EXCEPTION ERROR !\00"
define void @_errorexception_callback() {
%1 = tail call i32 (...) @VDP_init()
%2 = tail call i32 @VDP_drawText(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5, i32 3)
%3 = tail call i32 @showExceptionDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int check_index_outofbound(int osii_index) {
  if (osii_index < 0 || osii_index >= 8) {
    fprintf(stderr, "Bad OSII index %d\n", osii_index);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_index_outofbound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112f <check_index_outofbound+0x1f>
cmpl   $0x8,-0x8(%rbp)
jl     1153 <check_index_outofbound+0x43>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <check_index_outofbound+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_index_outofbound>:
xor    %eax,%eax
cmp    $0x8,%edi
jb     1138 <check_index_outofbound+0x28>
push   %rax
mov    %edi,%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Bad OSII index %d\0A\00"
define i32 @check_index_outofbound(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 8
br i1 %8, label %9, label %13
9: ; preds = %6, %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* %3
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 -1, i32* %2
br label %14
13: ; preds = %6
store i32 0, i32* %2
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Bad OSII index %d\0A\00"
define i32 @check_index_outofbound(i32 %0) {
%2 = icmp ugt i32 %0, 7
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ print_permutations(char *, int /*<<< orphan*/, int);
int strlen(char *);
int main(int argc, char *argv[]) {
  char str[] = "random";
  int len = strlen(str);
  print_permutations(str, 0, len - 1);
  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)
mov    0xec4(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x17(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x17(%rbp),%rdi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <print_permutations@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x6d6f64,0xb(%rsp)
movl   $0x646e6172,0x8(%rsp)
64
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <print_permutations@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [7 x i8] c"random\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [7 x i8]* %6 to i8*
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %7
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* %7
%13 = sub nsw i32 %12, 1
%14 = call i32 @print_permutations(i8* %11, i32 0, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [7 x i8] c"random\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, -1
%7 = call i32 @print_permutations(i8* %4, i32 0, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  fork();
  fork();
  fork();
  printf("helloword %d\n", getpid());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"helloword %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = call i32 (...) @fork()
%4 = call i32 (...) @fork()
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"helloword %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 (...) @fork()
%3 = tail call i32 (...) @fork()
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int isNumeric(char in) { return (in >= '0' && in <= '9') || in == '.'; }


x86 assembly (clang, -O0):
<isNumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <isNumeric+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1136 <isNumeric+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumeric>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
cmp    $0x2e,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isNumeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 46
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isNumeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = icmp eq i8 %0, 46
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void comment(char *s) { printf("\n# %s\n", s); }


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

x86 assembly (clang, -O2):
<comment>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A# %s\0A\00"
define void @comment(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int rand();
float frand(void) { return (rand() & 32767) * (1.0 / 32767); }


x86 assembly (clang, -O0):
<frand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @frand() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 32767
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3F00002000400080
%5 = fptrunc double %4 to float
ret float %5
}

LLVM IR (-O2):
define float @frand() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 32767
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3F00002000400080
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _time_error(char const *message, int ret) {
  fputs("time"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_time_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_time_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"time: \00"
@stderr = global i32 0
define i32 @_time_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"time: \00"
@stderr = global i32 0
define i32 @_time_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
void store_epi32(__m128i x, uint32_t *x0, uint32_t *x1, uint32_t *x2,
                 uint32_t *x3) {
  union {
    uint32_t ret[4];
    __m128i x;
  } box = {.x = x};
  *x0 = box.ret[3];
  *x1 = box.ret[2];
  *x2 = box.ret[1];
  *x3 = box.ret[0];
}


x86 assembly (clang, -O0):
<store_epi32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_epi32>:
mov    %edi,(%r8)
ret

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
define void @store_epi32(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca %union.anon
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = bitcast %union.anon* %11 to i32*
%13 = load i32, i32* %6
store i32 %13, i32* %12
%14 = bitcast %union.anon* %11 to [4 x i32]*
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 3
%16 = load i32, i32* %15
%17 = load i32*, i32** %7
store i32 %16, i32* %17
%18 = bitcast %union.anon* %11 to [4 x i32]*
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %18, i64 0, i64 2
%20 = load i32, i32* %19
%21 = load i32*, i32** %8
store i32 %20, i32* %21
%22 = bitcast %union.anon* %11 to [4 x i32]*
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %22, i64 0, i64 1
%24 = load i32, i32* %23
%25 = load i32*, i32** %9
store i32 %24, i32* %25
%26 = bitcast %union.anon* %11 to [4 x i32]*
%27 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 0
%28 = load i32, i32* %27
%29 = load i32*, i32** %10
store i32 %28, i32* %29
ret void
}

LLVM IR (-O2):
define void @store_epi32(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture writeonly %4) {
store i32 %0, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setp(int (*)(), int);
int main(void) {
  int (*p)(void);
  int i;
  for (i = 0; i < 10000000; i++) {
    setp(&p, i);
    p();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x989680,-0x14(%rbp)
jge    1150 <main+0x40>
lea    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <setp@plt>
call   *-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    %rsp,%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <setp@plt>
call   *(%rsp)
add    $0x1,%ebx
cmp    $0x989680,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32 ()*
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10000000
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = bitcast i32 ()** %2 to i32 (...)*
%9 = load i32, i32* %3
%10 = call i32 @setp(i32 (...)* %8, i32 %9)
%11 = load i32 ()*, i32 ()** %2
%12 = call i32 %11()
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32 ()*
%2 = bitcast i32 ()** %1 to i8*
%3 = bitcast i32 ()** %1 to i32 (...)*
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %9, %4 ]
%6 = call i32 @setp(i32 (...)* %3, i32 %5)
%7 = load i32 ()*, i32 ()** %1
%8 = call i32 %7()
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, 10000000
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 0
}
int TrioIsQualifier(const char character) {
  switch (character) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
  case '+':
  case '-':
  case ' ':
  case '.':
  case '*':
  case '#':
  case 'h':
  case 'l':
  case 'L':
  case '^':
  case 'z':
  case 't':
  case 'j':
  case 'q':
  case 'Z':
  case 'w':
  case 'I':
    return (!(1 == 0));
  default:
    return (1 == 0);
  }
}


x86 assembly (clang, -O0):
<TrioIsQualifier>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5a,%eax
ja     1140 <TrioIsQualifier+0x40>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1147 <TrioIsQualifier+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrioIsQualifier>:
add    $0xffffffe0,%edi
cmp    $0x5a,%edi
ja     111e <TrioIsQualifier+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @TrioIsQualifier(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
i32 43, label %6
i32 45, label %6
i32 32, label %6
i32 46, label %6
i32 42, label %6
i32 35, label %6
i32 104, label %6
i32 108, label %6
i32 76, label %6
i32 94, label %6
i32 122, label %6
i32 116, label %6
i32 106, label %6
i32 113, label %6
i32 90, label %6
i32 119, label %6
i32 73, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @TrioIsQualifier(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 48, label %4
i32 49, label %4
i32 50, label %4
i32 51, label %4
i32 52, label %4
i32 53, label %4
i32 54, label %4
i32 55, label %4
i32 56, label %4
i32 57, label %4
i32 43, label %4
i32 45, label %4
i32 32, label %4
i32 46, label %4
i32 42, label %4
i32 35, label %4
i32 104, label %4
i32 108, label %4
i32 76, label %4
i32 94, label %4
i32 122, label %4
i32 116, label %4
i32 106, label %4
i32 113, label %4
i32 90, label %4
i32 119, label %4
i32 73, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ chtype;

/* Variables and functions */
int /*<<< orphan*/ addch(int /*<<< orphan*/);
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_addch(int nargs, char **args) {
  chtype *ch;
  if (check_arg_count(nargs, 1) == 1)
    return;
  ch = (chtype *)args[0];
  report_count(1);
  report_return(addch(ch[0]));
}


x86 assembly (clang, -O0):
<cmd_addch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    116a <cmd_addch+0x2a>
jmp    1191 <cmd_addch+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1060 <addch@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_addch>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1155 <cmd_addch+0x15>
pop    %rbx
ret
mov    (%rbx),%rbx
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    (%rbx),%edi
call   1060 <addch@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <report_return@plt>

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

LLVM IR (-O2):
define void @cmd_addch(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = bitcast i8** %1 to i32**
%7 = load i32*, i32** %6
%8 = tail call i32 @report_count(i32 1)
%9 = load i32, i32* %7
%10 = tail call i32 @addch(i32 %9)
%11 = tail call i32 @report_return(i32 %10)
br label %12
12: ; preds = %2, %5
ret void
}
long roundi(float x) { return (long)(x + 0.5); }


x86 assembly (clang, -O0):
<roundi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundi>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @roundi(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @roundi(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 5.000000e-01
%4 = fptosi double %3 to i64
ret i64 %4
}
int compareINT(const void *A, const void *B) { return *(int *)A - *(int *)B; }


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

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

LLVM IR (-O0):
define i32 @compareINT(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compareINT(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int test_imm_E2int8_mem(signed char *val) {
  return ((*val) & (0xE2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E2int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -30
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int get(int *);
int /*<<< orphan*/ set(int **);
int test(int *ptr) {
  get(ptr);
  set(&ptr);
  return get(ptr);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %rdi,(%rsp)
call   1030 <get@plt>
mov    %rsp,%rdi
call   1040 <set@plt>
mov    (%rsp),%rdi
call   1030 <get@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @get(i32* %3)
%5 = call i32 @set(i32** %2)
%6 = load i32*, i32** %2
%7 = call i32 @get(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = tail call i32 @get(i32* %0)
%4 = call i32 @set(i32** %2)
%5 = load i32*, i32** %2
%6 = call i32 @get(i32* %5)
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_target_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(285, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_multprec_target_solutions_to_container>:
mov    $0x11d,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @copy_multprec_target_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 285, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void arrayShiftLeft(int array[], int size) {
  int temporary = array[0];
  for (int i = 1; i < size; i++) {
    array[i - 1] = array[i];
  }
  array[size - 1] = temporary;
}


x86 assembly (clang, -O0):
<arrayShiftLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <arrayShiftLeft+0x50>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <arrayShiftLeft+0x1b>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayShiftLeft>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%ebp
cmp    $0x1,%esi
jle    1139 <arrayShiftLeft+0x29>
lea    0x4(%r14),%rsi
add    $0xffffffff,%ebx
lea    0x0(,%rbx,4),%rdx
mov    %r14,%rdi
call   1030 <memmove@plt>
jmp    113c <arrayShiftLeft+0x2c>
add    $0xffffffff,%ebx
movslq %ebx,%rax
mov    %ebp,(%r14,%rax,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @arrayShiftLeft(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %1, 1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = add nsw i32 %1, -1
br label %14
7: ; preds = %2
%8 = bitcast i32* %0 to i8*
%9 = getelementptr i32, i32* %0, i64 1
%10 = bitcast i32* %9 to i8*
%11 = add nsw i32 %1, -1
%12 = zext i32 %11 to i64
%13 = shl nuw nsw i64 %12, 2
br label %14
14: ; preds = %5, %7
%15 = phi i32 [ %6, %5 ], [ %11, %7 ]
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %0, i64 %16
store i32 %3, i32* %17
ret void
}
void *pdvpf(void *context) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @pdvpf(i8* nocapture readnone %0) {
ret i8* null
}