xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void yyerror(char *s) { printf("%s\n ->> %s", s, s); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s\0A ->> %s\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
double strtod(char const *, char **);
double qh_strtod(const char *s, char **endp) {
  double result;
  result = strtod(s, endp);
  if (s < (*endp) && (*endp)[-1] == ' ')
    (*endp)--;
  return result;
}


x86 assembly (clang, -O0):
<qh_strtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jae    1165 <qh_strtod+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
jne    1165 <qh_strtod+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qh_strtod>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strtod@plt>
mov    (%r14),%rax
cmp    %rbx,%rax
jbe    1134 <qh_strtod+0x24>
cmpb   $0x20,-0x1(%rax)
jne    1134 <qh_strtod+0x24>
add    $0xffffffffffffffff,%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define double @qh_strtod(i8* %0, i8** nocapture %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
%4 = load i8*, i8** %1
%5 = icmp ugt i8* %4, %0
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 -1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %11
10: ; preds = %6
store i8* %7, i8** %1
br label %11
11: ; preds = %10, %6, %2
ret double %3
}
/* Variables and functions */
char *getMapValue(char **, char const *);
char *getConfigValue(char **map, const char *key, const char *dval) {
  if (map == NULL || key == NULL) {
    return (char *)dval;
  }
  char *rval = getMapValue(map, key);
  if (rval == NULL) {
    return (char *)dval;
  }
  return rval;
}


x86 assembly (clang, -O0):
<getConfigValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <getConfigValue+0x2a>
cmpq   $0x0,-0x18(%rbp)
jne    1147 <getConfigValue+0x37>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <getConfigValue+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <getMapValue@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1170 <getConfigValue+0x60>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <getConfigValue+0x68>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getConfigValue>:
push   %rbx
mov    %rdx,%rbx
test   %rdi,%rdi
je     112a <getConfigValue+0x1a>
test   %rsi,%rsi
je     112a <getConfigValue+0x1a>
call   1030 <getMapValue@plt>
test   %rax,%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getConfigValue(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8**, i8*** %5
%10 = icmp eq i8** %9, null
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11, %3
%15 = load i8*, i8** %7
store i8* %15, i8** %4
br label %26
16: ; preds = %11
%17 = load i8**, i8*** %5
%18 = load i8*, i8** %6
%19 = call i8* @getMapValue(i8** %17, i8* %18)
store i8* %19, i8** %8
%20 = load i8*, i8** %8
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = load i8*, i8** %7
store i8* %23, i8** %4
br label %26
24: ; preds = %16
%25 = load i8*, i8** %8
store i8* %25, i8** %4
br label %26
26: ; preds = %24, %22, %14
%27 = load i8*, i8** %4
ret i8* %27
}

LLVM IR (-O2):
define i8* @getConfigValue(i8** %0, i8* %1, i8* readnone %2) {
%4 = icmp eq i8** %0, null
%5 = icmp eq i8* %1, null
%6 = or i1 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i8* @getMapValue(i8** %0, i8* %1)
%9 = icmp eq i8* %8, null
%10 = select i1 %9, i8* %2, i8* %8
br label %11
11: ; preds = %3, %7
%12 = phi i8* [ %10, %7 ], [ %2, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("ABCD\n");
  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    0xed3(%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 = [6 x i8] c"ABCD\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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"ABCD\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ startGame();
int main(int argc, char *argv[]) {
  startGame();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @startGame()
ret i32 0
}
/* Variables and functions */
unsigned long long __udivdi3(unsigned long long, unsigned long long);
unsigned long long __umoddi3(unsigned long long num, unsigned long long den) {
  unsigned long long res = num - __udivdi3(num, den) * den;
  return res;
}


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

x86 assembly (clang, -O2):
<__umoddi3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__udivdi3@plt>
imul   %r14,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = call i64 @__udivdi3(i64 %7, i64 %8)
%10 = load i64, i64* %4
%11 = mul i64 %9, %10
%12 = sub i64 %6, %11
store i64 %12, i64* %5
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = tail call i64 @__udivdi3(i64 %0, i64 %1)
%4 = mul i64 %3, %1
%5 = sub i64 %0, %4
ret i64 %5
}
void reboot() {
  print("!\r\nPress any key to reboot...", 7);
  asm("wait0: \n"
      "inb $0x64, %al \n"
      "test $0x01, %al \n"
      "jz wait0 \n"
      "inb $0x60, %al \n"
      "wait1: \n"
      "inb $0x64, %al \n"
      "test $0x02, %al \n"
      "jne wait1 \n"
      "mov $0xD1, %al \n"
      "outb  %al, $0x64 \n"
      "wait2: \n"
      "inb $0x64, %al \n"
      "test $0x02, %al \n"
      "jne  wait2 \n"
      "mov $0xFE, %al \n"
      "outb %al, $0x60 \n");
}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1030 <print@plt>

x86 assembly (clang, -O2):
<reboot>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <print@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"!\0D\0APress any key to reboot...\00"
define void @reboot() {
%1 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"!\0D\0APress any key to reboot...\00"
define void @reboot() {
%1 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 7)
tail call void asm sideeffect "wait0: \0Ainb $$0x64, %al \0Atest $$0x01, %al \0Ajz wait0 \0Ainb $$0x60, %al \0Await1: \0Ainb $$0x64, %al \0Atest $$0x02, %al \0Ajne wait1 \0Amov $$0xD1, %al \0Aoutb %al, $$0x64 \0Await2: \0Ainb $$0x64, %al \0Atest $$0x02, %al \0Ajne wait2 \0Amov $$0xFE, %al \0Aoutb %al, $$0x60 \0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int StrLength(char *str) {
  char *pointer = NULL;
  pointer = str;
  int i = 0;
  int count = 0;
  while (*(pointer + i) != '\0') {
    count++;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<StrLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1152 <StrLength+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <StrLength+0x26>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrLength>:
cmpb   $0x0,(%rdi)
je     111c <StrLength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <StrLength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @StrLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
double m_sqr_double(double val) { return val * val; }


x86 assembly (clang, -O0):
<m_sqr_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_sqr_double>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @m_sqr_double(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
typedef int u_int32_t;
typedef int u_char;

/* Variables and functions */
void put_u32(void *vp, u_int32_t v) {
  u_char *p = (u_char *)vp;
  p[0] = (u_char)(v >> 24) & 0xff;
  p[1] = (u_char)(v >> 16) & 0xff;
  p[2] = (u_char)(v >> 8) & 0xff;
  p[3] = (u_char)v & 0xff;
}


x86 assembly (clang, -O0):
<put_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_u32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @put_u32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = lshr i32 %1, 24
store i32 %4, i32* %3
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = and i32 %1, 255
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand_uni(double a) { return a * (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<rand_uni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2ea5(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uni>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  (%rsp),%xmm0
mov    0x2eb7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_uni(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = fmul double %3, %5
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_uni(double %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = fmul double %3, %0
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
ret double %7
}
/* Type definitions */
typedef int __feh;

/* Variables and functions */
int read(int, int *, int);
int leread32(int fd, int *c) {
  int r;
  r = read(fd, c, 4);
  do {
    int __feh = *c;
    if (1)
      *c = *c;
    else
      *c = ((((__feh)&0xff000000) >> 24) | (((__feh)&0x00ff0000) >> 8) |
            (((__feh)&0x0000ff00) << 8) | (((__feh)&0x000000ff) << 24));
  } while (0);
  return r;
}


x86 assembly (clang, -O0):
<leread32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leread32>:
mov    $0x4,%edx
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @leread32(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
%7 = load i32, i32* %3
%8 = load i32*, i32** %4
%9 = call i32 @read(i32 %7, i32* %8, i32 4)
store i32 %9, i32* %5
br label %10
10: ; preds = %2
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @leread32(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i32* %1, i32 4)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ FE_READ_SNR;
scalar_t__ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int FEReadSNR(int fd, int32_t *snr) {
  int ans;
  if ((ans = ioctl(fd, FE_READ_SNR, snr) < 0)) {
    perror("FE READ_SNR: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<FEReadSNR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1163 <FEReadSNR+0x43>
jmp    117b <FEReadSNR+0x5b>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <FEReadSNR+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FEReadSNR>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113e <FEReadSNR+0x1e>
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_READ_SNR = global i32 0
@.str = [14 x i8] c"FE READ_SNR: \00"
define i32 @FEReadSNR(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @FE_READ_SNR
%9 = load i32*, i32** %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32* %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@FE_READ_SNR = global i32 0
@.str = [14 x i8] c"FE READ_SNR: \00"
define i32 @FEReadSNR(i32 %0, i32* %1) {
%3 = load i32, i32* @FE_READ_SNR
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
int math_even(int n) { return n % 2 == 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<math_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @math_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ OPM_Write(char);
int /*<<< orphan*/ OPM_WriteLn();
void OPC_EndStat(void) {
  OPM_Write(';');
  OPM_WriteLn();
}


x86 assembly (clang, -O0):
<OPC_EndStat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
call   1030 <OPM_Write@plt>
mov    $0x0,%al
call   1040 <OPM_WriteLn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPC_EndStat>:
push   %rax
mov    $0x3b,%edi
call   1030 <OPM_Write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <OPM_WriteLn@plt>

LLVM IR (-O0):
define void @OPC_EndStat() {
%1 = call i32 @OPM_Write(i8 signext 59)
%2 = call i32 (...) @OPM_WriteLn()
ret void
}

LLVM IR (-O2):
define void @OPC_EndStat() {
%1 = tail call i32 @OPM_Write(i8 signext 59)
%2 = tail call i32 (...) @OPM_WriteLn()
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 3662329353U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    114c <RandomFunc+0x4c>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
add    -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
sub    $0xda4ab609,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x251b553c,%eax
add    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %15, %2
%13 = load i32, i32* %6
%14 = icmp ult i32 %13, 0
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %6
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = add i32 %23, %19
store i32 %24, i32* %22
%25 = load i32, i32* %6
%26 = zext i32 %25 to i64
%27 = add i64 %26, 2
%28 = trunc i64 %27 to i32
store i32 %28, i32* %6
br label %12
29: ; preds = %12
%30 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%31 = load i32, i32* %30
%32 = sub i32 %31, -632637943
%33 = load i32*, i32** %4
%34 = getelementptr inbounds i32, i32* %33, i64 0
store i32 %32, i32* %34
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 622548284
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
long rcu_batches_completed_sched();
long rcu_batches_completed(void) { return rcu_batches_completed_sched(); }


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

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

LLVM IR (-O0):
define i64 @rcu_batches_completed() {
%1 = call i64 (...) @rcu_batches_completed_sched()
ret i64 %1
}

LLVM IR (-O2):
define i64 @rcu_batches_completed() {
%1 = tail call i64 (...) @rcu_batches_completed_sched()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ block128_f;
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
scalar_t__ AES_encrypt;
int /*<<< orphan*/ CRYPTO_cfb128_encrypt(unsigned char const *, unsigned char *,
                                         size_t, int /*<<< orphan*/ const *,
                                         unsigned char *, int *, int const,
                                         int /*<<< orphan*/);
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
                        size_t length, const AES_KEY *key, unsigned char *ivec,
                        int *num, const int enc) {
  CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc,
                        (block128_f)AES_encrypt);
}


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

x86 assembly (clang, -O2):
<AES_cfb128_encrypt>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
push   %rax
push   %r10
call   1030 <CRYPTO_cfb128_encrypt@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@AES_encrypt = global i64 0
define void @AES_cfb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32* %3, i32** %11
store i8* %4, i8** %12
store i32* %5, i32** %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load i32*, i32** %11
%19 = load i8*, i8** %12
%20 = load i32*, i32** %13
%21 = load i32, i32* %14
%22 = load i64, i64* @AES_encrypt
%23 = trunc i64 %22 to i32
%24 = call i32 @CRYPTO_cfb128_encrypt(i8* %15, i8* %16, i64 %17, i32* %18, i8* %19, i32* %20, i32 %21, i32 %23)
ret void
}

LLVM IR (-O2):
@AES_encrypt = global i64 0
define void @AES_cfb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6) {
%8 = load i64, i64* @AES_encrypt
%9 = trunc i64 %8 to i32
%10 = tail call i32 @CRYPTO_cfb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world!\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int h_exit_signal(void) {
  kill(getpid(), SIGKILL);
  assert(0);
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<h_exit_signal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_exit_signal>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2e99(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <kill@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGKILL = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @h_exit_signal() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGKILL
%3 = call i32 @kill(i32 %1, i32 %2)
%4 = call i32 @assert(i32 0)
%5 = load i32, i32* @EXIT_FAILURE
ret i32 %5
}

LLVM IR (-O2):
@SIGKILL = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @h_exit_signal() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGKILL
%3 = tail call i32 @kill(i32 %1, i32 %2)
%4 = tail call i32 @assert(i32 0)
%5 = load i32, i32* @EXIT_FAILURE
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ w5100_writeSn_byte(unsigned int, int, unsigned int);
void w5100_writeSnRX_WR(unsigned sock, unsigned data) {
  w5100_writeSn_byte(sock, 0x002A, data >> 8);
  w5100_writeSn_byte(sock, 0x002A + 1, data & 0xFF);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
shr    $0x8,%edx
mov    $0x2a,%esi
call   1030 <w5100_writeSn_byte@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    $0x2b,%esi
call   1030 <w5100_writeSn_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edx
shr    $0x8,%edx
mov    $0x2a,%esi
call   1030 <w5100_writeSn_byte@plt>
movzbl %bl,%edx
mov    %ebp,%edi
mov    $0x2b,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <w5100_writeSn_byte@plt>

LLVM IR (-O0):
define void @w5100_writeSnRX_WR(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 = lshr i32 %6, 8
%8 = call i32 @w5100_writeSn_byte(i32 %5, i32 42, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = call i32 @w5100_writeSn_byte(i32 %9, i32 43, i32 %11)
ret void
}

LLVM IR (-O2):
define void @w5100_writeSnRX_WR(i32 %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 42, i32 %3)
%5 = and i32 %1, 255
%6 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 43, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ XCB_ATOM_STRING;
int /*<<< orphan*/ XCB_ATOM_WM_CLASS;
int /*<<< orphan*/ xcb_get_property_unchecked(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/,
                                              int /*<<< orphan*/,
                                              int /*<<< orphan*/,
                                              int /*<<< orphan*/, long, long);
xcb_get_property_cookie_t
xcb_icccm_get_wm_class_unchecked(xcb_connection_t *c, xcb_window_t window) {
  return xcb_get_property_unchecked(c, 0, window, XCB_ATOM_WM_CLASS,
                                    XCB_ATOM_STRING, 0L, 2048L);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_class_unchecked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    (%rax),%r8d
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r9d
movq   $0x800,(%rsp)
call   1030 <xcb_get_property_unchecked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_class_unchecked>:
push   %rax
mov    %esi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecd(%rip),%rax
mov    (%rax),%r8d
movq   $0x800,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property_unchecked@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_WM_CLASS = global i32 0
@XCB_ATOM_STRING = global i32 0
define i32 @xcb_icccm_get_wm_class_unchecked(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 = load i32, i32* @XCB_ATOM_WM_CLASS
%8 = load i32, i32* @XCB_ATOM_STRING
%9 = call i32 @xcb_get_property_unchecked(i32* %5, i32 0, i32 %6, i32 %7, i32 %8, i64 0, i64 2048)
ret i32 %9
}

LLVM IR (-O2):
@XCB_ATOM_WM_CLASS = global i32 0
@XCB_ATOM_STRING = global i32 0
define i32 @xcb_icccm_get_wm_class_unchecked(i32* %0, i32 %1) {
%3 = load i32, i32* @XCB_ATOM_WM_CLASS
%4 = load i32, i32* @XCB_ATOM_STRING
%5 = tail call i32 @xcb_get_property_unchecked(i32* %0, i32 0, i32 %1, i32 %3, i32 %4, i64 0, i64 2048)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutIdleFunc(void *);
void glutIdleFunc(void *fn) { fn_glutIdleFunc(fn); }


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

x86 assembly (clang, -O2):
<glutIdleFunc>:
jmp    1030 <fn_glutIdleFunc@plt>

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

LLVM IR (-O2):
define void @glutIdleFunc(i8* %0) {
%2 = tail call i32 @fn_glutIdleFunc(i8* %0)
ret void
}
/* Variables and functions */
int random32_value();
unsigned int random32_bit(unsigned int totalBit) {
  unsigned int value;
  unsigned int i;
  value = 0;
  for (i = 0; i < totalBit; i++) {
    value <<= 1;
    value |= (random32_value() & 1);
  }
  return value;
}


x86 assembly (clang, -O0):
<random32_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    115c <random32_bit+0x4c>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random32_value@plt>
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <random32_bit+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random32_bit>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1134 <random32_bit+0x24>
mov    %edi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random32_value@plt>
and    $0x1,%eax
lea    (%rax,%rbx,2),%ebx
add    $0xffffffff,%ebp
jne    1120 <random32_bit+0x10>
jmp    1136 <random32_bit+0x26>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @random32_bit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = shl i32 %5, 1
%7 = tail call i32 (...) @random32_value()
%8 = and i32 %7, 1
%9 = or i32 %8, %6
%10 = add nuw i32 %4, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
struct nlmsg {
  int dummy;
};

/* Variables and functions */
int nla_put(struct nlmsg *, int, int *, int);
extern int nla_put_u32(struct nlmsg *nlmsg, int attr, int value) {
  return nla_put(nlmsg, attr, &value, sizeof(value));
}


x86 assembly (clang, -O0):
<nla_put_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <nla_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_u32>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <nla_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u32(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca %struct.nlmsg*
%5 = alloca i32
%6 = alloca i32
store %struct.nlmsg* %0, %struct.nlmsg** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.nlmsg*, %struct.nlmsg** %4
%8 = load i32, i32* %5
%9 = call i32 @nla_put(%struct.nlmsg* %7, i32 %8, i32* %6, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u32(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i32* %4, i32 4)
ret i32 %5
}
void _kill(int pid, int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @_kill(i32 %0, i32 %1) {
ret void
}
long long int gcd(long long int a, long long int b) {
  if ((a % b) != 0)
    return gcd(b, a % b);
  else
    return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
je     1153 <gcd+0x43>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
jmp    115b <gcd+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rdx
mov    %rdi,%rax
jmp    111d <gcd+0x1d>
nopl   0x0(%rax,%rax,1)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %0, %2 ], [ %5, %3 ]
%5 = phi i64 [ %1, %2 ], [ %6, %3 ]
%6 = srem i64 %4, %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64 %5
}
/* Variables and functions */
void *lib_malloc(int);
void *malloc(int bytes) { return lib_malloc(bytes); }


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <lib_malloc@plt>

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

LLVM IR (-O2):
define i8* @malloc(i32 %0) {
%2 = tail call i8* @lib_malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Com_SetRecommended();
void CL_SetRecommended_f(void) { Com_SetRecommended(); }


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

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

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

LLVM IR (-O2):
define void @CL_SetRecommended_f() {
%1 = tail call i32 (...) @Com_SetRecommended()
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_slide(float *, float *, float *);
__attribute__((always_)) struct vec3 *
psvec3_slide(struct vec3 *result, struct vec3 *a, struct vec3 *b) {
  vec3_slide((float *)result, (float *)a, (float *)b);
  return result;
}


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

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

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

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_slide(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = bitcast %struct.vec3* %0 to float*
%5 = bitcast %struct.vec3* %1 to float*
%6 = bitcast %struct.vec3* %2 to float*
%7 = tail call i32 @vec3_slide(float* %4, float* %5, float* %6)
ret %struct.vec3* %0
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
time_t get_time_using_time_plus_delta(void *user_data) {
  time_t user_delta = (user_data == NULL) ? 0 : *(time_t *)user_data;
  return user_delta + time(NULL);
}


x86 assembly (clang, -O0):
<get_time_using_time_plus_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <get_time_using_time_plus_delta+0x22>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    113d <get_time_using_time_plus_delta+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_using_time_plus_delta>:
push   %rbx
test   %rdi,%rdi
je     111b <get_time_using_time_plus_delta+0xb>
mov    (%rdi),%rbx
jmp    111d <get_time_using_time_plus_delta+0xd>
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <time@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_time_using_time_plus_delta(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
br label %11
11: ; preds = %7, %6
%12 = phi i64 [ 0, %6 ], [ %10, %7 ]
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = call i64 @time(i32* null)
%15 = add nsw i64 %13, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @get_time_using_time_plus_delta(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %4
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 0, %1 ]
%8 = tail call i64 @time(i32* null)
%9 = add nsw i64 %8, %7
ret i64 %9
}