xunge/DecIR huggingface dataset:
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int);
int setalphachannel(int);
void basSetAlphaChannel() {
  int ret;
  int v;
  v = popNumber();
  ret = setalphachannel(v);
  pushNumber(ret);
}


x86 assembly (clang, -O0):
<basSetAlphaChannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <setalphachannel@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basSetAlphaChannel>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <setalphachannel@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basSetAlphaChannel() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @popNumber()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @setalphachannel(i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @pushNumber(i32 %6)
ret void
}

LLVM IR (-O2):
define void @basSetAlphaChannel() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @setalphachannel(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Variables and functions */
unsigned int util_log2(unsigned int);
unsigned int CalcUnitWidth_elt(unsigned int bit_cnt) {
  unsigned int bpp = util_log2(bit_cnt);
  unsigned int idx = (bit_cnt > 8) ? (bpp - 3) : 0;
  return (1 << ((8 - idx + 1) / 2));
}


x86 assembly (clang, -O0):
<CalcUnitWidth_elt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <util_log2@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x8,-0x4(%rbp)
jbe    113e <CalcUnitWidth_elt+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <CalcUnitWidth_elt+0x38>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <CalcUnitWidth_elt+0x38>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shr    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcUnitWidth_elt>:
push   %rbx
mov    %edi,%ebx
call   1030 <util_log2@plt>
mov    $0xc,%ecx
sub    %eax,%ecx
shr    %ecx
mov    $0x1,%edx
shl    %cl,%edx
cmp    $0x9,%ebx
mov    $0x10,%eax
cmovae %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CalcUnitWidth_elt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @util_log2(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp ugt i32 %7, 8
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub i32 %10, 3
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %9
%14 = phi i32 [ %11, %9 ], [ 0, %12 ]
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = sub i32 8, %15
%17 = add i32 %16, 1
%18 = udiv i32 %17, 2
%19 = shl i32 1, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @CalcUnitWidth_elt(i32 %0) {
%2 = tail call i32 @util_log2(i32 %0)
%3 = sub i32 12, %2
%4 = icmp ult i32 %0, 9
%5 = lshr i32 %3, 1
%6 = shl nuw i32 1, %5
%7 = select i1 %4, i32 16, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
double wn_machine_tolerance() {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<wn_machine_tolerance>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wn_machine_tolerance>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @wn_machine_tolerance() {
%1 = call i32 @assert(i32 0)
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @wn_machine_tolerance() {
%1 = tail call i32 @assert(i32 0)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ _write(int, char *, int);
void _exit(int status) {
  _write(1, "exit", 4);
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <_write@plt>
jmp    1131 <_exit+0x21>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <_write@plt>
nopw   0x0(%rax,%rax,1)
jmp    1130 <_exit+0x20>

LLVM IR (-O0):
@.str = [5 x i8] c"exit\00"
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
define void @_exit(i32 %0) {
%2 = tail call i32 @_write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[], char *envp[]) {
  printf("\nIN Hello\n");
  char *a;
  a = (char *)0xFFFFF00100000100;
  printf("%s\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movabs $0xfffff00100000100,%rax
f0 ff ff
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"\0AIN Hello\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* inttoptr (i64 -17587891076864 to i8*), i8** %8
%10 = load i8*, i8** %8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"\0AIN Hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* inttoptr (i64 -17587891076864 to i8*))
ret i32 0
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2_cofactor(float *, float *);
__attribute__((always_)) struct mat2 *psmat2_cofactor(struct mat2 *result,
                                                      struct mat2 *m) {
  mat2_cofactor((float *)result, (float *)m);
  return result;
}


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

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

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_cofactor(%struct.mat2* %0, %struct.mat2* %1) {
%3 = alloca %struct.mat2*
%4 = alloca %struct.mat2*
store %struct.mat2* %0, %struct.mat2** %3
store %struct.mat2* %1, %struct.mat2** %4
%5 = load %struct.mat2*, %struct.mat2** %3
%6 = bitcast %struct.mat2* %5 to float*
%7 = load %struct.mat2*, %struct.mat2** %4
%8 = bitcast %struct.mat2* %7 to float*
%9 = call i32 @mat2_cofactor(float* %6, float* %8)
%10 = load %struct.mat2*, %struct.mat2** %3
ret %struct.mat2* %10
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_cofactor(%struct.mat2* returned %0, %struct.mat2* %1) {
%3 = bitcast %struct.mat2* %0 to float*
%4 = bitcast %struct.mat2* %1 to float*
%5 = tail call i32 @mat2_cofactor(float* %3, float* %4)
ret %struct.mat2* %0
}
int isalpha(c)
char c;
{ return isupper(c) || islower(c); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isupper@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1159 <isalpha+0x39>
movsbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
movsbl %dil,%ebx
mov    %ebx,%edi
call   1040 <isupper@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1139 <isalpha+0x19>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @isupper(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 @islower(i32 %10)
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %8, %1
%14 = phi i1 [ true, %1 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 @isupper(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @islower(i32 %3)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t fcastu(float f) { return *(uint32_t *)&f; }


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

x86 assembly (clang, -O2):
<fcastu>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fcastu(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @fcastu(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
int RaiseIntToPower(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", RaiseIntToPower(10, 3));
  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)
mov    $0xa,%edi
mov    $0x3,%esi
call   1040 <RaiseIntToPower@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x3,%esi
call   1040 <RaiseIntToPower@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 @RaiseIntToPower(i32 10, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @RaiseIntToPower(i32 10, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void GetARGBBlend() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void size(int arr[10][10]) { printf("%zu %zu\n", sizeof(arr), sizeof(arr[0])); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"%zu %zu\0A\00"
define void @size([10 x i32]* %0) {
%2 = alloca [10 x i32]*
store [10 x i32]* %0, [10 x i32]** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8, i32 40)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%zu %zu\0A\00"
define void @size([10 x i32]* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8, i32 40)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *mantail_of(char *);
char *my_strdup(char const *);
const char *mandir_of(const char *name) {
  char *p, *q;
  q = my_strdup(name);
  p = mantail_of(q);
  if (p) {
    *p = 0;
    return q;
  }
  free(q);
  return NULL;
}


x86 assembly (clang, -O0):
<mandir_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <mantail_of@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1175 <mandir_of+0x45>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <mandir_of+0x56>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mandir_of>:
push   %rbx
call   1040 <my_strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <mantail_of@plt>
test   %rax,%rax
je     114b <mandir_of+0x1b>
movb   $0x0,(%rax)
jmp    1155 <mandir_of+0x25>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @mandir_of(i8* %0) {
%2 = tail call i8* @my_strdup(i8* %0)
%3 = tail call i8* @mantail_of(i8* %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %3
br label %8
6: ; preds = %1
%7 = tail call i32 @free(i8* %2)
br label %8
8: ; preds = %6, %5
%9 = phi i8* [ %2, %5 ], [ null, %6 ]
ret i8* %9
}
/* Variables and functions */
int eval_position();
int search_quiesce(int alpha, int beta) { return eval_position(); }


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

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

LLVM IR (-O0):
define i32 @search_quiesce(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @eval_position()
ret i32 %5
}

LLVM IR (-O2):
define i32 @search_quiesce(i32 %0, i32 %1) {
%3 = tail call i32 (...) @eval_position()
ret i32 %3
}
void freeaddrinfo(struct addrinfo *res) {}


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

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

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

LLVM IR (-O2):
%struct.addrinfo = type opaque
define void @freeaddrinfo(%struct.addrinfo* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ inb(int);
int /*<<< orphan*/ outb(int, int);
void ReadCmos256Bytes(char *buf) {
  int i;
  for (i = 0; i < 256; i++) {
    outb(i, 0x70);
    buf[i] = (char)inb(0x71);
  }
}


x86 assembly (clang, -O0):
<ReadCmos256Bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    1172 <ReadCmos256Bytes+0x52>
mov    -0xc(%rbp),%edi
mov    $0x70,%esi
call   1030 <outb@plt>
mov    $0x71,%edi
call   1040 <inb@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ReadCmos256Bytes+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadCmos256Bytes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
mov    $0x70,%esi
call   1030 <outb@plt>
mov    $0x71,%edi
call   1040 <inb@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1130 <ReadCmos256Bytes+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ReadCmos256Bytes(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %9, %2 ]
%4 = trunc i64 %3 to i32
%5 = tail call i32 @outb(i32 %4, i32 112)
%6 = tail call i64 @inb(i32 113)
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %7, i8* %8
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 256
br i1 %10, label %11, label %2
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int a, b, r;
  r = scanf("%d %d", &a, &b);
  printf("%d\n", a + b);
  a += r;
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen();
int clear() {
  clearScreen();
  return 1;
}


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

x86 assembly (clang, -O2):
<clear>:
push   %rax
xor    %eax,%eax
call   1030 <clearScreen@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @clear() {
%1 = tail call i32 (...) @clearScreen()
ret i32 1
}
int set_speaker_freq(int freq) {
  int div = 1193182 / freq;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @set_speaker_freq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 1193182, %4
store i32 %5, i32* %3
ret i32 1
}

LLVM IR (-O2):
define i32 @set_speaker_freq(i32 %0) {
ret i32 1
}
void cprop_result1(int *data) { data[0] = 9; }


x86 assembly (clang, -O0):
<cprop_result1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x9,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_result1>:
movl   $0x9,(%rdi)
ret

LLVM IR (-O0):
define void @cprop_result1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 9, i32* %4
ret void
}

LLVM IR (-O2):
define void @cprop_result1(i32* nocapture writeonly %0) {
store i32 9, i32* %0
ret void
}
int GetByteorder() {
  char arr[2];
  short *pnt;
  pnt = (short *)arr;
  *pnt = 1;
  return (arr[1]);
}


x86 assembly (clang, -O0):
<GetByteorder>:
push   %rbp
mov    %rsp,%rbp
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movw   $0x1,(%rax)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GetByteorder() {
%1 = alloca [2 x i8]
%2 = alloca i16*
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = bitcast i8* %3 to i16*
store i16* %4, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @GetByteorder() {
ret i32 0
}
const char *ls_costN_nm8_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm8_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <ls_costN_nm8_name_in+0x27>
jmp    1117 <ls_costN_nm8_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ls_costN_nm8_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm8_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm8_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("Hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t nni_strnlen(const char *s, size_t len) {
  size_t n;
  for (n = 0; (n < len) && (*s); n++) {
    s++;
  }
  return (n);
}


x86 assembly (clang, -O0):
<nni_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1137 <nni_strnlen+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1147 <nni_strnlen+0x47>
jmp    1164 <nni_strnlen+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <nni_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nni_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <nni_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <nni_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <nni_strnlen+0x10>
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @nni_strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %20, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ false, %6 ], [ %14, %10 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %20
20: ; preds = %17
%21 = load i64, i64* %5
%22 = add i64 %21, 1
store i64 %22, i64* %5
br label %6
23: ; preds = %15
%24 = load i64, i64* %5
ret i64 %24
}

LLVM IR (-O2):
define i64 @nni_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %11, %9 ], [ 0, %2 ]
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nuw i64 %5, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %14
}
int ls_costN_nm4_n_in(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ls_costN_nm4_n_in() {
ret i32 1
}
char *hello(void) { return "Hello"; }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ tmpbuf;

/* Variables and functions */
int /*<<< orphan*/ jsonq(char const *, char const *, char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
int jsonq_null(const char *s, const char *name) {
  char tmpbuf[256];
  jsonq(s, name, tmpbuf, sizeof(tmpbuf));
  if (!tmpbuf[0])
    return 1;
  return !strcmp(tmpbuf, "null");
}


x86 assembly (clang, -O0):
<jsonq_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x120(%rbp),%rdx
mov    $0x100,%ecx
call   1030 <jsonq@plt>
cmpb   $0x0,-0x120(%rbp)
jne    1165 <jsonq_null+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1188 <jsonq_null+0x68>
lea    -0x120(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonq_null>:
sub    $0x108,%rsp
mov    %rsp,%rdx
mov    $0x100,%ecx
call   1030 <jsonq@plt>
cmpb   $0x0,(%rsp)
je     1146 <jsonq_null+0x36>
mov    $0x6c6c756e,%ecx
xor    (%rsp),%ecx
movzbl 0x4(%rsp),%edx
xor    %eax,%eax
or     %ecx,%edx
sete   %al
add    $0x108,%rsp
ret
mov    $0x1,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
define i32 @jsonq_null(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [256 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%10 = call i32 @jsonq(i8* %7, i8* %8, i8* %9, i32 256)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %2
store i32 1, i32* %3
br label %21
15: ; preds = %2
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
store i32 %20, i32* %3
br label %21
21: ; preds = %15, %14
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
define i32 @jsonq_null(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @jsonq(i8* %0, i8* %1, i8* %4, i32 256)
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ]
ret i32 %13
}
void kasan_init(void) {}


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

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

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

LLVM IR (-O2):
define void @kasan_init() {
ret void
}
void g_scanner_cur_position() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_cur_position() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *binary) {
  printf("USAGE: %s [-h] [args to sidplay] [sid-tune]\n", binary);
  printf(
      "If no arguments are given sidplayo stops the tune currently playing.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"USAGE: %s [-h] [args to sidplay] [sid-tune]\0A\00"
@.str.1 = [70 x i8] c"If no arguments are given sidplayo stops the tune currently playing.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"USAGE: %s [-h] [args to sidplay] [sid-tune]\0A\00"
@str = [69 x i8] c"If no arguments are given sidplayo stops the tune currently playing.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
ret void
}
int ocfs2_acl_chmod(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @ocfs2_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
double sin(double);
int main(int argc, char *argv[]) {
  printf("sin(0.5)=%g\n", sin(0.5));
  exit(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)
movsd  0xeb2(%rip),%xmm0
call   1040 <sin@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
movsd  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"sin(0.5)=%g\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 double @sin(double 5.000000e-01)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"sin(0.5)=%g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 0x3FDEAEE8744B05F0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
ret i32 0
}
int ext4_subtree_read(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @ext4_subtree_read(%struct.inode* nocapture readnone %0) {
ret i32 0
}
int enclave_read() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_read() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Prt(char *, int, int);
int /*<<< orphan*/ bj__blackjack_commands();
int /*<<< orphan*/ bj__display_bj();
int /*<<< orphan*/ bj__initialize_hand();
int /*<<< orphan*/ bj__opening_screen();
int /*<<< orphan*/ clear_screen();
void bj__game_blackjack() {
  clear_screen();
  bj__display_bj();
  bj__initialize_hand();
  bj__opening_screen();
  Prt(("The dealer awaits your bet."), (1) - 1, (1) - 1);
  bj__blackjack_commands();
}


x86 assembly (clang, -O0):
<bj__game_blackjack>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <clear_screen@plt>
mov    $0x0,%al
call   1030 <bj__display_bj@plt>
mov    $0x0,%al
call   1070 <bj__initialize_hand@plt>
mov    $0x0,%al
call   1050 <bj__opening_screen@plt>
lea    0xe79(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <Prt@plt>
mov    $0x0,%al
call   1060 <bj__blackjack_commands@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bj__game_blackjack>:
push   %rax
xor    %eax,%eax
call   1080 <clear_screen@plt>
xor    %eax,%eax
call   1030 <bj__display_bj@plt>
xor    %eax,%eax
call   1070 <bj__initialize_hand@plt>
xor    %eax,%eax
call   1050 <bj__opening_screen@plt>
lea    0xe7c(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <Prt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <bj__blackjack_commands@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"The dealer awaits your bet.\00"
define void @bj__game_blackjack() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 (...) @bj__display_bj()
%3 = call i32 (...) @bj__initialize_hand()
%4 = call i32 (...) @bj__opening_screen()
%5 = call i32 @Prt(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%6 = call i32 (...) @bj__blackjack_commands()
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"The dealer awaits your bet.\00"
define void @bj__game_blackjack() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 (...) @bj__display_bj()
%3 = tail call i32 (...) @bj__initialize_hand()
%4 = tail call i32 (...) @bj__opening_screen()
%5 = tail call i32 @Prt(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%6 = tail call i32 (...) @bj__blackjack_commands()
ret void
}
void RSTC_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @RSTC_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void foo106(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo106(i32 %0) {
ret void
}
/* Variables and functions */
float powf(float, float);
float xypowf(float x) { return powf(x, x); }


x86 assembly (clang, -O0):
<xypowf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xypowf>:
movaps %xmm0,%xmm1
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @xypowf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @powf(float %3, float %4)
ret float %5
}

LLVM IR (-O2):
define float @xypowf(float %0) {
%2 = tail call float @powf(float %0, float %0)
ret float %2
}
/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
double my_wtime_1() { return ((double)clock()) / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<my_wtime_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_wtime_1>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @my_wtime_1() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @my_wtime_1() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}
void gtk_file_selection_show_fileop_buttons() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_selection_show_fileop_buttons() {
ret void
}
void TestExpectLeFail(void) {
  TestExpect("(2) <= (1)",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/google/makani/refs/heads/master/"
             "avionics/firmware/test/test_test.c",
             __func__, 158, (2) <= (1));
}


x86 assembly (clang, -O0):
<TestExpectLeFail>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xf7f(%rip),%rdx
mov    $0x9e,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1030 <TestExpect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestExpectLeFail>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xf83(%rip),%rdx
mov    $0x9e,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
jmp    1030 <TestExpect@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"(2) <= (1)\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/firmware/test/test_test.c\00"
@__func__.TestExpectLeFail = [17 x i8] c"TestExpectLeFail\00"
define void @TestExpectLeFail() {
%1 = call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @TestExpect to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.TestExpectLeFail, i64 0, i64 0), i32 158, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"(2) <= (1)\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/firmware/test/test_test.c\00"
@__func__.TestExpectLeFail = [17 x i8] c"TestExpectLeFail\00"
define void @TestExpectLeFail() {
%1 = tail call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @TestExpect to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.TestExpectLeFail, i64 0, i64 0), i32 158, i32 0)
ret void
}
int test_imm_45uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x45 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_45uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 69
%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_45uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 4521984
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int condition(int, int);
int main(int ac, char **av) { return condition(42, 21); }


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    $0x2a,%edi
mov    $0x15,%esi
call   1030 <condition@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%edi
mov    $0x15,%esi
jmp    1030 <condition@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 = call i32 @condition(i32 42, i32 21)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @condition(i32 42, i32 21)
ret i32 %3
}
int absmod(int v, int d) {
  if (v < 0) {
    v += d * (((v / d) * (-1)) + 1);
    return (v);
  } else {
    return (v % d);
  }
}


x86 assembly (clang, -O0):
<absmod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1140 <absmod+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   $0xffffffff,%ecx,%ecx
add    $0x1,%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <absmod+0x4a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absmod>:
test   %edi,%edi
js     110c <absmod+0xc>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
imul   %esi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absmod(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = sdiv i32 %0, %1
%6 = sub i32 1, %5
%7 = mul nsw i32 %6, %1
%8 = add nsw i32 %7, %0
br label %11
9: ; preds = %2
%10 = srem i32 %0, %1
br label %11
11: ; preds = %9, %4
%12 = phi i32 [ %8, %4 ], [ %10, %9 ]
ret i32 %12
}