xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pr_inf(char *);
int stress_set_ipsec_mb_feature(const char *opt) {
  (void)opt;
  pr_inf("option --ipsec-mb-feature not supported on this system.\n");
  return -1;
}


x86 assembly (clang, -O0):
<stress_set_ipsec_mb_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <pr_inf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_set_ipsec_mb_feature>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <pr_inf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"option --ipsec-mb-feature not supported on this system.\0A\00"
define i32 @stress_set_ipsec_mb_feature(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [57 x i8] c"option --ipsec-mb-feature not supported on this system.\0A\00"
define i32 @stress_set_ipsec_mb_feature(i8* nocapture readnone %0) {
%2 = tail call i32 @pr_inf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *_strdup(const char *s) {
  size_t l = strlen(s);
  char *r = malloc(l + 1);
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
float *getFraction(float *array, int *node, int *n) {
  return array + node[2] * n[0] * n[1] + node[1] * n[0] + node[0];
}


x86 assembly (clang, -O0):
<getFraction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
mov    -0x18(%rbp),%rdx
imul   0x4(%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFraction>:
movslq 0x8(%rsi),%rax
movslq (%rdx),%rcx
imul   %rcx,%rax
movslq 0x4(%rdx),%rdx
imul   %rax,%rdx
lea    (%rdi,%rdx,4),%rax
movslq 0x4(%rsi),%rdx
imul   %rcx,%rdx
lea    (%rax,%rdx,4),%rax
movslq (%rsi),%rcx
lea    (%rax,%rcx,4),%rax
ret

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

LLVM IR (-O2):
define float* @getFraction(float* readnone %0, i32* nocapture %1, i32* nocapture %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = load i32, i32* %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, %5
%8 = getelementptr inbounds i32, i32* %2, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %0, i64 %11
%13 = getelementptr inbounds i32, i32* %1, i64 1
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds float, float* %12, i64 %16
%18 = load i32, i32* %1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %17, i64 %19
ret float* %20
}
void foo_weak(void) {
  if (0) {
  }
  if (0) {
  }
  if (0) {
  }
  if (0) {
  }
}


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

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

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

LLVM IR (-O2):
define void @foo_weak() {
ret void
}
void cycle_length_fun(int i, int *cycle_length) {
  *cycle_length = 1;
  do {
    if (i % 2 != 1)
      i = i / 2;
    else
      i = 3 * i + 1;
    *cycle_length += 1;
  } while (i > 1);
}


x86 assembly (clang, -O0):
<cycle_length_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     113c <cycle_length_fun+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1146 <cycle_length_fun+0x46>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
cmpl   $0x1,-0x4(%rbp)
jg     1115 <cycle_length_fun+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_length_fun>:
mov    $0x1,%r8d
jmp    111d <cycle_length_fun+0x1d>
nopl   0x0(%rax,%rax,1)
sar    %ecx
mov    %ecx,%edi
add    $0x1,%r8d
cmp    $0x1,%edi
jle    113a <cycle_length_fun+0x3a>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
mov    %ecx,%edx
and    $0xfffffffe,%edx
mov    %edi,%eax
sub    %edx,%eax
cmp    $0x1,%eax
jne    1110 <cycle_length_fun+0x10>
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
jmp    1114 <cycle_length_fun+0x14>
mov    %r8d,(%rsi)
ret

LLVM IR (-O0):
define void @cycle_length_fun(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 1, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %3
%8 = srem i32 %7, 2
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
store i32 %12, i32* %3
br label %17
13: ; preds = %6
%14 = load i32, i32* %3
%15 = mul nsw i32 3, %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %10
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
br label %21
21: ; preds = %17
%22 = load i32, i32* %3
%23 = icmp sgt i32 %22, 1
br i1 %23, label %6, label %24
24: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @cycle_length_fun(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 1, %2 ], [ %12, %3 ]
%5 = phi i32 [ %0, %2 ], [ %11, %3 ]
%6 = srem i32 %5, 2
%7 = sdiv i32 %5, 2
%8 = icmp eq i32 %6, 1
%9 = mul nsw i32 %5, 3
%10 = add nsw i32 %9, 1
%11 = select i1 %8, i32 %10, i32 %7
%12 = add nuw nsw i32 %4, 1
%13 = icmp sgt i32 %11, 1
br i1 %13, label %3, label %14
14: ; preds = %3
store i32 %12, i32* %1
ret void
}
void *copy_of(s)
char *s;
{ return dup_mem(s, strlen(s) + 1); }


x86 assembly (clang, -O0):
<copy_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x0,%al
call   1030 <dup_mem@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_of>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <dup_mem@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i8* @copy_of(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @dup_mem to i32 (i8*, i64, ...)*)(i8* %3, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @copy_of(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @dup_mem to i32 (i8*, i64, ...)*)(i8* %0, i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
unsigned int lcc_version(void) { return (((4) * 10000 + (10) * 100 + (1))); }


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

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

LLVM IR (-O0):
define i32 @lcc_version() {
ret i32 41001
}

LLVM IR (-O2):
define i32 @lcc_version() {
ret i32 41001
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printhash(unsigned char *hash) {
  int i;
  for (i = 0; i < 64; ++i) {
    printf("%02X", hash[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printhash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1155 <printhash+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printhash+0x13>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xed1(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1140 <printhash+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @printhash(i8* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 64
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 @putchar(i32 10)
ret void
}
int test_imm_0Fint32_reg(int val) { return ((val) & (0x0F << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Fint32_reg(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int isocket_init(void) {
  int retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<isocket_init>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isocket_init() {
ret i32 0
}
unsigned int hashup(char *s) {
  unsigned int hashval;
  hashval = 0;
  while (*s != '\0') {
    hashval = *s + 31 * hashval;
    s++;
  }
  return (hashval % 101);
}


x86 assembly (clang, -O0):
<hashup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hashup+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hashup+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashup>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <hashup+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashup+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hashup(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void subtracao(void *num1, void *num2) {
  int *pnum1 = (int *)num1;
  int *pnum2 = (int *)num2;
  *pnum2 = *pnum1 - *pnum2;
}


x86 assembly (clang, -O0):
<subtracao>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
sub    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @subtracao(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(void const *, size_t, size_t, int /*<<< orphan*/ *);
size_t pst_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) {
  size_t r;
  {};
  if (ptr != NULL)
    r = fwrite(ptr, size, nmemb, stream);
  else {
    r = 0;
    {};
  }
  {};
  return r;
}


x86 assembly (clang, -O0):
<pst_fwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <pst_fwrite+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fwrite@plt>
mov    %rax,-0x28(%rbp)
jmp    1159 <pst_fwrite+0x49>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pst_fwrite>:
test   %rdi,%rdi
je     111a <pst_fwrite+0xa>
jmp    1030 <fwrite@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @pst_fwrite(i8* %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
br label %8
8: ; preds = %4, %6
%9 = phi i64 [ %7, %6 ], [ 0, %4 ]
ret i64 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void FPUEnable(void) {
  (*((volatile uint32_t *)(0xE000ED88))) =
      (((*((volatile uint32_t *)(0xE000ED88))) & ~(0x00300000 | 0x00C00000)) |
       0x00300000 | 0x00C00000);
}


x86 assembly (clang, -O0):
<FPUEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed88,%eax
mov    (%rax),%ecx
and    $0xff0fffff,%ecx
or     $0x300000,%ecx
or     $0xc00000,%ecx
mov    $0xe000ed88,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUEnable>:
mov    $0xe000ed88,%eax
orl    $0xf00000,(%rax)
ret

LLVM IR (-O0):
define void @FPUEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758157192 to i32*)
%2 = and i32 %1, -15728641
%3 = or i32 %2, 3145728
%4 = or i32 %3, 12582912
store volatile i32 %4, i32* inttoptr (i64 3758157192 to i32*)
ret void
}

LLVM IR (-O2):
define void @FPUEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758157192 to i32*)
%2 = or i32 %1, 15728640
store volatile i32 %2, i32* inttoptr (i64 3758157192 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ hexa_line_two(int);
void optimain_two(int n) {
  hexa_line_two(n);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<optimain_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hexa_line_two@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimain_two>:
push   %rax
call   1040 <hexa_line_two@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @optimain_two(i32 %0) {
%2 = tail call i32 @hexa_line_two(i32 %0)
%3 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int isatty(int fd) {
  int retval;
  struct termios t;
  retval = 1;
  return (retval);
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.termios
store i32 %0, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswxdigit(int /*<<< orphan*/);
int __iswxdigit_l(wint_t c, locale_t l) { return iswxdigit(c); }


x86 assembly (clang, -O0):
<__iswxdigit_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <iswxdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswxdigit_l>:
jmp    1030 <iswxdigit@plt>

LLVM IR (-O0):
define i32 @__iswxdigit_l(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 @iswxdigit(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__iswxdigit_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswxdigit(i32 %0)
ret i32 %3
}
void ktsan_report_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_report_enable() {
ret void
}
/* Variables and functions */
int epoll_create(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int create_epoll(void) {
  int fd = epoll_create(100);
  if (fd < 0) {
    printf("create epoll failed!\n");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<create_epoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <epoll_create@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1165 <create_epoll+0x35>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_epoll>:
push   %rax
mov    $0x64,%edi
call   1040 <epoll_create@plt>
test   %eax,%eax
js     1141 <create_epoll+0x11>
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"create epoll failed!\0A\00"
define i32 @create_epoll() {
%1 = alloca i32
%2 = call i32 @epoll_create(i32 100)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [21 x i8] c"create epoll failed!\00"
define i32 @create_epoll() {
%1 = tail call i32 @epoll_create(i32 100)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret i32 %1
}
void TimerHalWaitForOcpwpClockBeingActive(void) {
  while (!((*((volatile unsigned int *)(((0x44E00000) + 0) + (0x12c)))) &
           ((0x00000010u) | (0x00000020u))))
    ;
}


x86 assembly (clang, -O0):
<TimerHalWaitForOcpwpClockBeingActive>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TimerHalWaitForOcpwpClockBeingActive+0x9>
mov    $0x44e0012c,%eax
mov    (%rax),%eax
and    $0x30,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <TimerHalWaitForOcpwpClockBeingActive+0x28>
jmp    112d <TimerHalWaitForOcpwpClockBeingActive+0x2d>
jmp    1109 <TimerHalWaitForOcpwpClockBeingActive+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerHalWaitForOcpwpClockBeingActive>:
testl  $0x30,0x44e0012c
je     1100 <TimerHalWaitForOcpwpClockBeingActive>
ret

LLVM IR (-O0):
define void @TimerHalWaitForOcpwpClockBeingActive() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1155531052 to i32*)
%3 = and i32 %2, 48
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @TimerHalWaitForOcpwpClockBeingActive() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1155531052 to i32*)
%3 = and i32 %2, 48
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int isatty(int);
int c_isatty(int desc) { return isatty(desc); }


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

x86 assembly (clang, -O2):
<c_isatty>:
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define i32 @c_isatty(i32 %0) {
%2 = tail call i32 @isatty(i32 %0)
ret i32 %2
}
/* Variables and functions */
int printf(char const *, char const *);
int asm_setflag(const char *flagname) {
  static const char asm_flagdef[] = "%-15s EQU     1\n";
  return printf(asm_flagdef, flagname);
}


x86 assembly (clang, -O0):
<asm_setflag>:
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):
<asm_setflag>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@asm_setflag.asm_flagdef = internal constant [17 x i8] c"%-15s EQU 1\0A\00"
define i32 @asm_setflag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @asm_setflag.asm_flagdef, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@asm_setflag.asm_flagdef = internal constant [17 x i8] c"%-15s EQU 1\0A\00"
define i32 @asm_setflag(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @asm_setflag.asm_flagdef, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void sighandler(int signum) {
  printf("Received signal %u\n", signum);
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Received signal %u\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"Received signal %u\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void gtk_action_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_get_type() {
ret void
}
int calculate(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<calculate>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @calculate(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @calculate(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef size_t uint64_t;

/* Variables and functions */
size_t UINT64_MAX;
void use_uint64_max_Good() {
  char arr[10];
  uint64_t x = UINT64_MAX;
  uint64_t y = UINT64_MAX - 5;
  arr[x - y] = 0;
}


x86 assembly (clang, -O0):
<use_uint64_max_Good>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%rax
sub    $0x5,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
@UINT64_MAX = global i64 0
define void @use_uint64_max_Good() {
%1 = alloca [10 x i8]
%2 = alloca i64
%3 = alloca i64
%4 = load i64, i64* @UINT64_MAX
store i64 %4, i64* %2
%5 = load i64, i64* @UINT64_MAX
%6 = sub i64 %5, 5
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = sub i64 %7, %8
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
@UINT64_MAX = global i64 0
define void @use_uint64_max_Good() {
ret void
}
int fun940() { return 940; }


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

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

LLVM IR (-O0):
define i32 @fun940() {
ret i32 940
}

LLVM IR (-O2):
define i32 @fun940() {
ret i32 940
}
int condition_i(char c) { return c == 'i'; }


x86 assembly (clang, -O0):
<condition_i>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x69,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_i>:
xor    %eax,%eax
cmp    $0x69,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_i(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 105
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_i(i8 signext %0) {
%2 = icmp eq i8 %0, 105
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRB8_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRB8_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRB8_swap(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 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRB8_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mergeIndex(int *, int, int, int);
void mergeSort(int *a, int p, int r) {
  int q;
  if (p < r) {
    q = (p + r) / 2;
    mergeSort(a, p, q);
    mergeSort(a, q + 1, r);
    mergeIndex(a, p, q, r);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <mergeIndex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %edx,%esi
jge    1172 <mergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <mergeIndex@plt>
ret

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergeSort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @mergeIndex(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
int XuanYinJianQi_cost(struct Ability *self) { return 60; }


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

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

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

LLVM IR (-O2):
%struct.Ability = type opaque
define i32 @XuanYinJianQi_cost(%struct.Ability* nocapture readnone %0) {
ret i32 60
}
/* Variables and functions */
int f117(int *);
int f118(int *p) { return f117(p); }


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

x86 assembly (clang, -O2):
<f118>:
jmp    1030 <f117@plt>

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

LLVM IR (-O2):
define i32 @f118(i32* %0) {
%2 = tail call i32 @f117(i32* %0)
ret i32 %2
}
int get(int a) { return a >= 'A' && a <= 'Z' ? a - 'A' + 10 : a - '0'; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <get+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <get+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <get+0x35>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
lea    -0x41(%rdi),%ecx
lea    -0x30(%rdi),%edx
lea    -0x37(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @get(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 10
br label %15
12: ; preds = %5, %1
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 48
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @get(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = select i1 %3, i32 -55, i32 -48
%5 = add nsw i32 %4, %0
ret i32 %5
}
int get_min_array_size32(void) { return (((19937 / 128) + 1) * 4); }


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

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

LLVM IR (-O0):
define i32 @get_min_array_size32() {
ret i32 624
}

LLVM IR (-O2):
define i32 @get_min_array_size32() {
ret i32 624
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello world!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define void @hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void target_debug_print_const_struct_target_so_opsp(
    const struct target_so_ops *ops) {}


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

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

LLVM IR (-O0):
%struct.target_so_ops = type opaque
define void @target_debug_print_const_struct_target_so_opsp(%struct.target_so_ops* %0) {
%2 = alloca %struct.target_so_ops*
store %struct.target_so_ops* %0, %struct.target_so_ops** %2
ret void
}

LLVM IR (-O2):
%struct.target_so_ops = type opaque
define void @target_debug_print_const_struct_target_so_opsp(%struct.target_so_ops* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Print_Array(int array[], int size) {
  for (int i = 0; i < size; i++)
    printf("%d\t", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<Print_Array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <Print_Array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Print_Array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print_Array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <Print_Array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <Print_Array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Print_Array(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 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @Print_Array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
waitpid() { return -1; }


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

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

LLVM IR (-O0):
define i32 @waitpid() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @waitpid() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_xor_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_xor_pd(__m128d A, __m128d B) { return _mm_xor_pd(A, B); }


x86 assembly (clang, -O0):
<test_mm_xor_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_xor_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_xor_pd>:
jmp    1030 <_mm_xor_pd@plt>

LLVM IR (-O0):
define i32 @test_mm_xor_pd(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 = call i32 @_mm_xor_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_xor_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_xor_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int get_focal_length(int);
int get_effective_focal_length(int zp) {
  return (75900 * get_focal_length(zp)) / 10000;
}


x86 assembly (clang, -O0):
<get_effective_focal_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_focal_length@plt>
imul   $0x1287c,%eax,%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_effective_focal_length>:
push   %rax
call   1030 <get_focal_length@plt>
imul   $0x1287c,%eax,%eax
cltq
imul   $0x68db8bad,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_effective_focal_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_focal_length(i32 %3)
%5 = mul nsw i32 75900, %4
%6 = sdiv i32 %5, 10000
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_effective_focal_length(i32 %0) {
%2 = tail call i32 @get_focal_length(i32 %0)
%3 = mul nsw i32 %2, 75900
%4 = sdiv i32 %3, 10000
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug_alloc(void *, int, char *);
void *malloc(int);
void *do_alloc(int size, char *s) {
  void *ptr = malloc(size);
  debug_alloc(ptr, size, s);
  return ptr;
}


x86 assembly (clang, -O0):
<do_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <debug_alloc@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_alloc>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <debug_alloc@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @do_alloc(i32 %0, i8* %1) {
%3 = tail call i8* @malloc(i32 %0)
%4 = tail call i32 @debug_alloc(i8* %3, i32 %0, i8* %1)
ret i8* %3
}