xunge/DecIR huggingface dataset:
int test_imm_C3int8_mem(signed char *val) {
  return ((*val) & (-0xC3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C3int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff3d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -195
%7 = icmp ne i32 %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_C3int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -195
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
int xmlUCSIsSinhala(int code) {
  return (((code >= 0x0D80) && (code <= 0x0DFF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsSinhala>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xd80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsSinhala+0x26>
cmpl   $0xdff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsSinhala>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xd80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsSinhala(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 3456
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3583
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsSinhala(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 3456
%4 = zext i1 %3 to i32
ret i32 %4
}
char *nameForStrand(char strand) {
  if (strand == '-')
    return "Minus";
  else
    return "Plus";
}


x86 assembly (clang, -O0):
<nameForStrand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x2d,%eax
jne    1127 <nameForStrand+0x27>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <nameForStrand+0x32>
lea    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nameForStrand>:
cmp    $0x2d,%dil
lea    0xef5(%rip),%rcx
lea    0xef4(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Minus\00"
@.str.1 = [5 x i8] c"Plus\00"
define i8* @nameForStrand(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 45
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"Minus\00"
@.str.1 = [5 x i8] c"Plus\00"
define i8* @nameForStrand(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ system(char *);
void cleanup_terminal_ncurses(void) {
  echo();
  system(
      "setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz  >/dev/null 2>&1");
  system("setterm -blank 10");
  endwin();
  system("clear");
}


x86 assembly (clang, -O0):
<cleanup_terminal_ncurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <echo@plt>
lea    0xebe(%rip),%rdi
call   1040 <system@plt>
lea    0xef7(%rip),%rdi
call   1040 <system@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
lea    0xef6(%rip),%rdi
call   1040 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_terminal_ncurses>:
push   %rax
xor    %eax,%eax
call   1030 <echo@plt>
lea    0xec1(%rip),%rdi
call   1040 <system@plt>
lea    0xefa(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz >/dev/null 2>&1\00"
@.str.1 = [18 x i8] c"setterm -blank 10\00"
@.str.2 = [6 x i8] c"clear\00"
define void @cleanup_terminal_ncurses() {
%1 = call i32 (...) @echo()
%2 = call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @endwin()
%5 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c"setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz >/dev/null 2>&1\00"
@.str.1 = [18 x i8] c"setterm -blank 10\00"
@.str.2 = [6 x i8] c"clear\00"
define void @cleanup_terminal_ncurses() {
%1 = tail call i32 (...) @echo()
%2 = tail call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @endwin()
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void keycn_(int *k) {}


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

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

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

LLVM IR (-O2):
define void @keycn_(i32* nocapture %0) {
ret void
}
int fun662() { return 662; }


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

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

LLVM IR (-O0):
define i32 @fun662() {
ret i32 662
}

LLVM IR (-O2):
define i32 @fun662() {
ret i32 662
}
int test_imm_A3uint8_mem(unsigned char *val) {
  return ((*val) & (0xA3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A3uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 163
%7 = icmp ne i32 %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_A3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -93
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ monitor();
int /*<<< orphan*/ my_thread1();
int main(void) {
__CPROVER_ASYNC_01:
  monitor();
  while (1) {
  __CPROVER_ASYNC_02:
    my_thread1();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <monitor@plt>
jmp    113b <main+0x1b>
mov    $0x0,%al
call   1030 <my_thread1@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <monitor@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <my_thread1@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 (...) @monitor()
br label %4
4: ; preds = %2, %5
br label %5
5: ; preds = %4
%6 = call i32 (...) @my_thread1()
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @monitor()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @my_thread1()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: getconf [-v prog_env] system_var\n"
                  "       getconf [-v prog_env] path_var pathname\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [88 x i8] c"usage: getconf [-v prog_env] system_var\0A getconf [-v prog_env] path_var pathname\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [88 x i8] c"usage: getconf [-v prog_env] system_var\0A getconf [-v prog_env] path_var pathname\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
void strcpy(char *d, char *s) {
  while ((*d++ = *s++))
    ;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%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)
cmp    $0x0,%al
je     113b <strcpy+0x3b>
jmp    110c <strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
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+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
bool nrf91_errata_2(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf91_errata_2() {
ret i32 0
}
char *fo_sysconfig(char *sectionname, char *variablename) { return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @fo_sysconfig(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ POSIX_FADV_DONTNEED;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fdatasync(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ posix_fadvise(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd;
  fd = open(argv[1], O_RDONLY);
  fdatasync(fd);
  posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <fdatasync@plt>
mov    -0x14(%rbp),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1050 <posix_fadvise@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <fdatasync@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%ecx
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <posix_fadvise@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@POSIX_FADV_DONTNEED = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = load i32, i32* @O_RDONLY
%11 = call i32 @open(i8* %9, i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @fdatasync(i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* @POSIX_FADV_DONTNEED
%16 = call i32 @posix_fadvise(i32 %14, i32 0, i32 0, i32 %15)
%17 = load i32, i32* %6
%18 = call i32 @close(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@POSIX_FADV_DONTNEED = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* %4, i32 %5)
%7 = tail call i32 @fdatasync(i32 %6)
%8 = load i32, i32* @POSIX_FADV_DONTNEED
%9 = tail call i32 @posix_fadvise(i32 %6, i32 0, i32 0, i32 %8)
%10 = tail call i32 @close(i32 %6)
ret i32 0
}
x_conv(x, other) int x, other;
{
  if (x == other)
    return (0);
  else if (x == 2)
    return (2);
  else
    return (1);
}


x86 assembly (clang, -O0):
<x_conv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <x_conv+0x22>
movl   $0x0,-0x4(%rbp)
jmp    113f <x_conv+0x3f>
cmpl   $0x2,-0x8(%rbp)
jne    1138 <x_conv+0x38>
movl   $0x2,-0x4(%rbp)
jmp    113f <x_conv+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_conv>:
xor    %ecx,%ecx
cmp    $0x2,%edi
sete   %cl
add    $0x1,%ecx
xor    %eax,%eax
cmp    %esi,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @x_conv(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i32 2, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
size_t __attribute__((__pure__)) xmax(size_t size1, size_t size2) {
  return (size1 >= size2 ? size1 : size2);
}


x86 assembly (clang, -O0):
<xmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1127 <xmax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <xmax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmax>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @xmax(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp uge i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @xmax(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
int execve(char *name, char **argv, char **env) {}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ NETSCAPE_SPKAC;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ NETSCAPE_SPKAC_it;
NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void) {
  return (NETSCAPE_SPKAC *)ASN1_item_new(&NETSCAPE_SPKAC_it);
}


x86 assembly (clang, -O0):
<NETSCAPE_SPKAC_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NETSCAPE_SPKAC_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@NETSCAPE_SPKAC_it = global i32 0
define i32* @NETSCAPE_SPKAC_new() {
%1 = call i64 @ASN1_item_new(i32* @NETSCAPE_SPKAC_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@NETSCAPE_SPKAC_it = global i32 0
define i32* @NETSCAPE_SPKAC_new() {
%1 = tail call i64 @ASN1_item_new(i32* @NETSCAPE_SPKAC_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ menu();
main() { menu(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @menu()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
pid_t background() {
  pid_t pid = fork();
  if (pid == 0) {
    fclose(stdin);
    fclose(stdout);
    fclose(stderr);
    return 0;
  }
  return pid;
}


x86 assembly (clang, -O0):
<background>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <background+0x55>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
movq   $0x0,-0x8(%rbp)
jmp    117d <background+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<background>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <background+0x3a>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define i64 @background() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* @stdin
%8 = call i32 @fclose(i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fclose(i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fclose(i32 %11)
store i64 0, i64* %1
br label %15
13: ; preds = %0
%14 = load i64, i64* %2
store i64 %14, i64* %1
br label %15
15: ; preds = %13, %6
%16 = load i64, i64* %1
ret i64 %16
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define i64 @background() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = load i32, i32* @stdin
%5 = tail call i32 @fclose(i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fclose(i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fclose(i32 %8)
br label %10
10: ; preds = %0, %3
ret i64 %1
}
void cbmarch_unlock(int f) {}


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

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

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

LLVM IR (-O2):
define void @cbmarch_unlock(i32 %0) {
ret void
}
unsigned char accReadByte(unsigned char address) { return 0; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @accReadByte(i8 zeroext %0) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ inputoptions();
void getinput() { inputoptions(); }


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

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

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

LLVM IR (-O2):
define void @getinput() {
%1 = tail call i32 (...) @inputoptions()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void itworked(void) {
  printf("Vulnerable\n");
  exit(1);
}


x86 assembly (clang, -O0):
<itworked>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [12 x i8] c"Vulnerable\0A\00"
define void @itworked() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [11 x i8] c"Vulnerable\00"
define void @itworked() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void f0() {}


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

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

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

LLVM IR (-O2):
define void @f0() {
ret void
}
void AssignMark(PDMCSchema, E, M) struct univStruct *PDMCSchema;
struct EnrolledIn *E;
int M;
{ AssignEnrolledInGrade(E, M); }


x86 assembly (clang, -O0):
<AssignMark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <AssignEnrolledInGrade@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssignMark>:
mov    %rsi,%rdi
mov    %edx,%esi
xor    %eax,%eax
jmp    1030 <AssignEnrolledInGrade@plt>

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.EnrolledIn = type opaque
define void @AssignMark(%struct.univStruct* %0, %struct.EnrolledIn* %1, i32 %2) {
%4 = alloca %struct.univStruct*
%5 = alloca %struct.EnrolledIn*
%6 = alloca i32
store %struct.univStruct* %0, %struct.univStruct** %4
store %struct.EnrolledIn* %1, %struct.EnrolledIn** %5
store i32 %2, i32* %6
%7 = load %struct.EnrolledIn*, %struct.EnrolledIn** %5
%8 = load i32, i32* %6
%9 = call i32 (%struct.EnrolledIn*, i32, ...) bitcast (i32 (...)* @AssignEnrolledInGrade to i32 (%struct.EnrolledIn*, i32, ...)*)(%struct.EnrolledIn* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.EnrolledIn = type opaque
define void @AssignMark(%struct.univStruct* nocapture readnone %0, %struct.EnrolledIn* %1, i32 %2) {
%4 = tail call i32 (%struct.EnrolledIn*, i32, ...) bitcast (i32 (...)* @AssignEnrolledInGrade to i32 (%struct.EnrolledIn*, i32, ...)*)(%struct.EnrolledIn* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printdate(void) {
  printf("2016-12-18\n");
  printf("2016-12-19\n");
}


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

x86 assembly (clang, -O2):
<printdate>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"2016-12-18\0A\00"
@.str.1 = [12 x i8] c"2016-12-19\0A\00"
define void @printdate() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"2016-12-18\00"
@str.2 = [11 x i8] c"2016-12-19\00"
define void @printdate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeTimer(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000002);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0x8,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeTimer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeTimer(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_speaker_stop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ev3_speaker_stop() {
ret i32 0
}
void rop3_119_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D & S;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_119_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %sil,%cl
or     %dl,%sil
not    %sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_119_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %2, %1
%7 = xor i8 %6, -1
%8 = or i8 %5, %7
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
double HPCC_dweps() {
  double eps, one, half;
  one = 1.0;
  half = one / 2.0;
  eps = one;
  while (one + eps != one)
    eps *= half;
  return eps;
}


x86 assembly (clang, -O0):
<HPCC_dweps>:
push   %rbp
mov    %rsp,%rbp
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1151 <HPCC_dweps+0x51>
jp     1151 <HPCC_dweps+0x51>
jmp    1165 <HPCC_dweps+0x65>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1131 <HPCC_dweps+0x31>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<HPCC_dweps>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @HPCC_dweps() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 1.000000e+00, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 2.000000e+00
store double %5, double* %3
%6 = load double, double* %2
store double %6, double* %1
br label %7
7: ; preds = %13, %0
%8 = load double, double* %2
%9 = load double, double* %1
%10 = fadd double %8, %9
%11 = load double, double* %2
%12 = fcmp une double %10, %11
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = load double, double* %3
%15 = load double, double* %1
%16 = fmul double %15, %14
store double %16, double* %1
br label %7
17: ; preds = %7
%18 = load double, double* %1
ret double %18
}

LLVM IR (-O2):
define double @HPCC_dweps() {
ret double 0x3CA0000000000000
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage:\n");
  printf("irq sim [num]      Simulate IRQ [num]\n");
  printf("irq enable [num]   Enable IRQ [num]\n");
  printf("irq disable [num]  Disable IRQ [num]\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [39 x i8] c"irq sim [num] Simulate IRQ [num]\0A\00"
@.str.2 = [37 x i8] c"irq enable [num] Enable IRQ [num]\0A\00"
@.str.3 = [38 x i8] c"irq disable [num] Disable IRQ [num]\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.4 = [38 x i8] c"irq sim [num] Simulate IRQ [num]\00"
@str.5 = [36 x i8] c"irq enable [num] Enable IRQ [num]\00"
@str.6 = [37 x i8] c"irq disable [num] Disable IRQ [num]\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int const EAGAIN;
bool ignore_sys_error(const int err) {
  if (err == EAGAIN) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<ignore_sys_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec7(%rip),%rcx
cmp    (%rcx),%eax
jne    1125 <ignore_sys_error+0x25>
movl   $0x1,-0x4(%rbp)
jmp    112c <ignore_sys_error+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_sys_error>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
@EAGAIN = constant i32 0
define i32 @ignore_sys_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @EAGAIN
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@EAGAIN = constant i32 0
define i32 @ignore_sys_error(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void klog_fileappend(char *file_path, char *string) {
  FILE *fp = fopen(file_path, "a");
  fputs(string, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<klog_fileappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<klog_fileappend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define void @klog_fileappend(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = call i32 @fputs(i8* %8, i32* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @klog_fileappend(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fputs(i8* %1, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
int compare(void const *data_1, void const *data_2) {
  float value_1 = *((float const *)data_1);
  float value_2 = *((float const *)data_2);
  float delta = value_1 - value_2;
  return (((delta) < 0) ? -1 : ((delta) > 0) ? 1 : 0);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    114f <compare+0x4f>
mov    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1167 <compare+0x67>
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
store float %10, float* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to float*
%13 = load float, float* %12
store float %13, float* %6
%14 = load float, float* %5
%15 = load float, float* %6
%16 = fsub float %14, %15
store float %16, float* %7
%17 = load float, float* %7
%18 = fcmp olt float %17, 0.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %2
br label %25
20: ; preds = %2
%21 = load float, float* %7
%22 = fcmp ogt float %21, 0.000000e+00
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
br label %25
25: ; preds = %20, %19
%26 = phi i32 [ -1, %19 ], [ %24, %20 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = fcmp olt float %7, 0.000000e+00
%9 = fcmp ogt float %7, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  time_t const time_in_seconds = time(NULL);
  puts(ctime(&time_in_seconds));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <ctime@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @time(i32* null)
store i32 %7, i32* %6
%8 = call i32 @ctime(i32* %6)
%9 = call i32 @puts(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call i32 @ctime(i32* %3)
%7 = call i32 @puts(i32 %6)
ret i32 0
}
/* Variables and functions */
int i2c_smbus_read_word_data(int, int);
int radxaI2CReadReg16(int fd, int reg) {
  return i2c_smbus_read_word_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<radxaI2CReadReg16>:
jmp    1030 <i2c_smbus_read_word_data@plt>

LLVM IR (-O0):
define i32 @radxaI2CReadReg16(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 = call i32 @i2c_smbus_read_word_data(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @radxaI2CReadReg16(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_word_data(i32 %0, i32 %1)
ret i32 %3
}
void rop3_188_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & S;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_188_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)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%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_188_0_0>:
mov    (%rdi),%al
and    %sil,%al
not    %al
and    %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_188_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = xor i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
unsigned int pow(int, int);
int /*<<< orphan*/ printf(char *, unsigned int, int);
void printHeader(int inputs) {
  unsigned int num_points;
  num_points = pow(2, inputs);
  printf("%d %d 1\n", num_points, inputs);
}


x86 assembly (clang, -O0):
<printHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHeader>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d 1\0A\00"
define void @printHeader(i32 %0) {
%2 = tail call i32 @pow(i32 2, i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
int fun117() { return 117; }


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

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

LLVM IR (-O0):
define i32 @fun117() {
ret i32 117
}

LLVM IR (-O2):
define i32 @fun117() {
ret i32 117
}
/* Variables and functions */
int /*<<< orphan*/ dft_xckernel_pwlda_(double *, double *, double *);
void dft_xckernel_pwlda(double ra, double rb, double FCLDA[9]) {
  dft_xckernel_pwlda_(&ra, &rb, FCLDA);
}


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

x86 assembly (clang, -O2):
<dft_xckernel_pwlda>:
sub    $0x18,%rsp
mov    %rdi,%rdx
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <dft_xckernel_pwlda_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @dft_xckernel_pwlda(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = call i32 @dft_xckernel_pwlda_(double* %4, double* %5, double* %7)
ret void
}

LLVM IR (-O2):
define void @dft_xckernel_pwlda(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = call i32 @dft_xckernel_pwlda_(double* %4, double* %5, double* %2)
ret void
}