xunge/DecIR huggingface dataset:
/* Variables and functions */
int do_cpufreq(int, char **);
int do_pstate(int, char **);
scalar_t__ is_pstate();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (is_pstate()) {
    printf("Pstate driver\n");
    return do_pstate(argc, argv);
  } else
    return do_cpufreq(argc, argv);
}


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   1060 <is_pstate@plt>
cmp    $0x0,%rax
je     1187 <main+0x47>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <do_pstate@plt>
mov    %eax,-0x4(%rbp)
jmp    1196 <main+0x56>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <do_cpufreq@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <is_pstate@plt>
test   %rax,%rax
je     1170 <main+0x30>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <do_pstate@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <do_cpufreq@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Pstate driver\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 i64 (...) @is_pstate()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @do_pstate(i32 %10, i8** %11)
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @do_cpufreq(i32 %14, i8** %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@str = [14 x i8] c"Pstate driver\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 (...) @is_pstate()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @do_pstate(i32 %0, i8** %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @do_cpufreq(i32 %0, i8** %1)
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ drawstackDestroy();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ gfxEnd();
int /*<<< orphan*/ mapDestroy();
int /*<<< orphan*/ stderr;
void sigexit(int signum) {
  gfxEnd();
  mapDestroy();
  drawstackDestroy();
  fprintf(stderr, "Use 'q' next time, bye!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sigexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gfxEnd@plt>
mov    $0x0,%al
call   1070 <mapDestroy@plt>
mov    $0x0,%al
call   1030 <drawstackDestroy@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<sigexit>:
push   %rax
xor    %eax,%eax
call   1040 <gfxEnd@plt>
xor    %eax,%eax
call   1070 <mapDestroy@plt>
xor    %eax,%eax
call   1030 <drawstackDestroy@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Use 'q' next time, bye!\0A\00"
define void @sigexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gfxEnd()
%4 = call i32 (...) @mapDestroy()
%5 = call i32 (...) @drawstackDestroy()
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Use 'q' next time, bye!\0A\00"
define void @sigexit(i32 %0) {
%2 = tail call i32 (...) @gfxEnd()
%3 = tail call i32 (...) @mapDestroy()
%4 = tail call i32 (...) @drawstackDestroy()
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main() {
  f1(20);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 20)
ret i32 0
}
void dummy_file_function(int a) {}


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

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

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

LLVM IR (-O2):
define void @dummy_file_function(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ platform_init();
void init() { platform_init(); }


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

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

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

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @platform_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ putchar(char);
void badImage(int fd) {
  printf("%s!!! If you flash this image these bytes cause 'no system' !!!%s\n",
         "\033[41m", "\033[0m");
  putchar('\a');
  close(fd);
  exit(2);
}


x86 assembly (clang, -O0):
<badImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xee9(%rip),%rdx
call   1040 <printf@plt>
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<badImage>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xef1(%rip),%rdx
call   1040 <printf@plt>
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"%s!!! If you flash this image these bytes cause 'no system' !!!%s\0A\00"
@.str.1 = [6 x i8] c"\1B[41m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @badImage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @putchar(i8 signext 7)
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
%7 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [67 x i8] c"%s!!! If you flash this image these bytes cause 'no system' !!!%s\0A\00"
@.str.1 = [6 x i8] c"\1B[41m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @badImage(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @putchar(i8 signext 7)
%4 = tail call i32 @close(i32 %0)
%5 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
bool nrf51_errata_50(void) { return false; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *);
void __func_invert_uint(struct Var *avar, const char *areg, const char *lreg,
                        const char *rreg) {
  pA("%s = %s ^ (-1);", areg, lreg);
}


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

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [16 x i8] c"%s = %s ^ (-1);\00"
define void @__func_invert_uint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i32 @pA(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [16 x i8] c"%s = %s ^ (-1);\00"
define void @__func_invert_uint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
unsigned int getTotalCount(unsigned int *cnt) {
  unsigned int i = 0;
  unsigned int total = 0;
  for (i = 0; i < 2; i = i + 1) {
    total = total + cnt[i];
  }
  return total;
}


x86 assembly (clang, -O0):
<getTotalCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jae    1145 <getTotalCount+0x45>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <getTotalCount+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTotalCount>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getTotalCount(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
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp ult i32 %6, 2
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = add i32 %9, %14
store i32 %15, i32* %4
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @getTotalCount(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = add i32 %4, %2
ret i32 %5
}
void strcpy_2(char *s, char *t) {
  int i = 0;
  while ((*s++ = *t++) != '\0') {
  }
}


x86 assembly (clang, -O0):
<strcpy_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1146 <strcpy_2+0x46>
jmp    1113 <strcpy_2+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_2>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy_2+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy_2(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintTitles(char Title[50]) {
  printf("\n-------------------------------------------------------------------"
         "--------------------------------------\n");
  printf("------------------------------------------------ %s "
         "------------------------------------------------\n",
         Title);
  printf("---------------------------------------------------------------------"
         "------------------------------------\n");
}


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

x86 assembly (clang, -O2):
<PrintTitles>:
push   %rbx
mov    %rdi,%rbx
lea    0xf3b(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1f(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [102 x i8] c"------------------------------------------------ %s ------------------------------------------------\0A\00"
@str = [107 x i8] c"\0A---------------------------------------------------------------------------------------------------------\00"
@str.3 = [106 x i8] c"---------------------------------------------------------------------------------------------------------\00"
define void @PrintTitles(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @str.3, i64 0, i64 0))
ret void
}
int test_imm_B7uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B7uint64_lowword_mem>:
testb  $0xb7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B7uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 183
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
AR0IR1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[10000000]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2625a00(%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
ja     113a <AR0IR1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <AR0IR1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0IR1>:
mov    0x2625a00(%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = icmp ule i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __ieee754_powl(long double x, long double y) {
  fputs("__ieee754_powl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__ieee754_powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ieee754_powl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"__ieee754_powl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_powl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [32 x i8] c"__ieee754_powl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_powl(x86_fp80 %0, x86_fp80 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
char *malloc(size_t);
char *strcpy(char *, char const *);
size_t strlen(char const *);
char *strdup(const char *s) {
  char *str;
  size_t len = strlen(s);
  if (!(str = malloc(len + 1)))
    return NULL;
  return strcpy(str, s);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1171 <strdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
int test_imm_12int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x12 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_12int64_midword_mem>:
testb  $0x12,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_12int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1179648
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int open(char *, int);
char *tmpnam(char *);
int mkstemp(char *temp) {
  char *name = tmpnam(temp);
  if (name == NULL)
    return -1;
  return open(name, O_RDWR | O_CREAT);
}


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <tmpnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <mkstemp+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <mkstemp+0x4e>
mov    -0x18(%rbp),%rdi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemp>:
push   %rax
call   1040 <tmpnam@plt>
test   %rax,%rax
je     1146 <mkstemp+0x26>
mov    0x2eae(%rip),%rcx
mov    0x2ebf(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    %rax,%rdi
pop    %rax
jmp    1030 <open@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @tmpnam(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %16
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = load i32, i32* @O_RDWR
%13 = load i32, i32* @O_CREAT
%14 = or i32 %12, %13
%15 = call i32 @open(i8* %11, i32 %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = tail call i8* @tmpnam(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_CREAT
%7 = or i32 %6, %5
%8 = tail call i32 @open(i8* %2, i32 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}
short unsigned int f2(short unsigned int arg) { return arg; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @f2(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @f2(i16 returned zeroext %0) {
ret i16 %0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int _wyhash(void const *, int, int, int const *);
int _wymum(int, int const);
uint64_t wyhash(const void *key, uint64_t len, uint64_t seed,
                const uint64_t secret[6]) {
  return _wymum(_wyhash(key, len, seed, secret) ^ len, secret[5]);
}


x86 assembly (clang, -O0):
<wyhash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <_wyhash@plt>
mov    %eax,%edi
xor    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%esi
call   1030 <_wymum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wyhash>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %esi,%ebp
call   1040 <_wyhash@plt>
xor    %eax,%ebp
mov    0x14(%rbx),%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_wymum@plt>

LLVM IR (-O0):
define i32 @wyhash(i8* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @_wyhash(i8* %9, i32 %10, i32 %11, i32* %12)
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
%16 = load i32*, i32** %8
%17 = getelementptr inbounds i32, i32* %16, i64 5
%18 = load i32, i32* %17
%19 = call i32 @_wymum(i32 %15, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @wyhash(i8* %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @_wyhash(i8* %0, i32 %1, i32 %2, i32* %3)
%6 = xor i32 %5, %1
%7 = getelementptr inbounds i32, i32* %3, i64 5
%8 = load i32, i32* %7
%9 = tail call i32 @_wymum(i32 %6, i32 %8)
ret i32 %9
}
struct A *f() {
  return (void *)0;
}


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

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

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

LLVM IR (-O2):
%struct.A = type opaque
define noalias %struct.A* @f() {
ret %struct.A* null
}
int highlightRegion_BaseScreen(int left, int right, int top, int bottom) {
  return 0;
}


x86 assembly (clang, -O0):
<highlightRegion_BaseScreen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @highlightRegion_BaseScreen(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @highlightRegion_BaseScreen(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
int backlight_set_brightness(struct backlight_device *dev, int brightness) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.backlight_device = type opaque
define i32 @backlight_set_brightness(%struct.backlight_device* %0, i32 %1) {
%3 = alloca %struct.backlight_device*
%4 = alloca i32
store %struct.backlight_device* %0, %struct.backlight_device** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.backlight_device = type opaque
define i32 @backlight_set_brightness(%struct.backlight_device* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ scuUngatePeripheralClock(int);
unsigned int usicEnable(void) {
  if (scuUngatePeripheralClock((1 << 3))) {
    return 1;
  }
  if (((*((volatile unsigned int *const)(0x48000000 + 0x08))) >> 8) !=
      0x0000AAC0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<usicEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <scuUngatePeripheralClock@plt>
cmp    $0x0,%rax
je     1138 <usicEnable+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1160 <usicEnable+0x50>
mov    $0x48000008,%eax
mov    (%rax),%eax
shr    $0x8,%eax
cmp    $0xaac0,%eax
je     1159 <usicEnable+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1160 <usicEnable+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usicEnable>:
push   %rax
mov    $0x8,%edi
call   1030 <scuUngatePeripheralClock@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112a <usicEnable+0x1a>
pop    %rcx
ret
mov    $0xffffff00,%ecx
and    0x48000008,%ecx
xor    %eax,%eax
cmp    $0xaac000,%ecx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @usicEnable() {
%1 = alloca i32
%2 = call i64 @scuUngatePeripheralClock(i32 8)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %11
5: ; preds = %0
%6 = load volatile i32, i32* inttoptr (i64 1207959560 to i32*)
%7 = lshr i32 %6, 8
%8 = icmp ne i32 %7, 43712
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %11
10: ; preds = %5
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @usicEnable() {
%1 = tail call i64 @scuUngatePeripheralClock(i32 8)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load volatile i32, i32* inttoptr (i64 1207959560 to i32*)
%5 = and i32 %4, -256
%6 = icmp ne i32 %5, 11190272
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ 1, %0 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Camellia_encrypt(const unsigned char *in, unsigned char *out,
                      const void *key) {
  printf("Camellia_encrypt stubbed\n");
  (void)&(in);
  (void)&(out);
  (void)&(key);
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Camellia_encrypt stubbed\0A\00"
define void @Camellia_encrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Camellia_encrypt stubbed\00"
define void @Camellia_encrypt(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
void HSetGrey(int g) {}


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

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

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

LLVM IR (-O2):
define void @HSetGrey(i32 %0) {
ret void
}
int DayOfWeek(long int sdn) {
  int dow;
  dow = (sdn + 1) % 7;
  if (dow >= 0) {
    return (dow);
  } else {
    return (dow + 7);
  }
}


x86 assembly (clang, -O0):
<DayOfWeek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    $0x7,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1134 <DayOfWeek+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <DayOfWeek+0x3d>
mov    -0x14(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DayOfWeek>:
add    $0x1,%rdi
movabs $0x4924924924924925,%rcx
92 24 49
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    %rdx
add    %eax,%edx
lea    0x0(,%rdx,8),%eax
sub    %eax,%edx
lea    (%rdi,%rdx,1),%eax
add    $0x7,%eax
mov    %edi,%ecx
add    %edx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @DayOfWeek(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add nsw i64 %5, 1
%7 = srem i64 %6, 7
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %16
13: ; preds = %1
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 7
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @DayOfWeek(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = srem i64 %2, 7
%4 = trunc i64 %3 to i32
%5 = icmp sgt i32 %4, -1
%6 = add nsw i32 %4, 7
%7 = select i1 %5, i32 %4, i32 %6
ret i32 %7
}
int st_min(int x, int y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<st_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <st_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <st_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @st_min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @st_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_array2_op();
int main() {
  test_array2_op();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_array2_op()
ret i32 0
}
/* Variables and functions */
int creat(char *, int);
int /*<<< orphan*/ printf(char *, ...);
void createFile(char *fname) {
  int fd;
  fd = creat(fname, 0644);
  if (fd == -1) {
    printf("Error creating file\n");
  } else {
    printf("File descriptor %p\n", fd);
  }
}


x86 assembly (clang, -O0):
<createFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1a4,%esi
call   1040 <creat@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    115a <createFile+0x3a>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116b <createFile+0x4b>
mov    -0xc(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createFile>:
push   %rax
mov    $0x1a4,%esi
call   1050 <creat@plt>
cmp    $0xffffffff,%eax
je     1151 <createFile+0x21>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Error creating file\0A\00"
@.str.1 = [20 x i8] c"File descriptor %p\0A\00"
define void @createFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @creat(i8* %4, i32 420)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"File descriptor %p\0A\00"
@str = [20 x i8] c"Error creating file\00"
define void @createFile(i8* %0) {
%2 = tail call i32 @creat(i8* %0, i32 420)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %6, %4
ret void
}
int char2int(char **str) {
  int res = 0;
  for (; **str >= '0' && **str <= '9'; (*str)++)
    res = 10 * res + **str - '0';
  return res;
}


x86 assembly (clang, -O0):
<char2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     113a <char2int+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <char2int+0x4a>
jmp    1173 <char2int+0x73>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110f <char2int+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2int>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113f <char2int+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
mov    %rcx,(%rdi)
movzbl (%rcx),%edx
lea    -0x30(%rdx),%esi
add    $0x1,%rcx
cmp    $0xa,%sil
jb     1120 <char2int+0x20>
ret

LLVM IR (-O0):
define i32 @char2int(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %27, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %10, %4
%17 = phi i1 [ false, %4 ], [ %15, %10 ]
br i1 %17, label %18, label %31
18: ; preds = %16
%19 = load i32, i32* %3
%20 = mul nsw i32 10, %19
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = add nsw i32 %20, %24
%26 = sub nsw i32 %25, 48
store i32 %26, i32* %3
br label %27
27: ; preds = %18
%28 = load i8**, i8*** %2
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %28
br label %4
31: ; preds = %16
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @char2int(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
long ioVMTickerStartUSecs() { return 0; }


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

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

LLVM IR (-O0):
define i64 @ioVMTickerStartUSecs() {
ret i64 0
}

LLVM IR (-O2):
define i64 @ioVMTickerStartUSecs() {
ret i64 0
}
/* Variables and functions */
scalar_t__ stress_mwc32();
int random_mount(const int mounts_max) {
  return (int)stress_mwc32() % mounts_max;
}


x86 assembly (clang, -O0):
<random_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stress_mwc32@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_mount>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <stress_mwc32@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_mount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @stress_mwc32()
%4 = trunc i64 %3 to i32
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @random_mount(i32 %0) {
%2 = tail call i64 (...) @stress_mwc32()
%3 = trunc i64 %2 to i32
%4 = srem i32 %3, %0
ret i32 %4
}
void gpio_nand_active(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_nand_active() {
ret void
}
void foo123() {}


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

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

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

LLVM IR (-O2):
define void @foo123() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *str, char *val) {
  fprintf(stderr, "fatal error: %s %s\n", str, val ? val : "");
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <fatal+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    116c <fatal+0x4c>
lea    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    116c <fatal+0x4c>
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rcx
lea    0xe82(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
test   %rsi,%rsi
lea    0xedc(%rip),%rcx
cmovne %rsi,%rcx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"fatal error: %s %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fatal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i8*, i8** %4
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %11 ]
%14 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"fatal error: %s %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fatal(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %1
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char f8(unsigned char x, unsigned long int y) {
  return (x << y) | (x >> ((-y) & (8 - 1)));
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0x7,%cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f8(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 0, %12
%14 = and i64 %13, 7
%15 = trunc i64 %14 to i32
%16 = ashr i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f8(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 7
%8 = lshr i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ RPI_AuxMiniUartWrite(int);
void noprompt() { RPI_AuxMiniUartWrite(13); }


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

x86 assembly (clang, -O2):
<noprompt>:
mov    $0xd,%edi
jmp    1030 <RPI_AuxMiniUartWrite@plt>

LLVM IR (-O0):
define void @noprompt() {
%1 = call i32 @RPI_AuxMiniUartWrite(i32 13)
ret void
}

LLVM IR (-O2):
define void @noprompt() {
%1 = tail call i32 @RPI_AuxMiniUartWrite(i32 13)
ret void
}