xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int a[], int arrayLen) {
  int i;
  for (i = 0; i < arrayLen; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(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 (i8*, ...) @printf(i8* dereferenceable(1) 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 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_variable(int);
int /*<<< orphan*/ print_variable_2();
int /*<<< orphan*/ printf(char *);
int f1(int i) {
  printf("Begining of f1\n");
  print_variable_2();
  {
    int i = 100;
    print_variable(i);
  }
  print_variable(i);
  printf("Ending of f1\n\n");
  return ++i;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <print_variable_2@plt>
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <print_variable@plt>
mov    -0x4(%rbp),%edi
call   1030 <print_variable@plt>
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <print_variable_2@plt>
mov    $0x64,%edi
call   1030 <print_variable@plt>
mov    %ebx,%edi
call   1030 <print_variable@plt>
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Begining of f1\0A\00"
@.str.1 = [15 x i8] c"Ending of f1\0A\0A\00"
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @print_variable_2()
store i32 100, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @print_variable(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @print_variable(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@str = [15 x i8] c"Begining of f1\00"
@str.2 = [14 x i8] c"Ending of f1\0A\00"
define i32 @f1(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @print_variable_2()
%4 = tail call i32 @print_variable(i32 100)
%5 = tail call i32 @print_variable(i32 %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
%7 = add nsw i32 %0, 1
ret i32 %7
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned long long);
int uwsgi_long2str2n(unsigned long long num, char *ptr, int size) {
  int ret = snprintf(ptr, size, "%llu", num);
  if (ret <= 0 || ret > size)
    return 0;
  return ret;
}


x86 assembly (clang, -O0):
<uwsgi_long2str2n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    1153 <uwsgi_long2str2n+0x43>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    115f <uwsgi_long2str2n+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1165 <uwsgi_long2str2n+0x55>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_long2str2n>:
push   %rbx
mov    %edx,%ebx
mov    %rdi,%rcx
lea    0xee3(%rip),%rdx
mov    %rsi,%rdi
mov    %ebx,%esi
call   1030 <snprintf@plt>
xor    %edx,%edx
cmp    %ebx,%eax
mov    %eax,%ecx
cmovg  %edx,%ecx
test   %eax,%eax
cmovle %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
define i32 @uwsgi_long2str2n(i64 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i64, i64* %5
%12 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp sle i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %3
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15, %3
store i32 0, i32* %4
br label %22
20: ; preds = %15
%21 = load i32, i32* %8
store i32 %21, i32* %4
br label %22
22: ; preds = %20, %19
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i32 @uwsgi_long2str2n(i64 %0, i8* %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = icmp slt i32 %4, 1
%6 = icmp sgt i32 %4, %2
%7 = or i1 %5, %6
%8 = select i1 %7, i32 0, i32 %4
ret i32 %8
}
numb(str) char *str;
{
  int k;
  for (k = 0; *str >= '0' && *str <= '9'; str++)
    k = k * 10 + *str - '0';
  return (k);
}


x86 assembly (clang, -O0):
<numb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <numb+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <numb+0x44>
jmp    1168 <numb+0x68>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <numb+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numb>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <numb+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <numb+0x20>
ret

LLVM IR (-O0):
define i32 @numb(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %24, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %27
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 10
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %18, %21
%23 = sub nsw i32 %22, 48
store i32 %23, i32* %3
br label %24
24: ; preds = %16
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %2
br label %4
27: ; preds = %14
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @numb(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
int XCheckTypedEvent() {}


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

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

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

LLVM IR (-O2):
define i32 @XCheckTypedEvent() {
ret i32 undef
}
void bch_debug_exit_cache_set(struct cache_set *c) {}


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

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

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

LLVM IR (-O2):
%struct.cache_set = type opaque
define void @bch_debug_exit_cache_set(%struct.cache_set* nocapture %0) {
ret void
}
unsigned xrop3_31_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


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

x86 assembly (clang, -O2):
<xrop3_31_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rax,%rdi,1),%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
or     $0xff,%eax
and    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_31_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = or i32 %5, %9
%11 = xor i32 %10, -1
%12 = or i32 %11, %3
ret i32 %12
}
float BG_GetSpeedMod(int techLevel) {
  float speedMod = 1.0f;
  switch (techLevel) {
  case 1:
    speedMod = 1.0f;
    break;
  case 2:
  case 3:
    speedMod = 0.8f;
    break;
  case 4:
    speedMod = 0.7f;
    break;
  case 5:
  case 6:
    speedMod = 0.6f;
    break;
  case 7:
  case 8:
  case 9:
    speedMod = 0.5f;
    break;
  case 10:
    speedMod = 0.4f;
    break;
  }
  return speedMod;
}


x86 assembly (clang, -O0):
<BG_GetSpeedMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3f800000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     119e <BG_GetSpeedMod+0x9e>
mov    -0x10(%rbp),%rax
lea    0xeea(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    119e <BG_GetSpeedMod+0x9e>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    119e <BG_GetSpeedMod+0x9e>
movss  0xea9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    119e <BG_GetSpeedMod+0x9e>
movss  0xe93(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    119e <BG_GetSpeedMod+0x9e>
movss  0xe7d(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    119e <BG_GetSpeedMod+0x9e>
movss  0xe67(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BG_GetSpeedMod>:
add    $0xfffffffe,%edi
cmp    $0x8,%edi
ja     1118 <BG_GetSpeedMod+0x18>
movslq %edi,%rax
lea    0xef2(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret
movss  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @BG_GetSpeedMod(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
store float 1.000000e+00, float* %3
%4 = load i32, i32* %2
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %6
i32 3, label %6
i32 4, label %7
i32 5, label %8
i32 6, label %8
i32 7, label %9
i32 8, label %9
i32 9, label %9
i32 10, label %10
]
5: ; preds = %1
store float 1.000000e+00, float* %3
br label %11
6: ; preds = %1, %1
store float 0x3FE99999A0000000, float* %3
br label %11
7: ; preds = %1
store float 0x3FE6666660000000, float* %3
br label %11
8: ; preds = %1, %1
store float 0x3FE3333340000000, float* %3
br label %11
9: ; preds = %1, %1, %1
store float 5.000000e-01, float* %3
br label %11
10: ; preds = %1
store float 0x3FD99999A0000000, float* %3
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
@switch.table.BG_GetSpeedMod = [9 x float] [float 0x3FE99999A0000000, float 0x3FE99999A0000000, float 0x3FE6666660000000, float 0x3FE3333340000000, float 0x3FE3333340000000, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 0x3FD99999A0000000]
define float @BG_GetSpeedMod(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 9
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [9 x float], [9 x float]* @switch.table.BG_GetSpeedMod, i64 0, i64 %5
%7 = load float, float* %6
br label %8
8: ; preds = %4, %1
%9 = phi float [ 1.000000e+00, %1 ], [ %7, %4 ]
ret float %9
}
void foo040(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo040(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ read_32u(int /*<<< orphan*/ const *);
int32_t read_32s(const uint8_t *src) { return (int32_t)read_32u(src); }


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

x86 assembly (clang, -O2):
<read_32s>:
jmp    1030 <read_32u@plt>

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

LLVM IR (-O2):
define i32 @read_32s(i32* %0) {
%2 = tail call i32 @read_32u(i32* %0)
ret i32 %2
}
/* Variables and functions */
#define PTHREAD_PROCESS_PRIVATE 129
#define PTHREAD_PROCESS_SHARED 128
const char *mutex_pshared_str(int pshared) {
  switch (pshared) {
  case PTHREAD_PROCESS_SHARED:
    return "PTHREAD_PROCESS_SHARED";
  case PTHREAD_PROCESS_PRIVATE:
    return "PTHREAD_PROCESS_PRIVATE";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<mutex_pshared_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1130 <mutex_pshared_str+0x30>
jmp    111d <mutex_pshared_str+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     1140 <mutex_pshared_str+0x40>
jmp    1150 <mutex_pshared_str+0x50>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <mutex_pshared_str+0x5b>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <mutex_pshared_str+0x5b>
lea    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_pshared_str>:
cmp    $0x81,%edi
lea    0xf0a(%rip),%rax
lea    0xf1b(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x80,%edi
lea    0xedb(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"PTHREAD_PROCESS_SHARED\00"
@.str.1 = [24 x i8] c"PTHREAD_PROCESS_PRIVATE\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @mutex_pshared_str(i32 %0) {
%2 = icmp eq i32 %0, 129
%3 = select i1 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 128
%5 = select i1 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int get_jump_pointer(int /*<<< orphan*/);
int /*<<< orphan*/ get_key_from_line(char *);
int get_pointer_from_line(char *line) {
  return get_jump_pointer(get_key_from_line(line));
}


x86 assembly (clang, -O0):
<get_pointer_from_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_key_from_line@plt>
mov    %eax,%edi
call   1040 <get_jump_pointer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pointer_from_line>:
push   %rax
call   1030 <get_key_from_line@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <get_jump_pointer@plt>

LLVM IR (-O0):
define i32 @get_pointer_from_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_key_from_line(i8* %3)
%5 = call i32 @get_jump_pointer(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_pointer_from_line(i8* %0) {
%2 = tail call i32 @get_key_from_line(i8* %0)
%3 = tail call i32 @get_jump_pointer(i32 %2)
ret i32 %3
}
void stop_two() {}


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

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

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

LLVM IR (-O2):
define void @stop_two() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ showfile(char *);
void subfunc1(void) { showfile("demos\\tui.c"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"demos\\tui.c\00"
define void @subfunc1() {
%1 = call i32 @showfile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"demos\\tui.c\00"
define void @subfunc1() {
%1 = tail call i32 @showfile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __posix_init();
void __libc_init(void) { __posix_init(); }


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

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

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

LLVM IR (-O2):
define void @__libc_init() {
%1 = tail call i32 (...) @__posix_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inefficient_factorial(int const, double **, int);
double *factorials(const int n) {
  double *f = NULL;
  inefficient_factorial(n, &f, 1);
  return f;
}


x86 assembly (clang, -O0):
<factorials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <inefficient_factorial@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorials>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <inefficient_factorial@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define double* @factorials(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
store double* null, double** %3
%4 = load i32, i32* %2
%5 = call i32 @inefficient_factorial(i32 %4, double** %3, i32 1)
%6 = load double*, double** %3
ret double* %6
}

LLVM IR (-O2):
define double* @factorials(i32 %0) {
%2 = alloca double*
%3 = bitcast double** %2 to i8*
store double* null, double** %2
%4 = call i32 @inefficient_factorial(i32 %0, double** %2, i32 1)
%5 = load double*, double** %2
ret double* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ ffs_bug(int /*<<< orphan*/);
scalar_t__ ffs_ref(int /*<<< orphan*/);
int ffs_bug_correct(uint32_t x) { return ffs_bug(x) == ffs_ref(x); }


x86 assembly (clang, -O0):
<ffs_bug_correct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ffs_bug@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ffs_ref@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs_bug_correct>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <ffs_bug@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1040 <ffs_ref@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ffs_bug_correct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ffs_bug(i32 %3)
%5 = load i32, i32* %2
%6 = call i64 @ffs_ref(i32 %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ffs_bug_correct(i32 %0) {
%2 = tail call i64 @ffs_bug(i32 %0)
%3 = tail call i64 @ffs_ref(i32 %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t unscale(unsigned long value, char scale) {
  uint64_t result = value;
  switch (scale) {
  case 'B':
    break;
  case 'k':
    result <<= 10;
    break;
  case 'M':
    result <<= 20;
    break;
  case 'G':
    result <<= 30;
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<unscale>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x42,%eax
je     115c <unscale+0x5c>
jmp    1129 <unscale+0x29>
mov    -0x14(%rbp),%eax
sub    $0x47,%eax
je     117d <unscale+0x7d>
jmp    113a <unscale+0x3a>
mov    -0x14(%rbp),%eax
sub    $0x4d,%eax
je     116f <unscale+0x6f>
jmp    114b <unscale+0x4b>
mov    -0x14(%rbp),%eax
sub    $0x6b,%eax
je     1161 <unscale+0x61>
jmp    1186 <unscale+0x86>
jmp    1186 <unscale+0x86>
mov    -0x10(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x10(%rbp)
jmp    1186 <unscale+0x86>
mov    -0x10(%rbp),%eax
shl    $0x14,%eax
mov    %eax,-0x10(%rbp)
jmp    1186 <unscale+0x86>
mov    -0x10(%rbp),%eax
shl    $0x1e,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unscale>:
mov    %rdi,%rax
cmp    $0x47,%esi
je     1116 <unscale+0x16>
cmp    $0x4d,%esi
je     111a <unscale+0x1a>
cmp    $0x6b,%esi
jne    1119 <unscale+0x19>
shl    $0xa,%eax
ret
shl    $0x1e,%eax
ret
shl    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @unscale(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i32
store i64 %0, i64* %3
store i8 %1, i8* %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
switch i32 %9, label %20 [
i32 66, label %10
i32 107, label %11
i32 77, label %14
i32 71, label %17
]
10: ; preds = %2
br label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = shl i32 %12, 10
store i32 %13, i32* %5
br label %20
14: ; preds = %2
%15 = load i32, i32* %5
%16 = shl i32 %15, 20
store i32 %16, i32* %5
br label %20
17: ; preds = %2
%18 = load i32, i32* %5
%19 = shl i32 %18, 30
store i32 %19, i32* %5
br label %20
20: ; preds = %2, %17, %14, %11, %10
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @unscale(i64 %0, i8 signext %1) {
%3 = trunc i64 %0 to i32
%4 = sext i8 %1 to i32
switch i32 %4, label %11 [
i32 71, label %9
i32 107, label %5
i32 77, label %7
]
5: ; preds = %2
%6 = shl i32 %3, 10
br label %11
7: ; preds = %2
%8 = shl i32 %3, 20
br label %11
9: ; preds = %2
%10 = shl i32 %3, 30
br label %11
11: ; preds = %2, %9, %7, %5
%12 = phi i32 [ %3, %2 ], [ %8, %7 ], [ %6, %5 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
size_t msb_position(uint64_t val) {
  size_t pos = 0;
  while (val) {
    ++pos;
    val >>= 1;
  };
  return pos;
}


x86 assembly (clang, -O0):
<msb_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1133 <msb_position+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110f <msb_position+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msb_position>:
xor    %eax,%eax
test   %edi,%edi
je     111d <msb_position+0x1d>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <msb_position+0x10>
ret

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

LLVM IR (-O2):
define i64 @msb_position(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i64 %4, 1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %10
}
/* Variables and functions */
unsigned int list_get(int /*<<< orphan*/ *, int /*<<< orphan*/,
                      int /*<<< orphan*/ *);
bool test_list_get_null_params(void) {
  bool pass = false;
  unsigned int res = list_get(NULL, 0, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_get_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    %rdx,%rdi
call   1030 <list_get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <test_list_get_null_params+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_get_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <list_get@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_list_get_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_get(i32* null, i32 0, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_list_get_null_params() {
%1 = tail call i32 @list_get(i32* null, i32 0, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_subtract(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *
psvec3i_subtract(struct vec3i *result, struct vec3i *a, struct vec3i *b) {
  vec3i_subtract((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec3i_subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <vec3i_subtract@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3i_subtract>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3i_subtract@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_subtract(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = alloca %struct.vec3i*
%5 = alloca %struct.vec3i*
%6 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %4
store %struct.vec3i* %1, %struct.vec3i** %5
store %struct.vec3i* %2, %struct.vec3i** %6
%7 = load %struct.vec3i*, %struct.vec3i** %4
%8 = bitcast %struct.vec3i* %7 to i32*
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = call i32 @vec3i_subtract(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec3i*, %struct.vec3i** %4
ret %struct.vec3i* %14
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_subtract(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%7 = tail call i32 @vec3i_subtract(i32* %4, i32* %5, i32* %6)
ret %struct.vec3i* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: %s catfile [msgfile|- ...]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s catfile [msgfile|- ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s catfile [msgfile|- ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ malloc(int);
uint8_t *ts_allocate(void) { return (uint8_t *)malloc(188 * sizeof(uint8_t)); }


x86 assembly (clang, -O0):
<ts_allocate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f0,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_allocate>:
mov    $0x2f0,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @ts_allocate() {
%1 = call i64 @malloc(i32 752)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
define i32* @ts_allocate() {
%1 = tail call i64 @malloc(i32 752)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  unsigned x = rand() + 255;
  return x >> 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
add    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
add    $0xff,%eax
shr    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @rand()
%8 = add nsw i32 %7, 255
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = lshr i32 %9, 3
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = add nsw i32 %3, 255
%5 = lshr i32 %4, 3
ret i32 %5
}
void dummy_proc_2(int a0, int a1) { return; }


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

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

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

LLVM IR (-O2):
define void @dummy_proc_2(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test2() {
  int var = 5;
  printf("%d\n", var);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
uint32_t randLIB_get_32bit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @randLIB_get_32bit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @randLIB_get_32bit() {
ret i32 0
}
int HCINT_SRV_test() { return 0; }


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

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

LLVM IR (-O0):
define i32 @HCINT_SRV_test() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HCINT_SRV_test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ write_mem8(int, int);
void Main(void) {
  for (int i = 0xa0000; i <= 0xaffff; i++) {
    write_mem8(i, 15);
  }
  while (1)
    io_hlt();
}


x86 assembly (clang, -O0):
<Main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa0000,-0x4(%rbp)
cmpl   $0xaffff,-0x4(%rbp)
jg     1157 <Main+0x37>
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1040 <write_mem8@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <Main+0xf>
jmp    115c <Main+0x3c>
mov    $0x0,%al
call   1030 <io_hlt@plt>
jmp    115c <Main+0x3c>

x86 assembly (clang, -O2):
<Main>:
push   %rbx
mov    $0xa0000,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0xf,%esi
call   1040 <write_mem8@plt>
add    $0x1,%ebx
cmp    $0xb0000,%ebx
jne    1130 <Main+0x10>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_hlt@plt>
jmp    1150 <Main+0x30>

LLVM IR (-O0):
define void @Main() {
%1 = alloca i32
store i32 655360, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 720895
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @write_mem8(i32 %6, i32 15)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
br label %12
12: ; preds = %11, %12
%13 = call i32 (...) @io_hlt()
br label %12
}

LLVM IR (-O2):
define void @Main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 655360, %0 ], [ %4, %1 ]
%3 = tail call i32 @write_mem8(i32 %2, i32 15)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 720896
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = tail call i32 (...) @io_hlt()
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ wx11it();
void wx11tr() { wx11it(); }


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

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

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

LLVM IR (-O2):
define void @wx11tr() {
%1 = tail call i32 (...) @wx11it()
ret void
}
unsigned long long max_1(unsigned bit_start, unsigned bit_end) {
  return (0x1ULL << ((bit_end) - (bit_start) + 1)) - 1ULL;
}


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

x86 assembly (clang, -O2):
<max_1>:
sub    %edi,%esi
lea    0x1(%rsi),%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
ret

LLVM IR (-O0):
define i64 @max_1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub i32 %5, %6
%8 = add i32 %7, 1
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
%11 = sub i64 %10, 1
ret i64 %11
}

LLVM IR (-O2):
define i64 @max_1(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = zext i32 %4 to i64
%6 = shl nsw i64 -1, %5
%7 = xor i64 %6, -1
ret i64 %7
}
int do_276() { return 276; }


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

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

LLVM IR (-O0):
define i32 @do_276() {
ret i32 276
}

LLVM IR (-O2):
define i32 @do_276() {
ret i32 276
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int can_read_file(const char *file) { return access(file, R_OK) == 0; }


x86 assembly (clang, -O0):
<can_read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_read_file>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@R_OK = global i32 0
define i32 @can_read_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @R_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@R_OK = global i32 0
define i32 @can_read_file(i8* nocapture %0) {
%2 = load i32, i32* @R_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_6Auint8_reg(unsigned char val) {
  return ((val) & (-0x6A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff96,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_6Auint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -106
%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_6Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -106
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ action_from_string_test();
void action_test(void) { action_from_string_test(); }


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

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

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

LLVM IR (-O2):
define void @action_test() {
%1 = tail call i32 (...) @action_from_string_test()
ret void
}
int ed_is_big() {
  long one = 1;
  return !(*((char *)(&one)));
}


x86 assembly (clang, -O0):
<ed_is_big>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ed_is_big() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ed_is_big() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char **);
int suma(char **);
int main() {
  char niz[20];
  scanf("%20s", &niz);
  printf("%d", suma(&niz));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <suma@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%20s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = bitcast [20 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @suma(i8** %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
float sin(float);
float f2l(float x) { return 4 - sin(x); }


x86 assembly (clang, -O0):
<f2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2l>:
push   %rax
call   1030 <sin@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f2l(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sin(float %3)
%5 = fsub float 4.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @f2l(float %0) {
%2 = tail call float @sin(float %0)
%3 = fsub float 4.000000e+00, %2
ret float %3
}