xunge/DecIR huggingface dataset:
/* Variables and functions */
int F(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  printf("%d\n", F(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <F@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @F(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int test_imm_57uint16_reg(unsigned short val) {
  return ((val) & (-0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffa9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_57uint16_reg>:
test   $0xffa9,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_57uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -87
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergeSort(int a[], int low, int high) {
  if (low < high) {
    int m = (high + low) / 2;
    mergeSort(a, low, m);
    mergeSort(a, m + 1, high);
    merge(a, low, m, high);
  }
}


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    -0x10(%rbp),%eax
add    -0xc(%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   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@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   1030 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <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    1040 <merge@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* %6
%13 = load i32, i32* %5
%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 @merge(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 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void Thread_sleep(int millies) { usleep(millies * 1000); }


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

x86 assembly (clang, -O2):
<Thread_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @Thread_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @Thread_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
struct iwl_priv {
  int dummy;
};

/* Variables and functions */
int iwl_is_rfkill_hw(struct iwl_priv *);
int iwl_is_rfkill(struct iwl_priv *priv) { return iwl_is_rfkill_hw(priv); }


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

x86 assembly (clang, -O2):
<iwl_is_rfkill>:
jmp    1030 <iwl_is_rfkill_hw@plt>

LLVM IR (-O0):
%struct.iwl_priv = type { i32 }
define i32 @iwl_is_rfkill(%struct.iwl_priv* %0) {
%2 = alloca %struct.iwl_priv*
store %struct.iwl_priv* %0, %struct.iwl_priv** %2
%3 = load %struct.iwl_priv*, %struct.iwl_priv** %2
%4 = call i32 @iwl_is_rfkill_hw(%struct.iwl_priv* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.iwl_priv = type { i32 }
define i32 @iwl_is_rfkill(%struct.iwl_priv* %0) {
%2 = tail call i32 @iwl_is_rfkill_hw(%struct.iwl_priv* %0)
ret i32 %2
}
int test_imm_DFuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xDF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DFuint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xdf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DFuint64_highword_reg>:
movabs $0xdf00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DFuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 957777707008
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int random();
int *create_vector(int length) {
  int *vec, i;
  vec = (int *)calloc(length, sizeof(int));
  for (i = 0; i < length; i++)
    vec[i] = random() % 100000000;
  return vec;
}


x86 assembly (clang, -O0):
<create_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1177 <create_vector+0x57>
mov    $0x0,%al
call   1040 <random@plt>
mov    $0x5f5e100,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <create_vector+0x23>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_vector>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%r14
test   %ebp,%ebp
jle    1172 <create_vector+0x52>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <random@plt>
cltq
imul   $0x55e63b89,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x39,%rcx
add    %edx,%ecx
imul   $0x5f5e100,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <create_vector+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @create_vector(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call i32 (...) @random()
%10 = srem i32 %9, 100000000
%11 = getelementptr inbounds i32, i32* %3, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret i32* %3
}
void RTLockValidatorRecExclCreateV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecExclCreateV() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
char *strchr(char *, char);
char *strdup(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *date_string(void) {
  time_t now;
  char *date;
  char *newline;
  now = time(NULL);
  date = ctime(&now);
  date = strdup(date);
  newline = strchr(date, '\n');
  if (newline != NULL) {
    *newline = '\0';
  }
  return date;
}


x86 assembly (clang, -O0):
<date_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1192 <date_string+0x52>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_string>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rdi
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     117a <date_string+0x3a>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @date_string() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i8* @strdup(i8* %4)
%6 = call i8* @strchr(i8* dereferenceable(1) %5, i8 signext 10)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %0
store i8 0, i8* %6
br label %9
9: ; preds = %8, %0
ret i8* %5
}
int mus_char_to_lint(const unsigned char *inp) {
  int o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[3];
  outp[1] = inp[2];
  outp[2] = inp[1];
  outp[3] = inp[0];
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_lint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mus_char_to_lint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @mus_char_to_lint(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = load i8, i8* %0
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %7 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %5 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %3 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
int bar() {
  unsigned x = 0;
  int y = 1;
  x += x < y ? 1 : 0;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
  x += x < y ? 1 : 0;
#pragma GCC diagnostic pop
  x += x < y ? 1 : 0;
  return x;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovb  %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovb  %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovb  %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp ult i32 %3, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
%8 = load i32, i32* %1
%9 = add i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = icmp ult i32 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = load i32, i32* %1
%16 = add i32 %15, %14
store i32 %16, i32* %1
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = icmp ult i32 %17, %18
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 1, i32 0
%22 = load i32, i32* %1
%23 = add i32 %22, %21
store i32 %23, i32* %1
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rpi_car_left() {
  printf("### RPi Car Left Turn ###\n");
  ;
  ;
  ;
  ;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"### RPi Car Left Turn ###\0A\00"
define void @rpi_car_left() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"### RPi Car Left Turn ###\00"
define void @rpi_car_left() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
int op_pos(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @op_pos(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "psf_estim Error: %s\n", msg);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"psf_estim Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"psf_estim Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void withoutRegister(void) {
  int i;
  for (i = 0; i < 1e8; i++)
    ;
}


x86 assembly (clang, -O0):
<withoutRegister>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1135 <withoutRegister+0x35>
jmp    1127 <withoutRegister+0x27>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <withoutRegister+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @withoutRegister() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = fcmp olt double %4, 1.000000e+08
br i1 %5, label %6, label %10
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @withoutRegister() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pow(double, double);
double foo() { pow(1.0, 1.0); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <pow@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsd  0xee8(%rip),%xmm0
movaps %xmm0,%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @foo() {
%1 = alloca double
%2 = call i32 @pow(double 1.000000e+00, double 1.000000e+00)
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @foo() {
%1 = tail call i32 @pow(double 1.000000e+00, double 1.000000e+00)
ret double undef
}
void FreeCharMatrix(char **Matrix, int M) {
  int m;
  for (m = 0; m < M; m++)
    free(Matrix[m]);
  free(Matrix);
}


x86 assembly (clang, -O0):
<FreeCharMatrix>:
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    1151 <FreeCharMatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FreeCharMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

LLVM IR (-O2):
@.str = [15 x i8] c"TEST\09: %s ... \00"
define void @testSupportPrintStart(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_puts(char *);
void kmain() {
  int n = 1000;
  while (n--)
    fb_puts("Hello World!");
  fb_puts("Done.");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1144 <kmain+0x34>
lea    0xec6(%rip),%rdi
call   1030 <fb_puts@plt>
jmp    111f <kmain+0xf>
lea    0xec2(%rip),%rdi
call   1030 <fb_puts@plt>
jmp    1150 <kmain+0x40>

x86 assembly (clang, -O2):
<kmain>:
push   %rbp
push   %rbx
push   %rax
mov    $0xfffffc18,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <fb_puts@plt>
inc    %ebp
jne    1120 <kmain+0x10>
lea    0xeda(%rip),%rdi
call   1030 <fb_puts@plt>
nopl   0x0(%rax,%rax,1)
jmp    1140 <kmain+0x30>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
@.str.1 = [6 x i8] c"Done.\00"
define void @kmain() {
%1 = alloca i32
store i32 1000, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @fb_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %2
8: ; preds = %2
%9 = call i32 @fb_puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %10, %8
br label %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
@.str.1 = [6 x i8] c"Done.\00"
define void @kmain() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1000, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, -1
%4 = tail call i32 @fb_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @fb_puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %8, %6
br label %8
}
void print_pcp_statistics(int *tab, int action, struct activity *act[],
                          unsigned int id_seq[]) {}


x86 assembly (clang, -O0):
<print_pcp_statistics>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @print_pcp_statistics(i32* %0, i32 %1, %struct.activity** %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca %struct.activity**
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store %struct.activity** %2, %struct.activity*** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @print_pcp_statistics(i32* nocapture %0, i32 %1, %struct.activity** nocapture %2, i32* nocapture %3) {
ret void
}
void SysTick_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<SysTick_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SysTick_Handler+0x9>
jmp    1109 <SysTick_Handler+0x9>

x86 assembly (clang, -O2):
<SysTick_Handler>:
jmp    1100 <SysTick_Handler>

LLVM IR (-O0):
define void @SysTick_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SysTick_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ pause();
int /*<<< orphan*/ set_not_wait_on_child();
int /*<<< orphan*/ sleep(int);
int main(void) {
  set_not_wait_on_child();
  if (fork() == 0) {
    sleep(1);
  } else {
    while (1) {
      pause();
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <set_not_wait_on_child@plt>
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
jne    116b <main+0x2b>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    117c <main+0x3c>
jmp    1170 <main+0x30>
mov    $0x0,%al
call   1030 <pause@plt>
jmp    1170 <main+0x30>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <set_not_wait_on_child@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1169 <main+0x29>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <pause@plt>
jmp    1160 <main+0x20>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @set_not_wait_on_child()
%2 = call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @sleep(i32 1)
br label %9
6: ; preds = %0
br label %7
7: ; preds = %6, %7
%8 = call i32 (...) @pause()
br label %7
9: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @set_not_wait_on_child()
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @sleep(i32 1)
ret i32 0
6: ; preds = %0, %6
%7 = tail call i32 (...) @pause()
br label %6
}
/* Type definitions */
struct shl_htable {
  int dummy;
};

/* Variables and functions */
size_t shl_htable_hash_str(struct shl_htable *, char const *, size_t *);
int shl_htable_lookup(struct shl_htable *, void const *, size_t, void **);
bool shl_htable_lookup_str(struct shl_htable *htable, const char *str,
                           size_t *hash, char ***out) {
  size_t h;
  h = shl_htable_hash_str(htable, str, hash);
  return shl_htable_lookup(htable, (const void *)&str, h, (void **)out);
}


x86 assembly (clang, -O0):
<shl_htable_lookup_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <shl_htable_hash_str@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <shl_htable_lookup@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_htable_lookup_str>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
mov    %rsi,(%rsp)
call   1030 <shl_htable_hash_str@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <shl_htable_lookup@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.shl_htable = type { i32 }
define i32 @shl_htable_lookup_str(%struct.shl_htable* %0, i8* %1, i64* %2, i8*** %3) {
%5 = alloca %struct.shl_htable*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i8***
%9 = alloca i64
store %struct.shl_htable* %0, %struct.shl_htable** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i8*** %3, i8**** %8
%10 = load %struct.shl_htable*, %struct.shl_htable** %5
%11 = load i8*, i8** %6
%12 = load i64*, i64** %7
%13 = call i64 @shl_htable_hash_str(%struct.shl_htable* %10, i8* %11, i64* %12)
store i64 %13, i64* %9
%14 = load %struct.shl_htable*, %struct.shl_htable** %5
%15 = bitcast i8** %6 to i8*
%16 = load i64, i64* %9
%17 = load i8***, i8**** %8
%18 = bitcast i8*** %17 to i8**
%19 = call i32 @shl_htable_lookup(%struct.shl_htable* %14, i8* %15, i64 %16, i8** %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.shl_htable = type { i32 }
define i32 @shl_htable_lookup_str(%struct.shl_htable* %0, i8* %1, i64* %2, i8*** %3) {
%5 = alloca i8*
store i8* %1, i8** %5
%6 = tail call i64 @shl_htable_hash_str(%struct.shl_htable* %0, i8* %1, i64* %2)
%7 = bitcast i8** %5 to i8*
%8 = bitcast i8*** %3 to i8**
%9 = call i32 @shl_htable_lookup(%struct.shl_htable* %0, i8* %7, i64 %6, i8** %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int init_module(void) {
  printk("Hello World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ common();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello from prog1.c\n");
  common();
  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    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <common@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"hello from prog1.c\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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @common()
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"hello from prog1.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @common()
ret i32 0
}
void nested_loop_narrowing_Good() {
  int i = 0;
  int a[10];
  while (1) {
    while (1) {
      a[i] = 0;
      for (i = 0; i < 5; i++) {
      }
    }
  }
}


x86 assembly (clang, -O0):
<nested_loop_narrowing_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1110 <nested_loop_narrowing_Good+0x10>
movslq -0x4(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1140 <nested_loop_narrowing_Good+0x40>
jmp    1132 <nested_loop_narrowing_Good+0x32>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <nested_loop_narrowing_Good+0x23>
jmp    1110 <nested_loop_narrowing_Good+0x10>

x86 assembly (clang, -O2):
<nested_loop_narrowing_Good>:
jmp    1100 <nested_loop_narrowing_Good>

LLVM IR (-O0):
define void @nested_loop_narrowing_Good() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %0
br label %4
4: ; preds = %3, %15
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %6
store i32 0, i32* %7
store i32 0, i32* %1
br label %8
8: ; preds = %12, %4
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %8
15: ; preds = %8
br label %4
}

LLVM IR (-O2):
define void @nested_loop_narrowing_Good() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int cardpeek_main(int, char **);
int main(int argc, char **argv) { return cardpeek_main(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cardpeek_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <cardpeek_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @cardpeek_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cardpeek_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port20__default__fired();
void HplMsp430InterruptP__Port20__fired(void) {
  HplMsp430InterruptP__Port20__default__fired();
}


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

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

LLVM IR (-O0):
define void @HplMsp430InterruptP__Port20__fired() {
%1 = call i32 (...) @HplMsp430InterruptP__Port20__default__fired()
ret void
}

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port20__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port20__default__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int is_new_proc(char *token_arr[]) { return (!strcmp(token_arr[0], "ID")); }


x86 assembly (clang, -O0):
<is_new_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_new_proc>:
push   %rax
mov    (%rdi),%rdi
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ID\00"
define i32 @is_new_proc(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"ID\00"
define i32 @is_new_proc(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned int startHandleMessages(void *, char *, int, unsigned int *,
                                 unsigned int **, void **, unsigned int *);
unsigned int startAssertEvents(void *handle, char *messages,
                               unsigned int *resultsLength,
                               unsigned int **results, void **rulesBinding,
                               unsigned int *replyCount) {
  return startHandleMessages(handle, messages, 2, resultsLength, results,
                             rulesBinding, replyCount);
}


x86 assembly (clang, -O0):
<startAssertEvents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0x2,%edx
mov    %rax,(%rsp)
call   1030 <startHandleMessages@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startAssertEvents>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %r9,(%rsp)
mov    $0x2,%edx
mov    %rax,%r9
call   1030 <startHandleMessages@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @startAssertEvents(i8* %0, i8* %1, i32* %2, i32** %3, i8** %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32**
%11 = alloca i8**
%12 = alloca i32*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32** %3, i32*** %10
store i8** %4, i8*** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i32*, i32** %9
%16 = load i32**, i32*** %10
%17 = load i8**, i8*** %11
%18 = load i32*, i32** %12
%19 = call i32 @startHandleMessages(i8* %13, i8* %14, i32 2, i32* %15, i32** %16, i8** %17, i32* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @startAssertEvents(i8* %0, i8* %1, i32* %2, i32** %3, i8** %4, i32* %5) {
%7 = tail call i32 @startHandleMessages(i8* %0, i8* %1, i32 2, i32* %2, i32** %3, i8** %4, i32* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ proclist_inherit_base(void *);
void mv_state_inherit(void *state) { proclist_inherit_base(state); }


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

x86 assembly (clang, -O2):
<mv_state_inherit>:
jmp    1030 <proclist_inherit_base@plt>

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

LLVM IR (-O2):
define void @mv_state_inherit(i8* %0) {
%2 = tail call i32 @proclist_inherit_base(i8* %0)
ret void
}
/* Variables and functions */
int rom_present(char *);
int scsiat_available(void) {
  return (rom_present(L"roms/scsi/ncr5380/sumo_scsiat_bios_v6.3.bin"));
}


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

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

LLVM IR (-O0):
@.str = [44 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 115, i32 117, i32 109, i32 111, i32 95, i32 115, i32 99, i32 115, i32 105, i32 97, i32 116, i32 95, i32 98, i32 105, i32 111, i32 115, i32 95, i32 118, i32 54, i32 46, i32 51, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @scsiat_available() {
%1 = call i32 @rom_present(i8* bitcast ([44 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [44 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 115, i32 117, i32 109, i32 111, i32 95, i32 115, i32 99, i32 115, i32 105, i32 97, i32 116, i32 95, i32 98, i32 105, i32 111, i32 115, i32 95, i32 118, i32 54, i32 46, i32 51, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @scsiat_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([44 x i32]* @.str to i8*))
ret i32 %1
}
double iter_secant(int n, double x1, double x0, double f1, double f0) {
  return (x1 - f1 * ((x1 - x0) / (f1 - f0)));
}


x86 assembly (clang, -O0):
<iter_secant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
subsd  -0x28(%rbp),%xmm3
divsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<iter_secant>:
movapd %xmm0,%xmm4
subsd  %xmm1,%xmm4
movapd %xmm2,%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm4
mulsd  %xmm2,%xmm4
subsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @iter_secant(i32 %0, double %1, double %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %7
%12 = load double, double* %9
%13 = load double, double* %7
%14 = load double, double* %8
%15 = fsub double %13, %14
%16 = load double, double* %9
%17 = load double, double* %10
%18 = fsub double %16, %17
%19 = fdiv double %15, %18
%20 = fneg double %12
%21 = call double @llvm.fmuladd.f64(double %20, double %19, double %11)
ret double %21
}

LLVM IR (-O2):
define double @iter_secant(i32 %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %1, %2
%7 = fsub double %3, %4
%8 = fdiv double %6, %7
%9 = fneg double %3
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double %1)
ret double %10
}
void gtk_icon_view_get_orientation() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_orientation() {
ret void
}
/* Variables and functions */
scalar_t__ BIG_ENDIAN;
scalar_t__ get_endian_type();
int /*<<< orphan*/ swap_endian(int *);
void translate(int *endian) {
  if (BIG_ENDIAN == get_endian_type()) {
    swap_endian(endian);
  }
}


x86 assembly (clang, -O0):
<translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_endian_type@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jne    115a <translate+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <swap_endian@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2eb2(%rip),%rax
mov    (%rax),%rbx
xor    %eax,%eax
call   1040 <get_endian_type@plt>
cmp    %rax,%rbx
jne    114c <translate+0x2c>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <swap_endian@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@BIG_ENDIAN = global i64 0
define void @translate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i64, i64* @BIG_ENDIAN
%4 = call i64 (...) @get_endian_type()
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @swap_endian(i32* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@BIG_ENDIAN = global i64 0
define void @translate(i32* %0) {
%2 = load i64, i64* @BIG_ENDIAN
%3 = tail call i64 (...) @get_endian_type()
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @swap_endian(i32* %0)
br label %7
7: ; preds = %5, %1
ret void
}
long double asinl(long double x) {
  long double res = 0.0L;
  asm("fld	%%st\n\t"
      "fmul	%%st(0)\n\t"
      "fld1\n\t"
      "fsubp\n\t"
      "fsqrt\n\t"
      "fpatan"
      : "=t"(res)
      : "0"(x)
      : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<asinl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldz
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fpatan
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinl>:
fldt   0x8(%rsp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fpatan
ret

LLVM IR (-O0):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}