xunge/DecIR huggingface dataset:
int ishexdigit(char ch) {
  if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') ||
      (ch >= 'A' && ch <= 'F'))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ishexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <ishexdigit+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <ishexdigit+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     113e <ishexdigit+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jle    1158 <ishexdigit+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1164 <ishexdigit+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1164 <ishexdigit+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ishexdigit+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishexdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ishexdigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 102
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 65
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 70
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @ishexdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void RTDbgModRvaToSegOff(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModRvaToSegOff() {
ret void
}
int test_imm_44uint16_reg(unsigned short val) {
  return ((val) & (-0x44 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_44uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffbc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_44uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -68
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_44uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -68
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ removeMonitor(char *);
void exitLoadAvg(void) {
  removeMonitor("cpu/loadavg1");
  removeMonitor("cpu/loadavg5");
  removeMonitor("cpu/loadavg15");
}


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

x86 assembly (clang, -O2):
<exitLoadAvg>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <removeMonitor@plt>
lea    0xee9(%rip),%rdi
call   1030 <removeMonitor@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1030 <removeMonitor@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"cpu/loadavg1\00"
@.str.1 = [13 x i8] c"cpu/loadavg5\00"
@.str.2 = [14 x i8] c"cpu/loadavg15\00"
define void @exitLoadAvg() {
%1 = call i32 @removeMonitor(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @removeMonitor(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @removeMonitor(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"cpu/loadavg1\00"
@.str.1 = [13 x i8] c"cpu/loadavg5\00"
@.str.2 = [14 x i8] c"cpu/loadavg15\00"
define void @exitLoadAvg() {
%1 = tail call i32 @removeMonitor(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @removeMonitor(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @removeMonitor(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double add2(double *a, double *b, int i, double fact) {
  double c;
  c = a[i] + b[i] + fact;
  return c;
}


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
movslq %edx,%rax
movsd  (%rdi,%rax,8),%xmm1
addsd  (%rsi,%rax,8),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add2(double* %0, double* %1, i32 %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double %3, double* %8
%10 = load double*, double** %5
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = fadd double %14, %19
%21 = load double, double* %8
%22 = fadd double %20, %21
store double %22, double* %9
%23 = load double, double* %9
ret double %23
}

LLVM IR (-O2):
define double @add2(double* nocapture %0, double* nocapture %1, i32 %2, double %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 %5
%9 = load double, double* %8
%10 = fadd double %7, %9
%11 = fadd double %10, %3
ret double %11
}
/* Variables and functions */
int do_clc();
int do_cmc();
int do_stc();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("clc: 0x%016llx\n", 0x8d5 & do_clc());
  printf("stc: 0x%016llx\n", 0x8d5 & do_stc());
  printf("cmc: 0x%016llx\n", 0x8d5 & do_cmc());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <do_clc@plt>
mov    %eax,%esi
and    $0x8d5,%esi
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <do_stc@plt>
mov    %eax,%esi
and    $0x8d5,%esi
lea    0xe90(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <do_cmc@plt>
mov    %eax,%esi
and    $0x8d5,%esi
lea    0xe85(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <do_clc@plt>
and    $0x8d5,%eax
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <do_stc@plt>
and    $0x8d5,%eax
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <do_cmc@plt>
and    $0x8d5,%eax
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"clc: 0x%016llx\0A\00"
@.str.1 = [16 x i8] c"stc: 0x%016llx\0A\00"
@.str.2 = [16 x i8] c"cmc: 0x%016llx\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @do_clc()
%3 = and i32 2261, %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @do_stc()
%6 = and i32 2261, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @do_cmc()
%9 = and i32 2261, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"clc: 0x%016llx\0A\00"
@.str.1 = [16 x i8] c"stc: 0x%016llx\0A\00"
@.str.2 = [16 x i8] c"cmc: 0x%016llx\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @do_clc()
%2 = and i32 %1, 2261
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @do_stc()
%5 = and i32 %4, 2261
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @do_cmc()
%8 = and i32 %7, 2261
%9 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
int null_readtoc_raw(unsigned char *b, int maxlen) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @null_readtoc_raw(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
void *uDMAControlBaseGet(void) {
  return ((void *)(*((volatile unsigned long *)(0x400FF000 + 0x00000008))));
}


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

x86 assembly (clang, -O2):
<uDMAControlBaseGet>:
mov    0x400ff008,%rax
40
ret

LLVM IR (-O0):
define i8* @uDMAControlBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786312 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @uDMAControlBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786312 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char const *, char);
char *gs_reject(char *str, const char *reject) {
  while (*str) {
    if (!strchr(reject, *str))
      return str;
    str++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<gs_reject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <gs_reject+0x54>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    1153 <gs_reject+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <gs_reject+0x5c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <gs_reject+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_reject>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113b <gs_reject+0x2b>
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %eax,%eax
je     113d <gs_reject+0x2d>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <gs_reject+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @gs_reject(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i32 @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ stdout;
int main() {
  FILE *fp;
  fp = stderr;
  if (fp == stderr) {
    fprintf(stdout, "comparison is possible\n");
    return 0;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%rax
jne    116e <main+0x4e>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32* null
@stdout = global i32 0
@.str = [24 x i8] c"comparison is possible\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = load i32*, i32** @stderr
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = load i32*, i32** @stderr
%6 = icmp eq i32* %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
10: ; preds = %0
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@stdout = global i32 0
@.str = [24 x i8] c"comparison is possible\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
__attribute__((always_)) void print_integer(long v) { printf("%ld", v); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @print_integer(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
int mm_check() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mm_check() {
ret i32 0
}
void canonical(path) char *path;
{
  char buf[2048] = "";
  if (realpath(path, buf)) {
    strcpy(path, buf);
  }
}


x86 assembly (clang, -O0):
<canonical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    $0x0,%al
call   1050 <realpath@plt>
cmp    $0x0,%eax
je     117d <canonical+0x4d>
mov    -0x8(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonical>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x800,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <realpath@plt>
test   %eax,%eax
je     116b <canonical+0x3b>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @canonical(i8* %0) {
%2 = alloca i8*
%3 = alloca [2048 x i8]
store i8* %0, i8** %2
%4 = bitcast [2048 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @realpath to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%12 = call i8* @strcpy(i8* %10, i8* %11)
br label %13
13: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @canonical(i8* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @realpath to i32 (i8*, i8*, ...)*)(i8* %0, i8* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i8* @strcpy(i8* dereferenceable(1) %0, i8* %3)
br label %8
8: ; preds = %6, %1
ret void
}
int test_imm_87uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x87 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_87uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 135
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_87uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 135
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
bool processLabel(char *string, uintmax_t linenumber) {}


x86 assembly (clang, -O0):
<processLabel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @processLabel(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
void x() {}


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

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

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

LLVM IR (-O2):
define void @x() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void generator_init() { srand(time(NULL)); }


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

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

LLVM IR (-O0):
define void @generator_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @generator_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Type definitions */
struct mls_evt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int, char *);
int /*<<< orphan*/ stdout;
scalar_t__ time(int /*<<< orphan*/ *);
void _callback_2(struct mls_evt *evt, void *tag) {
  fprintf(stdout, "TIMEOUT: %u %s\n", (unsigned int)time(NULL), (char *)tag);
}


x86 assembly (clang, -O0):
<_callback_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_callback_2>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
xor    %edi,%edi
call   1040 <time@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.mls_evt = type { i32 }
@stdout = global i32 0
@.str = [16 x i8] c"TIMEOUT: %u %s\0A\00"
define void @_callback_2(%struct.mls_evt* %0, i8* %1) {
%3 = alloca %struct.mls_evt*
%4 = alloca i8*
store %struct.mls_evt* %0, %struct.mls_evt** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.mls_evt = type { i32 }
@stdout = global i32 0
@.str = [16 x i8] c"TIMEOUT: %u %s\0A\00"
define void @_callback_2(%struct.mls_evt* nocapture readnone %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dec(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int x, i;
  printf("Enter the value of x:\n");
  scanf("%d", &x);
  dec(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <dec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <dec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter the value of x:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @dec(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [22 x i8] c"Enter the value of x:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @dec(i32 %5)
ret i32 0
}
/* Type definitions */
struct student {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print(struct student *);
void main() {
  struct student *makeit();
  print(makeit());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <makeit@plt>
mov    %rax,%rdi
call   1040 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <makeit@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <print@plt>

LLVM IR (-O0):
%struct.student = type { i32 }
define void @main() {
%1 = call %struct.student* (...) @makeit()
%2 = call i32 @print(%struct.student* %1)
ret void
}

LLVM IR (-O2):
%struct.student = type { i32 }
define void @main() {
%1 = tail call %struct.student* (...) @makeit()
%2 = tail call i32 @print(%struct.student* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdaq_uart_write(unsigned char, void *, unsigned int);
void UARTSend(unsigned char module, unsigned char *data, unsigned int size) {
  mdaq_uart_write(module, (void *)data, size);
}


x86 assembly (clang, -O0):
<UARTSend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movzbl %al,%edi
call   1030 <mdaq_uart_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSend>:
jmp    1030 <mdaq_uart_write@plt>

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

LLVM IR (-O2):
define void @UARTSend(i8 zeroext %0, i8* %1, i32 %2) {
%4 = tail call i32 @mdaq_uart_write(i8 zeroext %0, i8* %1, i32 %2)
ret void
}
void glGetTexParameterfv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetTexParameterfv() {
ret void
}
/* Type definitions */
struct crest_resp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ crest_resp_send(struct crest_resp *, int);
int /*<<< orphan*/ crest_resp_write(struct crest_resp *, char const *,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ strnlen(char const *, int);
void crest_resp_send_error(struct crest_resp *resp, int code,
                           const char *reason) {
  crest_resp_write(resp, reason, strnlen(reason, 1024));
  crest_resp_send(resp, code);
}


x86 assembly (clang, -O0):
<crest_resp_send_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x400,%esi
call   1050 <strnlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <crest_resp_write@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <crest_resp_send@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crest_resp_send_error>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
mov    $0x400,%esi
call   1050 <strnlen@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <crest_resp_write@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <crest_resp_send@plt>

LLVM IR (-O0):
%struct.crest_resp = type { i32 }
define void @crest_resp_send_error(%struct.crest_resp* %0, i32 %1, i8* %2) {
%4 = alloca %struct.crest_resp*
%5 = alloca i32
%6 = alloca i8*
store %struct.crest_resp* %0, %struct.crest_resp** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.crest_resp*, %struct.crest_resp** %4
%8 = load i8*, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strnlen(i8* %9, i32 1024)
%11 = call i32 @crest_resp_write(%struct.crest_resp* %7, i8* %8, i32 %10)
%12 = load %struct.crest_resp*, %struct.crest_resp** %4
%13 = load i32, i32* %5
%14 = call i32 @crest_resp_send(%struct.crest_resp* %12, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.crest_resp = type { i32 }
define void @crest_resp_send_error(%struct.crest_resp* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strnlen(i8* %2, i32 1024)
%5 = tail call i32 @crest_resp_write(%struct.crest_resp* %0, i8* %2, i32 %4)
%6 = tail call i32 @crest_resp_send(%struct.crest_resp* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2qah(int *, float *, float *);
void s2qah_(int *fs, float *angle, float *barb) { s2qah(fs, angle, barb); }


x86 assembly (clang, -O0):
<s2qah_>:
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 <s2qah@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2qah_>:
jmp    1030 <s2qah@plt>

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

LLVM IR (-O2):
define void @s2qah_(i32* %0, float* %1, float* %2) {
%4 = tail call i32 @s2qah(i32* %0, float* %1, float* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _cause(int);
void _cause_ades() { _cause(2); }


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

x86 assembly (clang, -O2):
<_cause_ades>:
mov    $0x2,%edi
jmp    1030 <_cause@plt>

LLVM IR (-O0):
define void @_cause_ades() {
%1 = call i32 @_cause(i32 2)
ret void
}

LLVM IR (-O2):
define void @_cause_ades() {
%1 = tail call i32 @_cause(i32 2)
ret void
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_DAEMON;
int LOG_PID;
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
void udev_log_init(const char *program_name) {
  openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON);
}


x86 assembly (clang, -O0):
<udev_log_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_log_init>:
mov    0x2ec1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_DAEMON = global i32 0
define void @udev_log_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_CONS
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_DAEMON
%8 = call i32 @openlog(i8* %3, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_DAEMON = global i32 0
define void @udev_log_init(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_CONS
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_DAEMON
%6 = tail call i32 @openlog(i8* %0, i32 %4, i32 %5)
ret void
}
int foo(int a) { return a + 5; }


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

x86 assembly (clang, -O2):
<foo>:
lea    0x5(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 5
ret i32 %2
}
unsigned int nio_cursor_clock(void) { return *(volatile unsigned *)0x90090000; }


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

x86 assembly (clang, -O2):
<nio_cursor_clock>:
mov    $0x90090000,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @nio_cursor_clock() {
%1 = load volatile i32, i32* inttoptr (i64 2416508928 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nio_cursor_clock() {
%1 = load volatile i32, i32* inttoptr (i64 2416508928 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ circle(int, int, int);
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ initwindow(int, int, char *);
int /*<<< orphan*/ kbhit();
int main() {
  initwindow(400, 300, "First Sample");
  circle(100, 50, 40);
  while (!kbhit()) {
    delay(200);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x190,%edi
mov    $0x12c,%esi
lea    0xea0(%rip),%rdx
call   1030 <initwindow@plt>
mov    $0x64,%edi
mov    $0x32,%esi
mov    $0x28,%edx
call   1060 <circle@plt>
mov    $0x0,%al
call   1040 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1195 <main+0x55>
jmp    11a4 <main+0x64>
mov    $0xc8,%edi
call   1050 <delay@plt>
jmp    1179 <main+0x39>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdx
mov    $0x190,%edi
mov    $0x12c,%esi
call   1030 <initwindow@plt>
mov    $0x64,%edi
mov    $0x32,%esi
mov    $0x28,%edx
call   1060 <circle@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <kbhit@plt>
test   %eax,%eax
jne    1187 <main+0x47>
mov    $0xc8,%edi
call   1050 <delay@plt>
jmp    1170 <main+0x30>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"First Sample\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @initwindow(i32 400, i32 300, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @circle(i32 100, i32 50, i32 40)
br label %4
4: ; preds = %8, %0
%5 = call i32 (...) @kbhit()
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @delay(i32 200)
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"First Sample\00"
define i32 @main() {
%1 = tail call i32 @initwindow(i32 400, i32 300, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @circle(i32 100, i32 50, i32 40)
%3 = tail call i32 (...) @kbhit()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = tail call i32 @delay(i32 200)
%7 = tail call i32 (...) @kbhit()
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}
void rop3_124_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~S;
  stk3 = *D | stk4;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_124_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_124_0_0>:
mov    %esi,%eax
not    %al
or     (%rdi),%al
and    %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_124_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = and i8 %6, %2
%8 = xor i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Type definitions */
struct DataManager {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ data_reset(struct DataManager *);
void data_init(struct DataManager *manager) { data_reset(manager); }


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

x86 assembly (clang, -O2):
<data_init>:
jmp    1030 <data_reset@plt>

LLVM IR (-O0):
%struct.DataManager = type { i32 }
define void @data_init(%struct.DataManager* %0) {
%2 = alloca %struct.DataManager*
store %struct.DataManager* %0, %struct.DataManager** %2
%3 = load %struct.DataManager*, %struct.DataManager** %2
%4 = call i32 @data_reset(%struct.DataManager* %3)
ret void
}

LLVM IR (-O2):
%struct.DataManager = type { i32 }
define void @data_init(%struct.DataManager* %0) {
%2 = tail call i32 @data_reset(%struct.DataManager* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
struct _Locale_ctype {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ towlower(int /*<<< orphan*/);
wint_t _WLocale_tolower(struct _Locale_ctype *lctype, wint_t wc) {
  return towlower(wc);
}


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

x86 assembly (clang, -O2):
<_WLocale_tolower>:
mov    %esi,%edi
jmp    1030 <towlower@plt>

LLVM IR (-O0):
%struct._Locale_ctype = type { i32 }
define i32 @_WLocale_tolower(%struct._Locale_ctype* %0, i32 %1) {
%3 = alloca %struct._Locale_ctype*
%4 = alloca i32
store %struct._Locale_ctype* %0, %struct._Locale_ctype** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @towlower(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct._Locale_ctype = type { i32 }
define i32 @_WLocale_tolower(%struct._Locale_ctype* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @towlower(i32 %1)
ret i32 %3
}
struct hostent *gethostent() {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.hostent = type opaque
define %struct.hostent* @gethostent() {
ret %struct.hostent* null
}

LLVM IR (-O2):
%struct.hostent = type opaque
define noalias %struct.hostent* @gethostent() {
ret %struct.hostent* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Size of int is %lu bytes.\n", sizeof(int));
  printf("Size of long int is %lu bytes.\n", sizeof(long int));
  printf("Size of long long int is %lu bytes.\n", sizeof(long long int));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Size of int is %lu bytes.\0A\00"
@.str.1 = [32 x i8] c"Size of long int is %lu bytes.\0A\00"
@.str.2 = [37 x i8] c"Size of long long int is %lu bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 8)
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Size of int is %lu bytes.\0A\00"
@.str.1 = [32 x i8] c"Size of long int is %lu bytes.\0A\00"
@.str.2 = [37 x i8] c"Size of long long int is %lu bytes.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
int omp_get_max_threads(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @omp_get_max_threads() {
ret i32 1
}
/* Type definitions */
struct gptimer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gptimer_test001(struct gptimer *, int);
int /*<<< orphan*/ report_device(int);
int gptimer_test(int addr, int irq) {
  struct gptimer *lr = (struct gptimer *)addr;
  report_device(0x01011000);
  gptimer_test001(lr, irq);
  return 0;
}


x86 assembly (clang, -O0):
<gptimer_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x1011000,%edi
call   1030 <report_device@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <gptimer_test001@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gptimer_test>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movslq %edi,%rbx
mov    $0x1011000,%edi
call   1030 <report_device@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <gptimer_test001@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.gptimer = type { i32 }
define i32 @gptimer_test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.gptimer*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.gptimer*
store %struct.gptimer* %8, %struct.gptimer** %5
%9 = call i32 @report_device(i32 16846848)
%10 = load %struct.gptimer*, %struct.gptimer** %5
%11 = load i32, i32* %4
%12 = call i32 @gptimer_test001(%struct.gptimer* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
%struct.gptimer = type { i32 }
define i32 @gptimer_test(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to %struct.gptimer*
%5 = tail call i32 @report_device(i32 16846848)
%6 = tail call i32 @gptimer_test001(%struct.gptimer* %4, i32 %1)
ret i32 0
}
void node_destroy(void *a) { ; }


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

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

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

LLVM IR (-O2):
define void @node_destroy(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("sizeof(int)            = [%ld]\n", sizeof(int));
  printf("sizeof(long)           = [%ld]\n", sizeof(long));
  printf("sizeof(struct timeval) = [%ld]\n", sizeof(struct timeval));
  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
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"sizeof(int) = [%ld]\0A\00"
@.str.1 = [32 x i8] c"sizeof(long) = [%ld]\0A\00"
@.str.2 = [32 x i8] c"sizeof(struct timeval) = [%ld]\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 ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 8)
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"sizeof(int) = [%ld]\0A\00"
@.str.1 = [32 x i8] c"sizeof(long) = [%ld]\0A\00"
@.str.2 = [32 x i8] c"sizeof(struct timeval) = [%ld]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}