xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank2(int);
void m80setParams7EFE(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank2(val << 13);
}


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

x86 assembly (clang, -O2):
<m80setParams7EFE>:
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank2@plt>

LLVM IR (-O0):
define void @m80setParams7EFE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 13
%8 = call i32 @prg8setBank2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m80setParams7EFE(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @prg8setBank2(i32 %3)
ret void
}
double angle_between(double a1, double a2) {
  return (a2 >= a1) ? a1 + 2 * (3.14159265358979323846) - a2 : a1 - a2;
}


x86 assembly (clang, -O0):
<angle_between>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     113a <angle_between+0x3a>
movsd  0xeda(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1149 <angle_between+0x49>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_between>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm0,%xmm3
cmpnlesd %xmm1,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm2,%xmm3
orpd   %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @angle_between(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fcmp oge double %5, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %3
%10 = fadd double %9, 0x401921FB54442D18
%11 = load double, double* %4
%12 = fsub double %10, %11
br label %17
13: ; preds = %2
%14 = load double, double* %3
%15 = load double, double* %4
%16 = fsub double %14, %15
br label %17
17: ; preds = %13, %8
%18 = phi double [ %12, %8 ], [ %16, %13 ]
ret double %18
}

LLVM IR (-O2):
define double @angle_between(double %0, double %1) {
%3 = fcmp ult double %1, %0
%4 = fadd double %0, 0x401921FB54442D18
%5 = select i1 %3, double %0, double %4
%6 = fsub double %5, %1
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ perror(char *);
scalar_t__ setuid(int /*<<< orphan*/);
void drop_rights(void) {
  if (setuid(getuid())) {
    perror("clockdiff: setuid");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<drop_rights>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%edi
call   1060 <setuid@plt>
cmp    $0x0,%rax
je     1172 <drop_rights+0x32>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_rights>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%edi
call   1060 <setuid@plt>
test   %rax,%rax
jne    1156 <drop_rights+0x16>
pop    %rax
ret
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"clockdiff: setuid\00"
define void @drop_rights() {
%1 = call i32 (...) @getuid()
%2 = call i64 @setuid(i32 %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"clockdiff: setuid\00"
define void @drop_rights() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i64 @setuid(i32 %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr2setBank3(int);
void s3setParamsB800(uint16_t addr, uint8_t val) {
  (void)addr;
  chr2setBank3(val << 11);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xb,%edi
jmp    1030 <chr2setBank3@plt>

LLVM IR (-O0):
define void @s3setParamsB800(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 11
%8 = call i32 @chr2setBank3(i32 %7)
ret void
}

LLVM IR (-O2):
define void @s3setParamsB800(i32 %0, i32 %1) {
%3 = shl i32 %1, 11
%4 = tail call i32 @chr2setBank3(i32 %3)
ret void
}
void ExttConfigSpecAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttConfigSpecAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void FancyDisplay_resetColor() { write(1, "\e[0m", strlen("\e[0m")); }


x86 assembly (clang, -O0):
<FancyDisplay_resetColor>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xec2(%rip),%rsi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FancyDisplay_resetColor>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define void @FancyDisplay_resetColor() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @FancyDisplay_resetColor() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dst_directory;

/* Variables and functions */
char *strdup(char *);
int /*<<< orphan*/ td_getcwd(char *, int);
char *get_default_location(void) {
  char dst_directory[4096];
  td_getcwd(dst_directory, sizeof(dst_directory));
  return strdup(dst_directory);
}


x86 assembly (clang, -O0):
<get_default_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1000,%rsp
lea    -0x1000(%rbp),%rdi
mov    $0x1000,%esi
call   1030 <td_getcwd@plt>
lea    -0x1000(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x1000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_default_location>:
push   %rbx
sub    $0x1000,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1030 <td_getcwd@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_default_location() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i32 @td_getcwd(i8* %2, i32 4096)
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%5 = call i8* @strdup(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @get_default_location() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i32 @td_getcwd(i8* %2, i32 4096)
%4 = call i8* @strdup(i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
g() {
  int i = 0;
  while (1) {
    printf("in g (%d)\n", i++);
    usleep(1000000);
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf4240,%edi
call   1040 <usleep@plt>
jmp    112f <g+0xf>

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xed4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0xf4240,%edi
call   1040 <usleep@plt>
mov    %ebp,%esi
jmp    1130 <g+0x10>

LLVM IR (-O0):
@.str = [11 x i8] c"in g (%d)\0A\00"
define i32 @g() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i32 @usleep(i32 1000000)
br label %2
}

LLVM IR (-O2):
@.str = [11 x i8] c"in g (%d)\0A\00"
define i32 @g() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @usleep(i32 1000000)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("In exitTest . . .\n");
  exit(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"In exitTest . . .\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ filenameLength();
int /*<<< orphan*/ pathLength();
main() {
  filenameLength();
  pathLength();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <filenameLength@plt>
mov    $0x0,%al
call   1030 <pathLength@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @filenameLength()
%2 = call i32 (...) @pathLength()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @filenameLength()
%2 = tail call i32 (...) @pathLength()
ret i32 0
}
int KeyCompareInt(void *left, void *right) {
  int res;
  int l, r;
  if (!left || !right) {
    return (0);
  }
  l = *(int *)left;
  r = *(int *)right;
  res = l - r;
  if (res > 1) {
    res = 1;
  } else if (res < -1) {
    res = -1;
  }
  return (res);
}


x86 assembly (clang, -O0):
<KeyCompareInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <KeyCompareInt+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112e <KeyCompareInt+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    117b <KeyCompareInt+0x7b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jle    115f <KeyCompareInt+0x5f>
movl   $0x1,-0x1c(%rbp)
jmp    1175 <KeyCompareInt+0x75>
cmpl   $0xffffffff,-0x1c(%rbp)
jge    1170 <KeyCompareInt+0x70>
movl   $0xffffffff,-0x1c(%rbp)
jmp    1175 <KeyCompareInt+0x75>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<KeyCompareInt>:
xor    %eax,%eax
test   %rdi,%rdi
je     1122 <KeyCompareInt+0x22>
test   %rsi,%rsi
je     1122 <KeyCompareInt+0x22>
mov    (%rdi),%eax
sub    (%rsi),%eax
mov    $0xffffffff,%ecx
cmovns %eax,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @KeyCompareInt(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %11, %2
store i32 0, i32* %3
br label %35
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
store i32 %18, i32* %7
%19 = load i8*, i8** %5
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
store i32 %21, i32* %8
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = icmp sgt i32 %25, 1
br i1 %26, label %27, label %28
27: ; preds = %15
store i32 1, i32* %6
br label %33
28: ; preds = %15
%29 = load i32, i32* %6
%30 = icmp slt i32 %29, -1
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 -1, i32* %6
br label %32
32: ; preds = %31, %28
br label %33
33: ; preds = %32, %27
%34 = load i32, i32* %6
store i32 %34, i32* %3
br label %35
35: ; preds = %33, %14
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @KeyCompareInt(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = bitcast i8* %1 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = icmp sgt i32 %11, -1
%13 = select i1 %12, i32 %11, i32 -1
%14 = icmp slt i32 %13, 1
%15 = select i1 %14, i32 %13, i32 1
br label %16
16: ; preds = %2, %6
%17 = phi i32 [ %15, %6 ], [ 0, %2 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ _cleanse(void *, size_t);
int /*<<< orphan*/ free(void *);
void delete (void *v, size_t n) {
  _cleanse(v, n);
  free(v);
  v = NULL;
}


x86 assembly (clang, -O0):
<delete>:
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   1040 <_cleanse@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_cleanse@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delete(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @_cleanse(i8* %5, i64 %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
store i8* null, i8** %3
ret void
}

LLVM IR (-O2):
define void @delete(i8* %0, i64 %1) {
%3 = tail call i32 @_cleanse(i8* %0, i64 %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct hda_codec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alc88x_simple_mic_automute(struct hda_codec *);
int /*<<< orphan*/ alc_hp_automute(struct hda_codec *);
void alc883_clevo_m720_init_hook(struct hda_codec *codec) {
  alc_hp_automute(codec);
  alc88x_simple_mic_automute(codec);
}


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

x86 assembly (clang, -O2):
<alc883_clevo_m720_init_hook>:
push   %rbx
mov    %rdi,%rbx
call   1030 <alc_hp_automute@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <alc88x_simple_mic_automute@plt>

LLVM IR (-O0):
%struct.hda_codec = type { i32 }
define void @alc883_clevo_m720_init_hook(%struct.hda_codec* %0) {
%2 = alloca %struct.hda_codec*
store %struct.hda_codec* %0, %struct.hda_codec** %2
%3 = load %struct.hda_codec*, %struct.hda_codec** %2
%4 = call i32 @alc_hp_automute(%struct.hda_codec* %3)
%5 = load %struct.hda_codec*, %struct.hda_codec** %2
%6 = call i32 @alc88x_simple_mic_automute(%struct.hda_codec* %5)
ret void
}

LLVM IR (-O2):
%struct.hda_codec = type { i32 }
define void @alc883_clevo_m720_init_hook(%struct.hda_codec* %0) {
%2 = tail call i32 @alc_hp_automute(%struct.hda_codec* %0)
%3 = tail call i32 @alc88x_simple_mic_automute(%struct.hda_codec* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int spng_dec_read_bit(int /*<<< orphan*/ *);
unsigned int spng_dec_read_bitsR(FILE *fp, unsigned int length) {
  unsigned int output = 0;
  unsigned int i;
  for (i = 0; i < length; i++) {
    output = (output << 1) | spng_dec_read_bit(fp);
  }
  return output;
}


x86 assembly (clang, -O0):
<spng_dec_read_bitsR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1163 <spng_dec_read_bitsR+0x53>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <spng_dec_read_bit@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <spng_dec_read_bitsR+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spng_dec_read_bitsR>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1133 <spng_dec_read_bitsR+0x23>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
nop
add    %ebp,%ebp
mov    %r14,%rdi
call   1030 <spng_dec_read_bit@plt>
or     %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <spng_dec_read_bitsR+0x10>
jmp    1135 <spng_dec_read_bitsR+0x25>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @spng_dec_read_bitsR(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %17, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %5
%13 = shl i32 %12, 1
%14 = load i32*, i32** %3
%15 = call i32 @spng_dec_read_bit(i32* %14)
%16 = or i32 %13, %15
store i32 %16, i32* %5
br label %17
17: ; preds = %11
%18 = load i32, i32* %6
%19 = add i32 %18, 1
store i32 %19, i32* %6
br label %7
20: ; preds = %7
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @spng_dec_read_bitsR(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ 0, %2 ]
%7 = shl i32 %6, 1
%8 = tail call i32 @spng_dec_read_bit(i32* %0)
%9 = or i32 %8, %7
%10 = add nuw i32 %5, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void utest(unsigned int x) {
  if (x >> 0 != x)
    link_error();
  if (x << 0 != x)
    link_error();
  if (0 << x != 0)
    link_error();
  if (0 >> x != 0)
    link_error();
}


x86 assembly (clang, -O0):
<utest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x0,%eax
cmp    -0x4(%rbp),%eax
je     1131 <utest+0x21>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
cmp    -0x4(%rbp),%eax
je     1147 <utest+0x37>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
cmp    $0x0,%eax
je     115e <utest+0x4e>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
sar    %cl,%eax
cmp    $0x0,%eax
je     1175 <utest+0x65>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @utest(i32 %0) {
ret void
}
int accelerometer_open_calibration(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @accelerometer_open_calibration(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char a[4] = "hehe";
  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    0xed4(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x65686568,0x4(%rsp)
65
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1701340520, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int cast_char_int(char x) { return (int)x; }


x86 assembly (clang, -O0):
<cast_char_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cast_char_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @cast_char_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
void _infix_operator_minus_i64_i64(signed long long lhs, signed long long rhs,
                                   signed long long *__rval_1) {
  *__rval_1 = lhs - rhs;
}


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

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

LLVM IR (-O0):
define void @_infix_operator_minus_i64_i64(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sub nsw i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_minus_i64_i64(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = sub nsw i64 %0, %1
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int via_apollo_gpo_set(int /*<<< orphan*/, int /*<<< orphan*/);
int via_apollo_gpo0_lower(void) { return via_apollo_gpo_set(0, 0); }


x86 assembly (clang, -O0):
<via_apollo_gpo0_lower>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <via_apollo_gpo_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<via_apollo_gpo0_lower>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <via_apollo_gpo_set@plt>

LLVM IR (-O0):
define i32 @via_apollo_gpo0_lower() {
%1 = call i32 @via_apollo_gpo_set(i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @via_apollo_gpo0_lower() {
%1 = tail call i32 @via_apollo_gpo_set(i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
double unpack_ieee754(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ unpack_uint64_t(unsigned char const **, int /*<<< orphan*/ *,
                                   int);
void unpack_double(const unsigned char **bp, double *dst, int endian) {
  uint64_t ieee754_encoded_val = 0;
  unpack_uint64_t(bp, &ieee754_encoded_val, endian);
  *dst = (unpack_ieee754((ieee754_encoded_val), 64, 11));
}


x86 assembly (clang, -O0):
<unpack_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   1030 <unpack_uint64_t@plt>
mov    -0x18(%rbp),%edi
mov    $0x40,%esi
mov    $0xb,%edx
call   1040 <unpack_ieee754@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_double>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <unpack_uint64_t@plt>
mov    0xc(%rsp),%edi
mov    $0x40,%esi
mov    $0xb,%edx
call   1040 <unpack_ieee754@plt>
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @unpack_double(i8** %0, double* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store double* %1, double** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i8**, i8*** %4
%9 = load i32, i32* %6
%10 = call i32 @unpack_uint64_t(i8** %8, i32* %7, i32 %9)
%11 = load i32, i32* %7
%12 = call double @unpack_ieee754(i32 %11, i32 64, i32 11)
%13 = load double*, double** %5
store double %12, double* %13
ret void
}

LLVM IR (-O2):
define void @unpack_double(i8** %0, double* nocapture writeonly %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @unpack_uint64_t(i8** %0, i32* %4, i32 %2)
%7 = load i32, i32* %4
%8 = call double @unpack_ieee754(i32 %7, i32 64, i32 11)
store double %8, double* %1
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t PowerCtrlResetSourceGet(void) {
  return (
      ((*((volatile unsigned long *)(0x40090000 + 0x00000028))) & 0x0000000E) >>
      1);
}


x86 assembly (clang, -O0):
<PowerCtrlResetSourceGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40090028,%eax
mov    (%rax),%rax
and    $0xe,%rax
shr    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PowerCtrlResetSourceGet>:
mov    0x40090028,%rax
40
shr    %eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i64 @PowerCtrlResetSourceGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074331688 to i64*)
%2 = and i64 %1, 14
%3 = lshr i64 %2, 1
ret i64 %3
}

LLVM IR (-O2):
define i64 @PowerCtrlResetSourceGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074331688 to i64*)
%2 = lshr i64 %1, 1
%3 = and i64 %2, 7
ret i64 %3
}
/* Variables and functions */
char *GetWord(int /*<<< orphan*/);
int /*<<< orphan*/ GetWordTypeFromChar(char);
char *GetWordStartingWith(char first_letter) {
  return GetWord(GetWordTypeFromChar(first_letter));
}


x86 assembly (clang, -O0):
<GetWordStartingWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <GetWordTypeFromChar@plt>
mov    %eax,%edi
call   1030 <GetWord@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @GetWordStartingWith(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @GetWordTypeFromChar(i8 signext %3)
%5 = call i8* @GetWord(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @GetWordStartingWith(i8 signext %0) {
%2 = tail call i32 @GetWordTypeFromChar(i8 signext %0)
%3 = tail call i8* @GetWord(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
sub2() { printf("In sub2\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"In sub2\00"
define i32 @sub2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int Right(int i) { return 2 * i + 1; }


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

x86 assembly (clang, -O2):
<Right>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @Right(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  puts("Humans!");
  while (1) {
    sleep(10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
mov    $0xa,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"Humans!\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 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %7
%8 = call i32 @sleep(i32 10)
br label %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"Humans!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @sleep(i32 10)
br label %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned short length;
};
typedef TYPE_1__ XIMText;

/* Variables and functions */
void set_XIMText_length(void *_p, unsigned short _v) {
  ((XIMText *)_p)->length = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XIMText_length>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XIMText_length>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XIMText_length(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XIMText_length(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
unsigned int exynos_init_dp(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @exynos_init_dp() {
ret i32 0
}
/* Variables and functions */
char getchar();
void readline(char *line) {
  int pos = 0;
  while (-1) {
    char c = getchar();
    if (c == '\n' || c == '\r') {
      break;
    }
    line[pos++] = c;
  }
  line[pos] = '\0';
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
je     1147 <readline+0x37>
movsbl -0xd(%rbp),%eax
cmp    $0xd,%eax
jne    114c <readline+0x3c>
jmp    1169 <readline+0x59>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0xc(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1123 <readline+0x13>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1139 <readline+0x29>
cmp    $0xd,%al
je     1139 <readline+0x29>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
jmp    1120 <readline+0x10>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @readline(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i64 [ %6, %5 ], [ 0, %1 ]
%4 = tail call signext i8 (...) @getchar()
switch i8 %4, label %5 [
i8 13, label %8
i8 10, label %8
]
5: ; preds = %2
%6 = add nuw i64 %3, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %4, i8* %7
br label %2
8: ; preds = %2, %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t _getpid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_getpid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print_long(long x) { printf("%li", x); }


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

x86 assembly (clang, -O2):
<print_long>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%li\00"
define void @print_long(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
char *fib(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) { printf(fib(7)); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i8* @fib(i32 7)
%6 = call i32 @printf(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @fib(i32 7)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(float, float, float);
void Color3f(float r, float g, float b) { glColor3f(r, g, b); }


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

x86 assembly (clang, -O2):
<Color3f>:
jmp    1030 <glColor3f@plt>

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

LLVM IR (-O2):
define void @Color3f(float %0, float %1, float %2) {
%4 = tail call i32 @glColor3f(float %0, float %1, float %2)
ret void
}
long mul9(long a) { return (a << 3) + a; }


x86 assembly (clang, -O0):
<mul9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul9>:
lea    (%rdi,%rdi,8),%rax
ret

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

LLVM IR (-O2):
define i64 @mul9(i64 %0) {
%2 = mul i64 %0, 9
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ interrupt(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void quitCommand(char *args[]) { interrupt(0x21, 0x5, 0, 0, 0); }


x86 assembly (clang, -O0):
<quitCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x21,%edi
mov    $0x5,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <interrupt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitCommand>:
mov    $0x21,%edi
mov    $0x5,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <interrupt@plt>

LLVM IR (-O0):
define void @quitCommand(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @interrupt(i32 33, i32 5, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @quitCommand(i8** nocapture readnone %0) {
%2 = tail call i32 @interrupt(i32 33, i32 5, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void _celt_fatal(const char *str, const char *file, int line) {
  fprintf(stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line,
          str);
  abort();
}


x86 assembly (clang, -O0):
<_celt_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_celt_fatal>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Fatal (internal) error in %s, line %d: %s\0A\00"
define void @_celt_fatal(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Fatal (internal) error in %s, line %d: %s\0A\00"
define void @_celt_fatal(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int wait(int /*<<< orphan*/ *);
int fork_parent(void) {
  if (wait(NULL) == -1) {
    perror("wait");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fork_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
cmp    $0xffffffff,%eax
jne    1152 <fork_parent+0x32>
lea    0xebf(%rip),%rdi
call   1030 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1159 <fork_parent+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_parent>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <wait@plt>
cmp    $0xffffffff,%eax
je     1133 <fork_parent+0x13>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%ebx
jmp    112f <fork_parent+0xf>

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

LLVM IR (-O2):
@.str = [5 x i8] c"wait\00"
define i32 @fork_parent() {
%1 = tail call i32 @wait(i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
double cos(double);
double cospi(double a) { return cos(3.14159265358979323846 * a); }


x86 assembly (clang, -O0):
<cospi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cospi>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @cospi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x400921FB54442D18, %3
%5 = call double @cos(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cospi(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = tail call double @cos(double %2)
ret double %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_tier(uint8_t *p) { p[1] |= 0x40; }


x86 assembly (clang, -O0):
<h265hvcc_set_tier>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
or     $0x40,%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_tier>:
orb    $0x40,0x4(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_tier(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = or i32 %5, 64
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_tier(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = or i32 %3, 64
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int sgsarrcomp_basic(void const *, void const *, void *);
int sgsarrcomp_basic_rev(const void *p1, const void *p2, void *userdata) {
  return sgsarrcomp_basic(p2, p1, userdata);
}


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

x86 assembly (clang, -O2):
<sgsarrcomp_basic_rev>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <sgsarrcomp_basic@plt>

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

LLVM IR (-O2):
define i32 @sgsarrcomp_basic_rev(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @sgsarrcomp_basic(i8* %1, i8* %0, i8* %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
signed int __VERIFIER_nondet_signed_int() {
  srand(time(NULL));
  return (signed int)rand();
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_signed_int>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_nondet_signed_int>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_signed_int() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_signed_int() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}