xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _kbdd_clean_groups_info();
int /*<<< orphan*/ _kbdd_perwindow_free();
void kbdd_free(void) {
  _kbdd_perwindow_free();
  _kbdd_clean_groups_info();
}


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

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

LLVM IR (-O0):
define void @kbdd_free() {
%1 = call i32 (...) @_kbdd_perwindow_free()
%2 = call i32 (...) @_kbdd_clean_groups_info()
ret void
}

LLVM IR (-O2):
define void @kbdd_free() {
%1 = tail call i32 (...) @_kbdd_perwindow_free()
%2 = tail call i32 (...) @_kbdd_clean_groups_info()
ret void
}
ctoec(int c) {
  if ((c >= 0x00 && c <= 0x1F) || c == 0x7F)
    c = 0x0100 | (c ^ 0x40);
  return (c);
}


x86 assembly (clang, -O0):
<ctoec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111b <ctoec+0x1b>
cmpl   $0x1f,-0x4(%rbp)
jle    1125 <ctoec+0x25>
cmpl   $0x7f,-0x4(%rbp)
jne    1133 <ctoec+0x33>
mov    -0x4(%rbp),%eax
xor    $0x40,%eax
or     $0x100,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoec>:
mov    %edi,%ecx
or     $0x100,%ecx
xor    $0x40,%ecx
cmp    $0x7f,%edi
mov    %edi,%eax
cmove  %ecx,%eax
cmp    $0x20,%edi
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ctoec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br i1 %10, label %11, label %15
11: ; preds = %8, %5
%12 = load i32, i32* %2
%13 = xor i32 %12, 64
%14 = or i32 256, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ctoec(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = or i32 %0, 256
%6 = xor i32 %5, 64
%7 = select i1 %4, i32 %6, i32 %0
ret i32 %7
}
double specheat(double t) {
  double cpt;
  cpt = 4217.4 - 3.720283 * t + 0.1412855 * t * t - 2.654387e-3 * t * t * t +
        2.093236e-5 * t * t * t * t;
  return cpt;
}


x86 assembly (clang, -O0):
<specheat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xf02(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xefe(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe82(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<specheat>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
movsd  0xef4(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @specheat(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 0xC00DC323BBC6EB0B, double %4, double 4.217400e+03)
%6 = load double, double* %2
%7 = fmul double 0x3FC215A4ACF312B2, %6
%8 = load double, double* %2
%9 = call double @llvm.fmuladd.f64(double %7, double %8, double %5)
%10 = load double, double* %2
%11 = fmul double 0x3F65BEA72B63C22D, %10
%12 = load double, double* %2
%13 = fmul double %11, %12
%14 = load double, double* %2
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double %9)
%17 = load double, double* %2
%18 = fmul double 0x3EF5F2FCD377FC2E, %17
%19 = load double, double* %2
%20 = fmul double %18, %19
%21 = load double, double* %2
%22 = fmul double %20, %21
%23 = load double, double* %2
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double %16)
store double %24, double* %3
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @specheat(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xC00DC323BBC6EB0B, double 4.217400e+03)
%3 = fmul double %0, 0x3FC215A4ACF312B2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %2)
%5 = fmul double %0, 0xBF65BEA72B63C22D
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %4)
%8 = fmul double %0, 0x3EF5F2FCD377FC2E
%9 = fmul double %8, %0
%10 = fmul double %9, %0
%11 = tail call double @llvm.fmuladd.f64(double %10, double %0, double %7)
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *getenv(char const *);
int /*<<< orphan*/ *open_path(char *, char const *, char const *);
FILE *open_env(const char *env, const char *name, const char *subdir) {
  FILE *result = NULL;
  char *p = getenv(env);
  if (NULL != p)
    result = open_path(p, name, subdir);
  return result;
}


x86 assembly (clang, -O0):
<open_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
je     116a <open_env+0x4a>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <open_path@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_env>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1149 <open_env+0x29>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <open_path@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @open_env(i8* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i8* @getenv(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32* @open_path(i8* %4, i8* %1, i8* %2)
br label %8
8: ; preds = %6, %3
%9 = phi i32* [ %7, %6 ], [ null, %3 ]
ret i32* %9
}
void CFGMR3QueryGCPtrU(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryGCPtrU() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ to_binary(int);
int main() {
  int num = 13;
  to_binary(num);
  printf("\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @to_binary(i32 13)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void xTEDSfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<xTEDSfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @xTEDSfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int XRecolorCursor() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @XRecolorCursor() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperUnLock(void) {
  (*((volatile uint32_t *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperUnLock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc360,%eax
movl   $0xa3359554,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperUnLock>:
movl   $0xa3359554,0x400fc360
54 95 35 a3
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperUnLock() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperUnLock() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int is_email_wsp(char c) { return c && (strchr(" \t\r\n", c) != NULL); }


x86 assembly (clang, -O0):
<is_email_wsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     114a <is_email_wsp+0x3a>
lea    0xec9(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
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):
<is_email_wsp>:
test   %dil,%dil
je     1136 <is_email_wsp+0x26>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0D\0A\00"
define i32 @is_email_wsp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = icmp ne i32* %8, null
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0D\0A\00"
define i32 @is_email_wsp(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Ola, mundo!\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Ola, mundo!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Ola, mundo!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo_1_1_1_1_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_2_1_1_2() {
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char const);
int /*<<< orphan*/ tolower(int /*<<< orphan*/);
void copyword(char *dst, const char *src) {
  while (isalpha(*src)) {
    *dst++ = tolower(*src++);
  }
  *dst = '\0';
  return;
}


x86 assembly (clang, -O0):
<copyword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1175 <copyword+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1130 <copyword+0x10>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyword>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsbl (%rsi),%edi
call   1040 <isalpha@plt>
test   %rax,%rax
je     1161 <copyword+0x41>
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl -0x1(%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%r14)
add    $0x1,%r14
movsbl (%rbx),%edi
call   1040 <isalpha@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1140 <copyword+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @copyword(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call i64 @isalpha(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %1, %2 ]
%8 = phi i8* [ %14, %6 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = tail call i32 @tolower(i32 %11)
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %13, i8* %8
%15 = load i8, i8* %9
%16 = tail call i64 @isalpha(i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %6, %2
%19 = phi i8* [ %0, %2 ], [ %14, %6 ]
store i8 0, i8* %19
ret void
}
long __atomic64_cmpxchg_bool(long *ptr, long old, long new) {
  return __sync_bool_compare_and_swap(ptr, old, new);
}


x86 assembly (clang, -O0):
<__atomic64_cmpxchg_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,%rcx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic64_cmpxchg_bool>:
mov    %rsi,%rax
xor    %ecx,%ecx
lock cmpxchg %rdx,(%rdi)
sete   %cl
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @__atomic64_cmpxchg_bool(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 = load i64, i64* %6
%10 = cmpxchg i64* %7, i64 %8, i64 %9 seq_cst seq_cst
%11 = extractvalue { i64, i1 } %10, 1
%12 = zext i1 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @__atomic64_cmpxchg_bool(i64* nocapture %0, i64 %1, i64 %2) {
%4 = cmpxchg i64* %0, i64 %1, i64 %2 seq_cst seq_cst
%5 = extractvalue { i64, i1 } %4, 1
%6 = zext i1 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ ajRefseqinExit();
int /*<<< orphan*/ ajRefseqoutExit();
void ajRefseqExit(void) {
  ajRefseqinExit();
  ajRefseqoutExit();
  return;
}


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

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

LLVM IR (-O0):
define void @ajRefseqExit() {
%1 = call i32 (...) @ajRefseqinExit()
%2 = call i32 (...) @ajRefseqoutExit()
ret void
}

LLVM IR (-O2):
define void @ajRefseqExit() {
%1 = tail call i32 (...) @ajRefseqinExit()
%2 = tail call i32 (...) @ajRefseqoutExit()
ret void
}
int *s() {
  static int i;
  return &i;
}


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):

:
lea    0x2f1d(%rip),%rax
ret

LLVM IR (-O0):
@s.i = internal global i32 0
define i32* @s() {
ret i32* @s.i
}

LLVM IR (-O2):
@s.i = internal global i32 0
define i32* @s() {
ret i32* @s.i
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void func(char **argv) {
  char arr[2];
  strcpy(arr, argv[1]);
  return;
}


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

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    0x8(%rdi),%rsi
lea    0x6(%rsp),%rdi
call   1030 <strcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @func(i8** nocapture %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = load i8*, i8** %4
%6 = call i32 @strcpy(i8* %3, i8* %5)
ret void
}
/* Variables and functions */
double f_to_c(int);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  int freezing = 32;
  int boiling = 212;
  printf("32 in F is %g in C\n", f_to_c(freezing));
  printf("212 in F is %g in C\n", f_to_c(boiling));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1040 <f_to_c@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0xd4,%edi
call   1040 <f_to_c@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"32 in F is %g in C\0A\00"
@.str.1 = [21 x i8] c"212 in F is %g in C\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 32, i32* %2
store i32 212, i32* %3
%4 = load i32, i32* %2
%5 = call double @f_to_c(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load i32, i32* %3
%8 = call double @f_to_c(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"32 in F is %g in C\0A\00"
@.str.1 = [21 x i8] c"212 in F is %g in C\0A\00"
define i32 @main() {
%1 = tail call double @f_to_c(i32 32)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @f_to_c(i32 212)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %3)
ret i32 0
}
__attribute__((no, noclone)) void f7(struct B *p) {
  asm volatile("" : : "g"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<f7>:
mov    %rdi,-0x8(%rsp)
ret

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

LLVM IR (-O2):
%struct.B = type opaque
define void @f7(%struct.B* %0) {
tail call void asm sideeffect "", "imr,~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.B* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_handler(int x) { exit(1); }


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exit_handler(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isXOR(const char *comm) { return strcmp(comm, "xor") == 0; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"xor\00"
define i32 @isXOR(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int polletherdev(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @polletherdev() {
ret i32 0
}
/* Type definitions */
struct uart_port {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msm_write(struct uart_port *, int, int);
void msm_serial_set_mnd_regs_tcxo(struct uart_port *port) {
  msm_write(port, 0x06, 0x0028);
  msm_write(port, 0xF1, 0x002C);
  msm_write(port, 0x0F, 0x0030);
  msm_write(port, 0x1A, 0x0034);
}


x86 assembly (clang, -O0):
<msm_serial_set_mnd_regs_tcxo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x28,%edx
call   1030 <msm_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0xf1,%esi
mov    $0x2c,%edx
call   1030 <msm_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0xf,%esi
mov    $0x30,%edx
call   1030 <msm_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1a,%esi
mov    $0x34,%edx
call   1030 <msm_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msm_serial_set_mnd_regs_tcxo>:
push   %rbx
mov    %rdi,%rbx
mov    $0x6,%esi
mov    $0x28,%edx
call   1030 <msm_write@plt>
mov    %rbx,%rdi
mov    $0xf1,%esi
mov    $0x2c,%edx
call   1030 <msm_write@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
mov    $0x30,%edx
call   1030 <msm_write@plt>
mov    %rbx,%rdi
mov    $0x1a,%esi
mov    $0x34,%edx
pop    %rbx
jmp    1030 <msm_write@plt>

LLVM IR (-O0):
%struct.uart_port = type { i32 }
define void @msm_serial_set_mnd_regs_tcxo(%struct.uart_port* %0) {
%2 = alloca %struct.uart_port*
store %struct.uart_port* %0, %struct.uart_port** %2
%3 = load %struct.uart_port*, %struct.uart_port** %2
%4 = call i32 @msm_write(%struct.uart_port* %3, i32 6, i32 40)
%5 = load %struct.uart_port*, %struct.uart_port** %2
%6 = call i32 @msm_write(%struct.uart_port* %5, i32 241, i32 44)
%7 = load %struct.uart_port*, %struct.uart_port** %2
%8 = call i32 @msm_write(%struct.uart_port* %7, i32 15, i32 48)
%9 = load %struct.uart_port*, %struct.uart_port** %2
%10 = call i32 @msm_write(%struct.uart_port* %9, i32 26, i32 52)
ret void
}

LLVM IR (-O2):
%struct.uart_port = type { i32 }
define void @msm_serial_set_mnd_regs_tcxo(%struct.uart_port* %0) {
%2 = tail call i32 @msm_write(%struct.uart_port* %0, i32 6, i32 40)
%3 = tail call i32 @msm_write(%struct.uart_port* %0, i32 241, i32 44)
%4 = tail call i32 @msm_write(%struct.uart_port* %0, i32 15, i32 48)
%5 = tail call i32 @msm_write(%struct.uart_port* %0, i32 26, i32 52)
ret void
}
void plat_gvideo_close(void) {}


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

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

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

LLVM IR (-O2):
define void @plat_gvideo_close() {
ret void
}
/* Variables and functions */
int abs(int);
int isreach_knight(int dx, int dy) { return abs(dx) == 1 && dy == 2; }


x86 assembly (clang, -O0):
<isreach_knight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
jne    1140 <isreach_knight+0x30>
cmpl   $0x2,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreach_knight>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    $0x1,%ecx
xor    $0x2,%esi
xor    %eax,%eax
or     %ecx,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @isreach_knight(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 = call i32 @abs(i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 2
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ false, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isreach_knight(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp eq i32 %3, 1
%5 = icmp eq i32 %1, 2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ outbufByte(int /*<<< orphan*/);
void outbufBytes(const char *data, int length) {
  for (; length > 0; length--)
    outbufByte(*data++);
}


x86 assembly (clang, -O0):
<outbufBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114e <outbufBytes+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <outbufByte@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <outbufBytes+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbufBytes>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <outbufBytes+0x24>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
add    $0x1,%rbx
call   1030 <outbufByte@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <outbufBytes+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @outbufBytes(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = tail call i32 @outbufByte(i32 %9)
%11 = add nsw i32 %5, -1
%12 = icmp ugt i32 %5, 1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int istoken(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int removetoken(char *buffer) {
  int len;
  if ((len = istoken(buffer)) != 0)
    strcpy(buffer, buffer + len);
  return strlen(buffer);
}


x86 assembly (clang, -O0):
<removetoken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <istoken@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1165 <removetoken+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removetoken>:
push   %rbx
mov    %rdi,%rbx
call   1050 <istoken@plt>
test   %eax,%eax
je     114b <removetoken+0x1b>
movslq %eax,%rsi
add    %rbx,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
define i32 @removetoken(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @istoken(i8* %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = call i32 @strcpy(i8* %8, i8* %12)
br label %14
14: ; preds = %7, %1
%15 = load i8*, i8** %2
%16 = call i32 @strlen(i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @removetoken(i8* %0) {
%2 = tail call i32 @istoken(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @strcpy(i8* %0, i8* %6)
br label %8
8: ; preds = %4, %1
%9 = tail call i32 @strlen(i8* %0)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ PIT2_DriverIRQHandler();
__attribute__((weak)) void PIT2_IRQHandler(void) { PIT2_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @PIT2_IRQHandler() {
%1 = call i32 (...) @PIT2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PIT2_IRQHandler() {
%1 = tail call i32 (...) @PIT2_DriverIRQHandler()
ret void
}
/* Type definitions */
struct v4l_fd {
  int dummy;
};
struct v4l2_format {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ VIDIOC_TRY_FMT;
int v4l_named_ioctl(struct v4l_fd *, char *, int /*<<< orphan*/,
                    struct v4l2_format *);
int v4l_try_fmt(struct v4l_fd *f, struct v4l2_format *fmt) {
  return v4l_named_ioctl(f, "VIDIOC_TRY_FMT", VIDIOC_TRY_FMT, fmt);
}


x86 assembly (clang, -O0):
<v4l_try_fmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <v4l_named_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l_try_fmt>:
mov    %rsi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
lea    0xedd(%rip),%rsi
jmp    1030 <v4l_named_ioctl@plt>

LLVM IR (-O0):
%struct.v4l_fd = type { i32 }
%struct.v4l2_format = type { i32 }
@.str = [15 x i8] c"VIDIOC_TRY_FMT\00"
@VIDIOC_TRY_FMT = global i32 0
define i32 @v4l_try_fmt(%struct.v4l_fd* %0, %struct.v4l2_format* %1) {
%3 = alloca %struct.v4l_fd*
%4 = alloca %struct.v4l2_format*
store %struct.v4l_fd* %0, %struct.v4l_fd** %3
store %struct.v4l2_format* %1, %struct.v4l2_format** %4
%5 = load %struct.v4l_fd*, %struct.v4l_fd** %3
%6 = load i32, i32* @VIDIOC_TRY_FMT
%7 = load %struct.v4l2_format*, %struct.v4l2_format** %4
%8 = call i32 @v4l_named_ioctl(%struct.v4l_fd* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, %struct.v4l2_format* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.v4l_fd = type { i32 }
%struct.v4l2_format = type { i32 }
@.str = [15 x i8] c"VIDIOC_TRY_FMT\00"
@VIDIOC_TRY_FMT = global i32 0
define i32 @v4l_try_fmt(%struct.v4l_fd* %0, %struct.v4l2_format* %1) {
%3 = load i32, i32* @VIDIOC_TRY_FMT
%4 = tail call i32 @v4l_named_ioctl(%struct.v4l_fd* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, %struct.v4l2_format* %1)
ret i32 %4
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int getkiffies();
int pseudo_gettimeofday(struct timeval *tv, struct timezone *tz) {
  int kiffies = getkiffies();
  tv->tv_sec = kiffies / 100;
  tv->tv_usec = (kiffies - (tv->tv_sec * 100)) * 10000;
}


x86 assembly (clang, -O0):
<pseudo_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getkiffies@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
imul   $0x64,(%rcx),%ecx
sub    %ecx,%eax
imul   $0x2710,%eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pseudo_gettimeofday>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getkiffies@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
mov    %ecx,(%rbx)
imul   $0xffffff9c,%ecx,%ecx
add    %ecx,%eax
imul   $0x2710,%eax,%eax
mov    %eax,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i32 @pseudo_gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
%5 = alloca %struct.timezone*
%6 = alloca i32
store %struct.timeval* %0, %struct.timeval** %4
store %struct.timezone* %1, %struct.timezone** %5
%7 = call i32 (...) @getkiffies()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = sdiv i32 %8, 100
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
store i32 %9, i32* %11
%12 = load i32, i32* %6
%13 = load %struct.timeval*, %struct.timeval** %4
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, 100
%17 = sub nsw i32 %12, %16
%18 = mul nsw i32 %17, 10000
%19 = load %struct.timeval*, %struct.timeval** %4
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %19, i32 0, i32 1
store i32 %18, i32* %20
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i32 @pseudo_gettimeofday(%struct.timeval* nocapture writeonly %0, %struct.timezone* nocapture readnone %1) {
%3 = tail call i32 (...) @getkiffies()
%4 = sdiv i32 %3, 100
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %4, i32* %5
%6 = mul nsw i32 %4, -100
%7 = add i32 %6, %3
%8 = mul nsw i32 %7, 10000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %8, i32* %9
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putendl(char const *s) {
  if (!s || !(*s)) {
    ft_putchar('\n');
    return;
  }
  ft_putchar(*s);
  ft_putendl(s + 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <ft_putendl+0x24>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1153 <ft_putendl+0x33>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
jmp    116c <ft_putendl+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <ft_putchar@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putendl+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putendl+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putendl+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putendl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5, %1
%10 = call i32 @ft_putchar(i8 signext 10)
br label %17
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = call i32 @ft_putchar(i8 signext %13)
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
br label %17
17: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %8, %3, %1
%7 = tail call i32 @ft_putchar(i8 signext 10)
ret void
8: ; preds = %3, %8
%9 = phi i8 [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %12, %8 ], [ %0, %3 ]
%11 = tail call i32 @ft_putchar(i8 signext %9)
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ handle_58(int /*<<< orphan*/);
int gen_58(void) {
  handle_58(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<gen_58>:
push   %rax
xor    %edi,%edi
call   1030 <handle_58@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_58() {
%1 = call i32 @handle_58(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_58() {
%1 = tail call i32 @handle_58(i32 0)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int funsigned(uint32_t a) { return 0x1ffffffffL / a == 0; }


x86 assembly (clang, -O0):
<funsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
movabs $0x1ffffffff,%rax
cqto
idiv   %rcx
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funsigned>:
movslq %edi,%rcx
movabs $0x1ffffffff,%rax
xor    %edx,%edx
idiv   %rcx
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @funsigned(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = sdiv i64 8589934591, %4
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @funsigned(i32 %0) {
%2 = sext i32 %0 to i64
%3 = sdiv i64 8589934591, %2
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef long uint32_t;
typedef long uint16_t;

/* Variables and functions */
long get_millisecond_timer();
uint16_t minutes16(void) {
  uint32_t ms = get_millisecond_timer();
  uint16_t m16;
  m16 = (ms / (60000L)) & 0xFFFF;
  return m16;
}


x86 assembly (clang, -O0):
<minutes16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_millisecond_timer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xea60,%ecx
cqto
idiv   %rcx
and    $0xffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minutes16>:
push   %rax
xor    %eax,%eax
call   1030 <get_millisecond_timer@plt>
movabs $0x45e7b272f608770f,%rcx
b2 e7 45
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xe,%edx
add    %eax,%edx
movzwl %dx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @minutes16() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @get_millisecond_timer()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = sdiv i64 %4, 60000
%6 = and i64 %5, 65535
store i64 %6, i64* %2
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
define i64 @minutes16() {
%1 = tail call i64 (...) @get_millisecond_timer()
%2 = sdiv i64 %1, 60000
%3 = and i64 %2, 65535
ret i64 %3
}
double f(double x) { return x * x - 2.0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double -2.000000e+00)
ret double %5
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -2.000000e+00)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_8159() {
  Assert_real((isqrt(8159) == 90),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1445, ("Integer square root of 8159 should be 90"));
}


x86 assembly (clang, -O0):
<t_sqrt_8159>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1fdf,%edi
call   1030 <isqrt@plt>
cmp    $0x5a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5a5,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_8159>:
push   %rax
mov    $0x1fdf,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x5a,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5a5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 8159 should be 90\00"
define void @t_sqrt_8159() {
%1 = call i32 @isqrt(i32 8159)
%2 = icmp eq i32 %1, 90
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1445, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 8159 should be 90\00"
define void @t_sqrt_8159() {
%1 = tail call i32 @isqrt(i32 8159)
%2 = icmp eq i32 %1, 90
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1445, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_INT3_OUTPUT() { set_io_bit(0x45, 3); }


x86 assembly (clang, -O0):
<TOSH_MAKE_INT3_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
mov    $0x3,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_INT3_OUTPUT>:
mov    $0x45,%edi
mov    $0x3,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_INT3_OUTPUT() {
%1 = call i32 @set_io_bit(i32 69, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_INT3_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 69, i32 3)
ret void
}
/* Variables and functions */
unsigned char get_scancode();
unsigned char translate_scancode(unsigned char);
unsigned char get_char(void) {
  unsigned char tmpchar;
  tmpchar = get_scancode();
  tmpchar = translate_scancode(tmpchar);
  return tmpchar;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_scancode@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <translate_scancode@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %rax
xor    %eax,%eax
call   1040 <get_scancode@plt>
movzbl %al,%edi
pop    %rax
jmp    1030 <translate_scancode@plt>

LLVM IR (-O0):
define zeroext i8 @get_char() {
%1 = alloca i8
%2 = call zeroext i8 (...) @get_scancode()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call zeroext i8 @translate_scancode(i8 zeroext %3)
store i8 %4, i8* %1
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @get_char() {
%1 = tail call zeroext i8 (...) @get_scancode()
%2 = tail call zeroext i8 @translate_scancode(i8 zeroext %1)
ret i8 %2
}