xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void split(const char *str1) {
  while (*str1 != '\0') {
    printf("|%c", *str1++);
  }
  printf("|\n");
}


x86 assembly (clang, -O0):
<split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <split+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111c <split+0xc>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1158 <split+0x38>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <split+0x20>
lea    0xea5(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"|%c\00"
@str = [2 x i8] c"|\00"
define void @split(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int set_action_val_name_any(char *, char *, int, int);
int set_action_val_name_bin(char *saction, char *f_val, int len) {
  return set_action_val_name_any(saction, f_val, len, 1);
}


x86 assembly (clang, -O0):
<set_action_val_name_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <set_action_val_name_any@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_action_val_name_bin>:
mov    $0x1,%ecx
jmp    1030 <set_action_val_name_any@plt>

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

LLVM IR (-O2):
define i32 @set_action_val_name_bin(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @set_action_val_name_any(i8* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strdup(char *);
int main(int argc, char **argv) {
  printf(argv[1]);
  strdup(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strdup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%rdi
call   1040 <strdup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strdup(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
%6 = load i8*, i8** %3
%7 = tail call i32 @strdup(i8* %6)
ret i32 0
}
/* Variables and functions */
size_t _Ht_NextGrowthTrigger(unsigned int log2_size) {
  return (1 << (log2_size + 1));
}


x86 assembly (clang, -O0):
<_Ht_NextGrowthTrigger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Ht_NextGrowthTrigger>:
lea    0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

LLVM IR (-O0):
define i64 @_Ht_NextGrowthTrigger(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @_Ht_NextGrowthTrigger(i32 %0) {
%2 = add i32 %0, 1
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int do_one_test(int);
int do_test(void) {
  int mode, ret = 0;
  for (mode = 0; mode <= 4; mode++)
    ret |= do_one_test(mode);
  return ret;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jg     114c <do_test+0x3c>
mov    -0x4(%rbp),%edi
call   1030 <do_one_test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <do_test+0x16>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1030 <do_one_test@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <do_one_test@plt>
mov    %eax,%ebp
or     %ebx,%ebp
mov    $0x2,%edi
call   1030 <do_one_test@plt>
mov    %eax,%r14d
mov    $0x3,%edi
call   1030 <do_one_test@plt>
mov    %eax,%ebx
or     %r14d,%ebx
or     %ebp,%ebx
mov    $0x4,%edi
call   1030 <do_one_test@plt>
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @do_test() {
%1 = tail call i32 @do_one_test(i32 0)
%2 = tail call i32 @do_one_test(i32 1)
%3 = or i32 %2, %1
%4 = tail call i32 @do_one_test(i32 2)
%5 = or i32 %4, %3
%6 = tail call i32 @do_one_test(i32 3)
%7 = or i32 %6, %5
%8 = tail call i32 @do_one_test(i32 4)
%9 = or i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void print(int a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d\t", a[i]);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print>:
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    1167 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <print+0x16>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@stdout = global i32 0
define void @print(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 @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 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @SystemTick_RestoreConfig() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ round(double const);
void round_w_d(const double *source, int32_t *dest) {
  *dest = (int32_t)round(*source);
}


x86 assembly (clang, -O0):
<round_w_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <round@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_w_d>:
push   %rbx
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
call   1030 <round@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @round_w_d(double* %0, i64* %1) {
%3 = alloca double*
%4 = alloca i64*
store double* %0, double** %3
store i64* %1, i64** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = call i64 @round(double %6)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @round_w_d(double* nocapture %0, i64* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call i64 @round(double %3)
store i64 %4, i64* %1
ret void
}
int addOK(int x, int y) {
  int signx = x >> 31;
  int signy = y >> 31;
  int diffsign = signx ^ signy;
  int signxy = (x + y) >> 31;
  int ret = !!diffsign | !((signx & signy) ^ signxy);
  return ret;
}


x86 assembly (clang, -O0):
<addOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
xor    -0x18(%rbp),%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addOK>:
mov    %esi,%eax
sar    $0x1f,%eax
add    %edi,%esi
sar    $0x1f,%edi
sar    $0x1f,%esi
cmp    %eax,%edi
setne  %cl
and    %eax,%edi
cmp    %esi,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @addOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = ashr i32 %12, 31
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = xor i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
%20 = ashr i32 %19, 31
store i32 %20, i32* %8
%21 = load i32, i32* %7
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = and i32 %26, %27
%29 = load i32, i32* %8
%30 = xor i32 %28, %29
%31 = icmp ne i32 %30, 0
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
%34 = or i32 %25, %33
store i32 %34, i32* %9
%35 = load i32, i32* %9
ret i32 %35
}

LLVM IR (-O2):
define i32 @addOK(i32 %0, i32 %1) {
%3 = ashr i32 %0, 31
%4 = ashr i32 %1, 31
%5 = add nsw i32 %1, %0
%6 = ashr i32 %5, 31
%7 = icmp ne i32 %3, %4
%8 = and i32 %4, %3
%9 = icmp eq i32 %8, %6
%10 = or i1 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
int compareaddresses(void *p0, void *p1) {
  return p0 != p1 ? (p0 < p1 ? -1 : 1) : 0;
}


x86 assembly (clang, -O0):
<compareaddresses>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     113a <compareaddresses+0x3a>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <compareaddresses+0x44>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <compareaddresses+0x44>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareaddresses>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
setae  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareaddresses(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 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = icmp ult i8* %9, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 1
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %8
%16 = phi i32 [ %13, %8 ], [ 0, %14 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @compareaddresses(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
void pi_shutdown_blocking(int delay) {
  sleep(delay);
  system("sudo shutdown -h now");
}


x86 assembly (clang, -O0):
<pi_shutdown_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sleep@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi_shutdown_blocking>:
push   %rax
call   1040 <sleep@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"sudo shutdown -h now\00"
define void @pi_shutdown_blocking(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sleep(i32 %3)
%5 = call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"sudo shutdown -h now\00"
define void @pi_shutdown_blocking(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("something\n");
  exit(0);
  printf("unreachable\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"something\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [10 x i8] c"something\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int STEAM_HintResourceNeed(const char *mapcycle, int forgetEverything) {
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @STEAM_HintResourceNeed(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @STEAM_HintResourceNeed(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int main() {
  char *test = malloc(sizeof(char) * 3);
  test[1] = 9;
  free(test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x9,0x1(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <malloc@plt>
movb   $0x9,0x1(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 3)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 9, i8* %5
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
%2 = getelementptr inbounds i8, i8* %1, i64 1
store i8 9, i8* %2
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
void RTPathAbs(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathAbs() {
ret void
}
/* Variables and functions */
int foo(int *, int);
int *malloc(int);
int main() {
  int *k = malloc(6);
  return foo(k, 8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1040 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
mov    $0x8,%esi
pop    %rax
jmp    1040 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 6)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @foo(i32* %4, i32 8)
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 6)
%2 = tail call i32 @foo(i32* %1, i32 8)
ret i32 %2
}
const char *ls_cost_nm8_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm8_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm8_name_in+0x2b>
jmp    111a <ls_cost_nm8_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm8_name_in+0x3b>
jmp    114b <ls_cost_nm8_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm8_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm8_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm8_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm8_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
char *get_operating_system() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @get_operating_system() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @get_operating_system() {
ret i8* null
}
void foo_2_2_1_2_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_1_1_2_1_1() {
ret void
}
long double test_log1pl(long double x) { return __builtin_log1pl(x); }


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

x86 assembly (clang, -O2):
<test_log1pl>:
jmp    1030 <log1pl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_log1pl(x86_fp80 %0) {
%2 = tail call x86_fp80 @log1pl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double CurrentTimeInSeconds() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<CurrentTimeInSeconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CurrentTimeInSeconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @CurrentTimeInSeconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @CurrentTimeInSeconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
#define SIGCONT 131
#define SIGQUIT 130
#define SIGSTOP 129
#define SIGTERM 128
int kill(int /*<<< orphan*/, int);
int sys_trace_kill(pid_t pid, int sig) {
  switch (sig) {
  case SIGTERM:
  case SIGSTOP:
  case SIGCONT:
  case SIGQUIT:
    return kill(pid, sig);
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sys_trace_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x3,%eax
ja     1145 <sys_trace_kill+0x35>
jmp    1132 <sys_trace_kill+0x22>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0x4(%rbp)
jmp    1151 <sys_trace_kill+0x41>
jmp    114a <sys_trace_kill+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_trace_kill>:
mov    %esi,%eax
and    $0xfffffffc,%eax
cmp    $0x80,%eax
jne    1121 <sys_trace_kill+0x11>
jmp    1030 <kill@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sys_trace_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %11 [
i32 128, label %7
i32 129, label %7
i32 131, label %7
i32 130, label %7
]
7: ; preds = %2, %2, %2, %2
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @kill(i32 %8, i32 %9)
store i32 %10, i32* %3
br label %13
11: ; preds = %2
br label %12
12: ; preds = %11
store i32 0, i32* %3
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @sys_trace_kill(i32 %0, i32 %1) {
%3 = and i32 %1, -4
%4 = icmp eq i32 %3, 128
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @kill(i32 %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
void (*tag1(sig, handler))() int sig;
void (*handler)();
{
  (*handler)(sig);
  return handler;
}


x86 assembly (clang, -O0):
<tag1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   *%rcx
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag1>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   *%rsi
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define void (...)* @tag1(i32 %0, void (...)* returned %1) {
%3 = bitcast void (...)* %1 to void (i32, ...)*
tail call void (i32, ...) %3(i32 %0)
ret void (...)* %1
}
void FanIntClear(unsigned long ulBase, unsigned long ulFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000009C))) = ulFlags;
}


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

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

LLVM IR (-O0):
define void @FanIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 156
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @FanIntClear(i64 %0, i64 %1) {
%3 = add i64 %0, 156
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
typedef int u_int8_t;

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, int *, int);
int tty_getch(void) {
  u_int8_t c;
  int n;
  n = read(STDIN_FILENO, &c, 1);
  if (n > 0)
    return c;
  else
    return -1;
}


x86 assembly (clang, -O0):
<tty_getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1147 <tty_getch+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <tty_getch+0x3e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_getch>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jle    1138 <tty_getch+0x28>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @tty_getch() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i32* %1, i32 1)
%5 = icmp sgt i32 %4, 0
%6 = load i32, i32* %1
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
void PWM_Init(void) {
  (*(volatile unsigned long *)(0xE0014000 + 0x04)) = 0x00000002;
  (*(volatile unsigned long *)(0xE0014000 + 0x0C)) = 0x00;
  (*(volatile unsigned long *)(0xE0014000 + 0x14)) = 1 << 1;
  (*(volatile unsigned long *)(0xE0014000 + 0x18)) = 1179648;
  (*(volatile unsigned long *)(0xE0014000 + 0x44)) = 88470;
  (*(volatile unsigned long *)(0xE0014000 + 0x50)) = 1 << 5;
  (*(volatile unsigned long *)(0xE0014000 + 0x4C)) =
      1 << 9 | 1 << 10 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14;
  (*(volatile unsigned long *)(0xE0014000 + 0x04)) = 0x00000001 | 0x00000008;
}


x86 assembly (clang, -O0):
<PWM_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0014004,%eax
movq   $0x2,(%rax)
mov    $0xe001400c,%eax
movq   $0x0,(%rax)
mov    $0xe0014014,%eax
movq   $0x2,(%rax)
mov    $0xe0014018,%eax
movq   $0x120000,(%rax)
mov    $0xe0014044,%eax
movq   $0x15996,(%rax)
mov    $0xe0014050,%eax
movq   $0x20,(%rax)
mov    $0xe001404c,%eax
movq   $0x7e00,(%rax)
mov    $0xe0014004,%eax
movq   $0x9,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWM_Init>:
mov    $0xe0014004,%eax
movq   $0x2,(%rax)
movq   $0x0,0x8(%rax)
movq   $0x2,0x10(%rax)
movq   $0x120000,0x14(%rax)
movq   $0x15996,0x40(%rax)
movq   $0x20,0x4c(%rax)
movq   $0x7e00,0x48(%rax)
movq   $0x9,(%rax)
ret

LLVM IR (-O0):
define void @PWM_Init() {
store volatile i64 2, i64* inttoptr (i64 3758178308 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758178316 to i64*)
store volatile i64 2, i64* inttoptr (i64 3758178324 to i64*)
store volatile i64 1179648, i64* inttoptr (i64 3758178328 to i64*)
store volatile i64 88470, i64* inttoptr (i64 3758178372 to i64*)
store volatile i64 32, i64* inttoptr (i64 3758178384 to i64*)
store volatile i64 32256, i64* inttoptr (i64 3758178380 to i64*)
store volatile i64 9, i64* inttoptr (i64 3758178308 to i64*)
ret void
}

LLVM IR (-O2):
define void @PWM_Init() {
store volatile i64 2, i64* inttoptr (i64 3758178308 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758178316 to i64*)
store volatile i64 2, i64* inttoptr (i64 3758178324 to i64*)
store volatile i64 1179648, i64* inttoptr (i64 3758178328 to i64*)
store volatile i64 88470, i64* inttoptr (i64 3758178372 to i64*)
store volatile i64 32, i64* inttoptr (i64 3758178384 to i64*)
store volatile i64 32256, i64* inttoptr (i64 3758178380 to i64*)
store volatile i64 9, i64* inttoptr (i64 3758178308 to i64*)
ret void
}
void vrt_msg_subsystem_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @vrt_msg_subsystem_cleanup() {
ret void
}
__attribute__((no)) void sb_verify() {}


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

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

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

LLVM IR (-O2):
define void @sb_verify() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("No libtool needed to compile this program!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"No libtool needed to compile this program!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [43 x i8] c"No libtool needed to compile this program!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int showTestResults();
int /*<<< orphan*/ testPath();
int main() {
  testPath();
  return showTestResults();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testPath()
%2 = tail call i32 (...) @showTestResults()
ret i32 %2
}
/* Variables and functions */
char *create_string(size_t const);
int /*<<< orphan*/ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *,
                            int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *create_string_from(int v) {
  const size_t len = (size_t)snprintf(NULL, 0, "%d", v);
  char *res = create_string(len);
  sprintf(res, "%d", v);
  return res;
}


x86 assembly (clang, -O0):
<create_string_from>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeb5(%rip),%rdx
call   1030 <snprintf@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <create_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe8f(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_string_from>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
lea    0xec3(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1030 <snprintf@plt>
movslq %eax,%rdi
call   1040 <create_string@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @create_string_from(i32 %0) {
%2 = tail call i32 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = sext i32 %2 to i64
%4 = tail call i8* @create_string(i64 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sll_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_sll_pi16(__m64 a, __m64 b) { return _mm_sll_pi16(a, b); }


x86 assembly (clang, -O0):
<test_mm_sll_pi16>:
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_sll_pi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_sll_pi16>:
jmp    1030 <_mm_sll_pi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sll_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sll_pi16(i32 %0, i32 %1)
ret i32 %3
}
int check_str(const unsigned char *str, const unsigned char *map) {
  if (!str)
    return 0;
  for (; *str; str++)
    if (!map[*str])
      return -1;
  return 0;
}


x86 assembly (clang, -O0):
<check_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <check_str+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1173 <check_str+0x73>
jmp    1128 <check_str+0x28>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116c <check_str+0x6c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
cmpb   $0x0,(%rax,%rcx,1)
jne    1156 <check_str+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <check_str+0x73>
jmp    115b <check_str+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <check_str+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_str>:
xor    %eax,%eax
test   %rdi,%rdi
je     1134 <check_str+0x34>
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <check_str+0x34>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
cmpb   $0x0,(%rsi,%rcx,1)
je     1135 <check_str+0x35>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <check_str+0x20>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @check_str(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %18, label %10
7: ; preds = %10
%8 = load i8, i8* %17
%9 = icmp eq i8 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %4, %7
%11 = phi i8 [ %8, %7 ], [ %5, %4 ]
%12 = phi i8* [ %17, %7 ], [ %0, %4 ]
%13 = zext i8 %11 to i64
%14 = getelementptr inbounds i8, i8* %1, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
%17 = getelementptr inbounds i8, i8* %12, i64 1
br i1 %16, label %18, label %7
18: ; preds = %10, %7, %4, %2
%19 = phi i32 [ 0, %2 ], [ 0, %4 ], [ -1, %10 ], [ 0, %7 ]
ret i32 %19
}
/* Variables and functions */
int *malloc(int);
int *init_table(int n) {
  int *table = malloc(sizeof(int) * (n + 1));
  for (int i = 0; i <= n; i++)
    table[i] = -1;
  return table;
}


x86 assembly (clang, -O0):
<init_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1162 <init_table+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <init_table+0x29>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_table>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
js     1150 <init_table+0x30>
mov    %ebx,%eax
lea    0x4(,%rax,4),%rdx
mov    %r14,%rdi
mov    $0xff,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i32* @init_table(i32 %0) {
%2 = shl i32 %0, 2
%3 = add i32 %2, 4
%4 = tail call i32* @malloc(i32 %3)
%5 = icmp slt i32 %0, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = bitcast i32* %4 to i8*
%8 = zext i32 %0 to i64
%9 = shl nuw nsw i64 %8, 2
%10 = add nuw nsw i64 %9, 4
br label %11
11: ; preds = %6, %1
ret i32* %4
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_copy(struct genlist const *);
struct fc_sockaddr_list *
fc_sockaddr_list_copy(const struct fc_sockaddr_list *tthis) {
  return (struct fc_sockaddr_list *)genlist_copy((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_copy>:
jmp    1030 <genlist_copy@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list* @fc_sockaddr_list_copy(%struct.fc_sockaddr_list* %0) {
%2 = alloca %struct.fc_sockaddr_list*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %2
%3 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %2
%4 = bitcast %struct.fc_sockaddr_list* %3 to %struct.genlist*
%5 = call i64 @genlist_copy(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.fc_sockaddr_list*
ret %struct.fc_sockaddr_list* %6
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list* @fc_sockaddr_list_copy(%struct.fc_sockaddr_list* %0) {
%2 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_copy(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.fc_sockaddr_list*
ret %struct.fc_sockaddr_list* %4
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *iconv_append_null(const char *p_string, size_t i_length) {
  char *psz_string = malloc(i_length + 1);
  memcpy(psz_string, p_string, i_length);
  psz_string[i_length] = '\0';
  return psz_string;
}


x86 assembly (clang, -O0):
<iconv_append_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iconv_append_null>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @iconv_append_null(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @iconv_append_null(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}