xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void printUsageAndExit() {
  printf("Usage:\n"
         "  cproxy -l <local addr>:<local port>\n"
         "         [-l <local addr>:<local port>...]\n"
         "         -r <remote addr>:<remote port>\n"
         "         [-b <buf size>] [-n] [-t <num io threads>]\n"
         "Arguments:\n"
         "  -l <local addr>:<local port>: specify listen address and port\n"
         "  -r <remote addr>:<remote port>: specify remote address and port\n"
         "  -b <buf size>: specify session buffer size in bytes\n"
         "  -n: enable TCP no delay\n"
         "  -t: <num io threads>: specify number of I/O threads\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [456 x i8] c"Usage:\0A cproxy -l <local addr>:<local port>\0A [-l <local addr>:<local port>...]\0A -r <remote addr>:<remote port>\0A [-b <buf size>] [-n] [-t <num io threads>]\0AArguments:\0A -l <local addr>:<local port>: specify listen address and port\0A -r <remote addr>:<remote port>: specify remote address and port\0A -b <buf size>: specify session buffer size in bytes\0A -n: enable TCP no delay\0A -t: <num io threads>: specify number of I/O threads\0A\00"
define void @printUsageAndExit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([456 x i8], [456 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [455 x i8] c"Usage:\0A cproxy -l <local addr>:<local port>\0A [-l <local addr>:<local port>...]\0A -r <remote addr>:<remote port>\0A [-b <buf size>] [-n] [-t <num io threads>]\0AArguments:\0A -l <local addr>:<local port>: specify listen address and port\0A -r <remote addr>:<remote port>: specify remote address and port\0A -b <buf size>: specify session buffer size in bytes\0A -n: enable TCP no delay\0A -t: <num io threads>: specify number of I/O threads\00"
define void @printUsageAndExit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([455 x i8], [455 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ clear_scanf();
int /*<<< orphan*/ printf(char *);
int error_show(void) {
  clear_scanf();
  printf("\nError on input selection! Use only digits. Values must be >0. "
         "Please try again\n");
}


x86 assembly (clang, -O0):
<error_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clear_scanf@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_show>:
push   %rax
xor    %eax,%eax
call   1040 <clear_scanf@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [81 x i8] c"\0AError on input selection! Use only digits. Values must be >0. Please try again\0A\00"
define i32 @error_show() {
%1 = alloca i32
%2 = call i32 (...) @clear_scanf()
%3 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@str = [80 x i8] c"\0AError on input selection! Use only digits. Values must be >0. Please try again\00"
define i32 @error_show() {
%1 = tail call i32 (...) @clear_scanf()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int i;
  int MAX_INCLUSIVE = 100;
  for (i = 1; i <= MAX_INCLUSIVE; ++i) {
    if (i % 2 == 0) {
      printf("%d\n", i);
    }
  }
}


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)
movl   $0x64,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1176 <main+0x66>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1163 <main+0x53>
mov    -0x14(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x58>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    1138 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x65,%ebx
je     1149 <main+0x39>
test   $0x1,%bl
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %7
store i32 1, i32* %6
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %6
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %12
br label %20
20: ; preds = %19
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %8
23: ; preds = %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %9
%4 = phi i32 [ 1, %2 ], [ %10, %9 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
9: ; preds = %3, %7
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 101
br i1 %11, label %12, label %3
12: ; preds = %9
ret i32 0
}
int test_imm_69int16_mem(short *val) {
  return ((*val) & (0x69 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_69int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 105
%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_69int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 105
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long grib_op_le(long a, long b) { return a <= b; }


x86 assembly (clang, -O0):
<grib_op_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_le>:
xor    %eax,%eax
cmp    %rsi,%rdi
setle  %al
ret

LLVM IR (-O0):
define i64 @grib_op_le(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 sle i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @grib_op_le(i64 %0, i64 %1) {
%3 = icmp sle i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void foo() { exit(1); }


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

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

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int Main_Wrapper(int, char **);
int main(int argc, char *argv[]) { return Main_Wrapper(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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <Main_Wrapper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <Main_Wrapper@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @Main_Wrapper(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ abort_report(char *, ...);
scalar_t__ closedir(int /*<<< orphan*/ *);
void sdclose(DIR *dir) {
  if (closedir(dir) == EOF)
    (1 == 1) ? abort_report("Could not close directory", "")
             : abort_report("Could not close directory");
}


x86 assembly (clang, -O0):
<sdclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <closedir@plt>
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
jne    115a <sdclose+0x3a>
lea    0xeb4(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <abort_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdclose>:
push   %rax
call   1040 <closedir@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jne    1148 <sdclose+0x28>
lea    0xec7(%rip),%rdi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <abort_report@plt>
pop    %rax
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [26 x i8] c"Could not close directory\00"
@.str.1 = [1 x i8] zeroinitializer
define void @sdclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @closedir(i32* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [26 x i8] c"Could not close directory\00"
@.str.1 = [1 x i8] zeroinitializer
define void @sdclose(i32* nocapture %0) {
%2 = tail call i64 @closedir(i32* %0)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int fls(int);
__attribute__((always_)) int fls64(uint64_t x) {
  uint32_t h = x >> 32;
  if (h)
    return fls(h) + 32;
  return fls(x);
}


x86 assembly (clang, -O0):
<fls64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1145 <fls64+0x35>
mov    -0xc(%rbp),%edi
call   1030 <fls@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <fls64+0x40>
mov    -0x8(%rbp),%edi
call   1030 <fls@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls64>:
jmp    1030 <fls@plt>

LLVM IR (-O0):
define i32 @fls64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = call i32 @fls(i32 %10)
%12 = add nsw i32 %11, 32
store i32 %12, i32* %2
br label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = call i32 @fls(i32 %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @fls64(i32 %0) {
%2 = tail call i32 @fls(i32 %0)
ret i32 %2
}
/* Variables and functions */
int KEY_F(int);
int /*<<< orphan*/ create_window();
int /*<<< orphan*/ destroy_window();
int getch();
int main(void) {
  int input;
  create_window();
  while ((input = getch()) != KEY_F(5)) {
  }
  destroy_window();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create_window@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    $0x5,%edi
call   1040 <KEY_F@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
je     117f <main+0x3f>
jmp    1156 <main+0x16>
mov    $0x0,%al
call   1030 <destroy_window@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <create_window@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getch@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1040 <KEY_F@plt>
cmp    %eax,%ebx
jne    1150 <main+0x10>
xor    %eax,%eax
call   1030 <destroy_window@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @create_window()
br label %4
4: ; preds = %8, %0
%5 = call i32 (...) @getch()
store i32 %5, i32* %2
%6 = call i32 @KEY_F(i32 5)
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = call i32 (...) @destroy_window()
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @create_window()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @getch()
%4 = tail call i32 @KEY_F(i32 5)
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 (...) @destroy_window()
ret i32 0
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ examples_destroy(char const *);
void examples_destroy_NCC(const char *name, struct module **mod) {
  examples_destroy(name);
}


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

x86 assembly (clang, -O2):
<examples_destroy_NCC>:
jmp    1030 <examples_destroy@plt>

LLVM IR (-O0):
%struct.module = type { i32 }
define void @examples_destroy_NCC(i8* %0, %struct.module** %1) {
%3 = alloca i8*
%4 = alloca %struct.module**
store i8* %0, i8** %3
store %struct.module** %1, %struct.module*** %4
%5 = load i8*, i8** %3
%6 = call i32 @examples_destroy(i8* %5)
ret void
}

LLVM IR (-O2):
%struct.module = type { i32 }
define void @examples_destroy_NCC(i8* %0, %struct.module** nocapture readnone %1) {
%3 = tail call i32 @examples_destroy(i8* %0)
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Writestr(int, struct ship *, char const *);
void send_captain(struct ship *ship, const char *astr) {
  Writestr(1, ship, astr);
}


x86 assembly (clang, -O0):
<send_captain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <Writestr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_captain>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <Writestr@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_captain(%struct.ship* %0, i8* %1) {
%3 = alloca %struct.ship*
%4 = alloca i8*
store %struct.ship* %0, %struct.ship** %3
store i8* %1, i8** %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i8*, i8** %4
%7 = call i32 @Writestr(i32 1, %struct.ship* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_captain(%struct.ship* %0, i8* %1) {
%3 = tail call i32 @Writestr(i32 1, %struct.ship* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void jsCalendarHeader(void) {
  printf("<link rel='stylesheet' type='text/css' media='all' "
         "href='/js/calendar-blue.css'/>\n");
  printf("<script type='text/javascript' src='/js/calendar.js'></script>\n");
  printf("<script type='text/javascript' src='/js/calendar-en.js'></script>\n");
  printf(
      "<script type='text/javascript' src='/js/calendar-setup.js'></script>\n");
}


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

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

LLVM IR (-O0):
@.str = [83 x i8] c"<link rel='stylesheet' type='text/css' media='all' href='/js/calendar-blue.css'/>\0A\00"
@.str.1 = [64 x i8] c"<script type='text/javascript' src='/js/calendar.js'></script>\0A\00"
@.str.2 = [67 x i8] c"<script type='text/javascript' src='/js/calendar-en.js'></script>\0A\00"
@.str.3 = [70 x i8] c"<script type='text/javascript' src='/js/calendar-setup.js'></script>\0A\00"
define void @jsCalendarHeader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [82 x i8] c"<link rel='stylesheet' type='text/css' media='all' href='/js/calendar-blue.css'/>\00"
@str.4 = [63 x i8] c"<script type='text/javascript' src='/js/calendar.js'></script>\00"
@str.5 = [66 x i8] c"<script type='text/javascript' src='/js/calendar-en.js'></script>\00"
@str.6 = [69 x i8] c"<script type='text/javascript' src='/js/calendar-setup.js'></script>\00"
define void @jsCalendarHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_trace_sum_difference(int n, int *f, double *d) {
  int fail;
  fail = _ada_use_c2phc4c(57, &n, f, d, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_trace_sum_difference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x39,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_trace_sum_difference>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x39,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @standard_trace_sum_difference(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store double* %2, double** %6
%8 = load i32*, i32** %5
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc4c(i32 57, i32* %4, i32* %8, double* %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
define i32 @standard_trace_sum_difference(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 57, i32* %4, i32* %1, double* %2, i32 0)
ret i32 %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISFIFO(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int pjf_isfifo(const char *path) {
  struct stat stats;
  if (stat(path, &stats))
    return -1;
  if (S_ISFIFO(stats.st_mode))
    return 1;
  return -2;
}


x86 assembly (clang, -O0):
<pjf_isfifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <pjf_isfifo+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <pjf_isfifo+0x54>
mov    -0x18(%rbp),%edi
call   1030 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     116d <pjf_isfifo+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <pjf_isfifo+0x54>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pjf_isfifo>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <pjf_isfifo+0x18>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISFIFO@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0xfffffffe,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @pjf_isfifo(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISFIFO(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i32 -2, i32 1
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ errexit(int);
int getparam(char *, double *, int);
double getfreq(char *s) {
  double f;
  if (getparam(s, &f, 127) != 4)
    errexit(2);
  return f;
}


x86 assembly (clang, -O0):
<getfreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x7f,%edx
call   1030 <getparam@plt>
cmp    $0x4,%eax
je     1151 <getfreq+0x31>
mov    $0x2,%edi
call   1040 <errexit@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfreq>:
push   %rax
mov    %rsp,%rsi
mov    $0x7f,%edx
call   1030 <getparam@plt>
cmp    $0x4,%eax
je     113d <getfreq+0x1d>
mov    $0x2,%edi
call   1040 <errexit@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getfreq(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @getparam(i8* %4, double* %3, i32 127)
%6 = icmp ne i32 %5, 4
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @errexit(i32 2)
br label %9
9: ; preds = %7, %1
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @getfreq(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @getparam(i8* %0, double* %2, i32 127)
%5 = icmp eq i32 %4, 4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @errexit(i32 2)
br label %8
8: ; preds = %6, %1
%9 = load double, double* %2
ret double %9
}
void StartLog() {}


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

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

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

LLVM IR (-O2):
define void @StartLog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincbind(char *, char *, int);
void cginc1ib(void) { cgincbind("ax", "add", 1); }


x86 assembly (clang, -O0):
<cginc1ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x1,%edx
call   1030 <cgincbind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc1ib>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <cgincbind@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"add\00"
define void @cginc1ib() {
%1 = call i32 @cgincbind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"add\00"
define void @cginc1ib() {
%1 = tail call i32 @cgincbind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct current {
  int dummy;
};

/* Variables and functions */
int outputChars(struct current *, char *, int);
int newLine(struct current *current) { return outputChars(current, "\n", 1); }


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

x86 assembly (clang, -O2):
<newLine>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <outputChars@plt>

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

LLVM IR (-O2):
%struct.current = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @newLine(%struct.current* %0) {
%2 = tail call i32 @outputChars(%struct.current* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %2
}
int getSize(const struct list *list) { return 0; }


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

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

LLVM IR (-O0):
%struct.list = type opaque
define i32 @getSize(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
ret i32 0
}

LLVM IR (-O2):
%struct.list = type opaque
define i32 @getSize(%struct.list* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *serd_bufalloc(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @serd_bufalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ LINUX_REBOOT_CMD_RESTART2;
int /*<<< orphan*/ LINUX_REBOOT_MAGIC1;
int /*<<< orphan*/ LINUX_REBOOT_MAGIC2;
int /*<<< orphan*/ reboot(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, char *);
void main() {
  reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2,
         "recovery");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0xeca(%rip),%rcx
call   1030 <reboot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0xece(%rip),%rcx
jmp    1030 <reboot@plt>

LLVM IR (-O0):
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
@LINUX_REBOOT_CMD_RESTART2 = global i32 0
@.str = [9 x i8] c"recovery\00"
define void @main() {
%1 = load i32, i32* @LINUX_REBOOT_MAGIC1
%2 = load i32, i32* @LINUX_REBOOT_MAGIC2
%3 = load i32, i32* @LINUX_REBOOT_CMD_RESTART2
%4 = call i32 @reboot(i32 %1, i32 %2, i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
@LINUX_REBOOT_CMD_RESTART2 = global i32 0
@.str = [9 x i8] c"recovery\00"
define void @main() {
%1 = load i32, i32* @LINUX_REBOOT_MAGIC1
%2 = load i32, i32* @LINUX_REBOOT_MAGIC2
%3 = load i32, i32* @LINUX_REBOOT_CMD_RESTART2
%4 = tail call i32 @reboot(i32 %1, i32 %2, i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
int _close(int file) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (ptr >= arr && ptr < (arr + size)) {
    return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1145 <is_in_bound+0x45>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1145 <is_in_bound+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_in_bound+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
cmp    %rdi,%rdx
setae  %al
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
cmp    %rdx,%rcx
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp uge i32* %2, %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = icmp ugt i32* %6, %2
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
__attribute__((__weak__, __always___)) void
__softboundmpx_shrink_bounds(void *new_base, void *new_bound, void *old_base,
                             void *old_bound, void **base_alloca,
                             void **bound_alloca) {
  *(base_alloca) = new_base < old_base ? old_base : new_base;
  *(bound_alloca) = new_bound > old_bound ? old_bound : new_bound;
}


x86 assembly (clang, -O0):
<__softboundmpx_shrink_bounds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1137 <__softboundmpx_shrink_bounds+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    113f <__softboundmpx_shrink_bounds+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1165 <__softboundmpx_shrink_bounds+0x65>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    116d <__softboundmpx_shrink_bounds+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundmpx_shrink_bounds>:
cmp    %rdx,%rdi
cmovb  %rdx,%rdi
mov    %rdi,(%r8)
cmp    %rcx,%rsi
cmova  %rcx,%rsi
mov    %rsi,(%r9)
ret

LLVM IR (-O0):
define weak void @__softboundmpx_shrink_bounds(i8* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8**
%12 = alloca i8**
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %9
%15 = icmp ult i8* %13, %14
br i1 %15, label %16, label %18
16: ; preds = %6
%17 = load i8*, i8** %9
br label %20
18: ; preds = %6
%19 = load i8*, i8** %7
br label %20
20: ; preds = %18, %16
%21 = phi i8* [ %17, %16 ], [ %19, %18 ]
%22 = load i8**, i8*** %11
store i8* %21, i8** %22
%23 = load i8*, i8** %8
%24 = load i8*, i8** %10
%25 = icmp ugt i8* %23, %24
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = load i8*, i8** %10
br label %30
28: ; preds = %20
%29 = load i8*, i8** %8
br label %30
30: ; preds = %28, %26
%31 = phi i8* [ %27, %26 ], [ %29, %28 ]
%32 = load i8**, i8*** %12
store i8* %31, i8** %32
ret void
}

LLVM IR (-O2):
define weak void @__softboundmpx_shrink_bounds(i8* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5) {
%7 = icmp ult i8* %0, %2
%8 = select i1 %7, i8* %2, i8* %0
store i8* %8, i8** %4
%9 = icmp ugt i8* %1, %3
%10 = select i1 %9, i8* %3, i8* %1
store i8* %10, i8** %5
ret void
}
void console_cursorBackward(int count) {}


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

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

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

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


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__ESBMC_assume@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
xor    %edi,%edi
call   1030 <__ESBMC_assume@plt>

LLVM IR (-O0):
define void @abort() {
%1 = call i32 @__ESBMC_assume(i32 0)
unreachable
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 @__ESBMC_assume(i32 0)
unreachable
}
int bar(int *a) {
  *(a + 0) = 9;
  *(a + 1) = 8;
  *(a + 2) = 7;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x8,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x7,0x8(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movabs $0x800000009,%rax
mov    %rax,(%rdi)
movl   $0x7,0x8(%rdi)
ret

LLVM IR (-O0):
define i32 @bar(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 9, i32* %5
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 8, i32* %7
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 7, i32* %9
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @bar(i32* nocapture writeonly %0) {
store i32 9, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 8, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 2
store i32 7, i32* %3
ret i32 undef
}
/* Type definitions */
struct lnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eval(struct lnode *);
struct lnode *lread();
compile_stdin() {
  register struct lnode *lp;
  while ((lp = lread()) != ((struct lnode *)0))
    eval(lp);
  return (1);
}


x86 assembly (clang, -O0):
<compile_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lread@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     114b <compile_stdin+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <eval@plt>
jmp    1128 <compile_stdin+0x8>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compile_stdin>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <lread@plt>
test   %rax,%rax
je     1146 <compile_stdin+0x26>
mov    %rax,%rdi
call   1040 <eval@plt>
jmp    1130 <compile_stdin+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.lnode = type { i32 }
define i32 @compile_stdin() {
%1 = alloca %struct.lnode*
br label %2
2: ; preds = %5, %0
%3 = call %struct.lnode* (...) @lread()
store %struct.lnode* %3, %struct.lnode** %1
%4 = icmp ne %struct.lnode* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load %struct.lnode*, %struct.lnode** %1
%7 = call i32 @eval(%struct.lnode* %6)
br label %2
8: ; preds = %2
ret i32 1
}

LLVM IR (-O2):
%struct.lnode = type { i32 }
define i32 @compile_stdin() {
%1 = tail call %struct.lnode* (...) @lread()
%2 = icmp eq %struct.lnode* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi %struct.lnode* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @eval(%struct.lnode* %4)
%6 = tail call %struct.lnode* (...) @lread()
%7 = icmp eq %struct.lnode* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 1
}
unsigned int beword32(const unsigned char *c) {
  return c[0] * 16777216 + c[1] * 65536 + c[2] * 256 + c[3];
}


x86 assembly (clang, -O0):
<beword32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<beword32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @beword32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 16777216
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 65536
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = mul nsw i32 %17, 256
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @beword32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
unsigned _ctz(unsigned x) { return __builtin_ctz(x); }


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

x86 assembly (clang, -O2):
<_ctz>:
bsf    %edi,%eax
ret

LLVM IR (-O0):
define i32 @_ctz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @_ctz(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int towupper(int);
int iswlower(wint_t wc) { return towupper(wc) != wc || wc == 0xdf; }


x86 assembly (clang, -O0):
<iswlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <towupper@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jne    1140 <iswlower+0x30>
cmpl   $0xdf,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswlower>:
push   %rbx
mov    %edi,%ebx
call   1030 <towupper@plt>
cmp    %ebx,%eax
setne  %al
cmp    $0xdf,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iswlower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @towupper(i32 %3)
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 223
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ true, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @iswlower(i32 %0) {
%2 = tail call i32 @towupper(i32 %0)
%3 = icmp ne i32 %2, %0
%4 = icmp eq i32 %0, 223
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void test_29_0(char *mem) { __atomic_fetch_and(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_29_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_29_0+0x4a>
jmp    111f <test_29_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_29_0>:
lock andb $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_29_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw and i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_29_0(i8* nocapture %0) {
%2 = atomicrmw and i8* %0, i8 1 acq_rel
ret void
}
double wf5(double D_AD, double D_BC, double D_AC, double D_BD, double D_AB,
           double D_CD) {
  double weight;
  weight = 0.25 * (D_AC + D_BD + D_AD + D_BC) + 0.5 * (D_AB + D_CD);
  return (weight);
}


x86 assembly (clang, -O0):
<wf5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
movsd  0xec0(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xeac(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf5>:
addsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm5,%xmm4
mulsd  0xeec(%rip),%xmm4
addsd  %xmm1,%xmm0
mulsd  0xee8(%rip),%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @wf5(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %9
%15 = load double, double* %10
%16 = fadd double %14, %15
%17 = load double, double* %7
%18 = fadd double %16, %17
%19 = load double, double* %8
%20 = fadd double %18, %19
%21 = load double, double* %11
%22 = load double, double* %12
%23 = fadd double %21, %22
%24 = fmul double 5.000000e-01, %23
%25 = call double @llvm.fmuladd.f64(double 2.500000e-01, double %20, double %24)
store double %25, double* %13
%26 = load double, double* %13
ret double %26
}

LLVM IR (-O2):
define double @wf5(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fadd double %2, %3
%8 = fadd double %7, %0
%9 = fadd double %8, %1
%10 = fadd double %4, %5
%11 = fmul double %10, 5.000000e-01
%12 = tail call double @llvm.fmuladd.f64(double %9, double 2.500000e-01, double %11)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_clk_low() {
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_clk_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_clk_low>:
push   %rax
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_clk_low() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 49697)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_clk_low() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 49697)
%6 = tail call i32 @delay(i32 100)
ret void
}