xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, void *);
void up_and_down(int n) {
  printf("Level %d: n location %p\n", n, (void *)&n);
  if (n < 4)
    up_and_down(n + 1);
  printf("LEVEL %d: n location %p\n", n, (void *)&n);
}


x86 assembly (clang, -O0):
<up_and_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x4(%rbp),%rdx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x4,-0x4(%rbp)
jge    1153 <up_and_down+0x33>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <up_and_down@plt>
mov    -0x4(%rbp),%esi
lea    -0x4(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<up_and_down>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rdx
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
cmp    $0x3,%esi
jg     114f <up_and_down+0x2f>
add    $0x1,%esi
mov    %esi,%edi
call   1040 <up_and_down@plt>
mov    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rdx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Level %d: n location %p\0A\00"
@.str.1 = [25 x i8] c"LEVEL %d: n location %p\0A\00"
define void @up_and_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = bitcast i32* %2 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %2
%13 = bitcast i32* %2 to i8*
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Level %d: n location %p\0A\00"
@.str.1 = [25 x i8] c"LEVEL %d: n location %p\0A\00"
define void @up_and_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = add nsw i32 %5, 1
%9 = load i32, i32* %2
br label %10
10: ; preds = %7, %1
%11 = phi i32 [ %9, %7 ], [ %5, %1 ]
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8* %3)
ret void
}
/* Variables and functions */
void *mallocSafe(size_t, char *);
void *callocSafe(size_t nEl, size_t size, char *msg) {
  return mallocSafe(nEl * size, msg);
}


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

x86 assembly (clang, -O2):
<callocSafe>:
imul   %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <mallocSafe@plt>

LLVM IR (-O0):
define i8* @callocSafe(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul i64 %7, %8
%10 = load i8*, i8** %6
%11 = call i8* @mallocSafe(i64 %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @callocSafe(i64 %0, i64 %1, i8* %2) {
%4 = mul i64 %1, %0
%5 = tail call i8* @mallocSafe(i64 %4, i8* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ halmosMain(int, char **);
int main(int argc, char *argv[]) {
  halmosMain(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @halmosMain(i32 %0, i8** %1)
ret i32 0
}
int main(void) {
  int s = -1;
  1 << s;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_01uint16_mem(unsigned short *val) {
  return ((*val) & (0x01 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_01uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 1
%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_01uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 1
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(void) { exit(2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <exit@plt>

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
scalar_t__ StringIsAllUpper(char *);
int /*<<< orphan*/ StringToLowerDestructive(char *);
StringAllUpperToUL(char *s) {
  if (StringIsAllUpper(s)) {
    StringToLowerDestructive(s + 1);
  }
}


x86 assembly (clang, -O0):
<StringAllUpperToUL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <StringIsAllUpper@plt>
cmp    $0x0,%rax
je     114c <StringAllUpperToUL+0x2c>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <StringToLowerDestructive@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringAllUpperToUL>:
push   %rbx
mov    %rdi,%rbx
call   1030 <StringIsAllUpper@plt>
test   %rax,%rax
je     113a <StringAllUpperToUL+0x1a>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <StringToLowerDestructive@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @StringAllUpperToUL(i8* %0) {
%2 = tail call i64 @StringIsAllUpper(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @StringToLowerDestructive(i8* %5)
br label %7
7: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ get_mem_attrs();
void __attribute__((always_)) set_mem_alias_set() { get_mem_attrs(); }


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

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

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

LLVM IR (-O2):
define void @set_mem_alias_set() {
%1 = tail call i32 (...) @get_mem_attrs()
ret void
}
struct node * xor (struct node * a, struct node *b) {
  return (struct node *)((unsigned int)a ^ (unsigned int)b);
}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @xor(%struct.node* %0, %struct.node* %1) {
%3 = alloca %struct.node*
%4 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
store %struct.node* %1, %struct.node** %4
%5 = load %struct.node*, %struct.node** %3
%6 = ptrtoint %struct.node* %5 to i32
%7 = load %struct.node*, %struct.node** %4
%8 = ptrtoint %struct.node* %7 to i32
%9 = xor i32 %6, %8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.node*
ret %struct.node* %11
}

LLVM IR (-O2):
%struct.node = type opaque
define %struct.node* @xor(%struct.node* %0, %struct.node* %1) {
%3 = ptrtoint %struct.node* %0 to i64
%4 = ptrtoint %struct.node* %1 to i64
%5 = xor i64 %4, %3
%6 = and i64 %5, 4294967295
%7 = inttoptr i64 %6 to %struct.node*
ret %struct.node* %7
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD=debug TARGET_PLATFORM=sc8830 MALI_PLATFORM=sc8830 "
         "KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= "
         "USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [317 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD=debug TARGET_PLATFORM=sc8830 MALI_PLATFORM=sc8830 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [317 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD=debug TARGET_PLATFORM=sc8830 MALI_PLATFORM=sc8830 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str, i64 0, i64 0)
}
void ExttMailServerAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttMailServerAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n, triangularNumber;
  triangularNumber = 0;
  n = 1;
  while (n++ <= 200)
    triangularNumber = triangularNumber + n;
  printf("The 200th triangular number is %i\n", triangularNumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0xc8,%eax
jg     1151 <main+0x41>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = icmp sle i32 %5, 200
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 20300)
ret i32 0
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ mpush(int);
int /*<<< orphan*/ quit(int /*<<< orphan*/);
void key() {
  int c = getchar();
  if (c < 0)
    quit(0);
  if (c == '\n')
    c = '\r';
  if (c == 0x7f)
    c = 0x8;
  mpush(c);
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1153 <key+0x23>
xor    %edi,%edi
call   1030 <quit@plt>
cmpl   $0xa,-0x4(%rbp)
jne    1164 <key+0x34>
movl   $0xd,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
jne    1175 <key+0x45>
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <mpush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1145 <key+0x15>
xor    %edi,%edi
call   1030 <quit@plt>
cmp    $0xa,%ebx
mov    $0xd,%eax
cmovne %ebx,%eax
cmp    $0x7f,%eax
mov    $0x8,%edi
cmovne %eax,%edi
pop    %rbx
jmp    1050 <mpush@plt>

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

LLVM IR (-O2):
define void @key() {
%1 = tail call i32 (...) @getchar()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @quit(i32 0)
br label %5
5: ; preds = %3, %0
%6 = icmp eq i32 %1, 10
%7 = select i1 %6, i32 13, i32 %1
%8 = icmp eq i32 %7, 127
%9 = select i1 %8, i32 8, i32 %7
%10 = tail call i32 @mpush(i32 %9)
ret void
}
int f(int a, int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct Stream {
  int dummy;
};
struct Buffer {
  int dummy;
};

/* Variables and functions */
int buffer_put(struct Buffer *, void const *, size_t);
int /*<<< orphan*/ set_error(struct Stream *, char *);
int store(struct Buffer *dest, const void *src, size_t n, struct Stream *str) {
  int r;
  if ((r = buffer_put(dest, src, n)) != 0)
    set_error(str, "Insufficient capacity of encoded bytes'"
                   " accumulator");
  return r;
}


x86 assembly (clang, -O0):
<store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <buffer_put@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1165 <store+0x45>
mov    -0x20(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1040 <set_error@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
call   1030 <buffer_put@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1140 <store+0x20>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <set_error@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.Buffer = type { i32 }
%struct.Stream = type { i32 }
@.str = [52 x i8] c"Insufficient capacity of encoded bytes' accumulator\00"
define i32 @store(%struct.Buffer* %0, i8* %1, i64 %2, %struct.Stream* %3) {
%5 = alloca %struct.Buffer*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.Stream*
%9 = alloca i32
store %struct.Buffer* %0, %struct.Buffer** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.Stream* %3, %struct.Stream** %8
%10 = load %struct.Buffer*, %struct.Buffer** %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = call i32 @buffer_put(%struct.Buffer* %10, i8* %11, i64 %12)
store i32 %13, i32* %9
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %4
%16 = load %struct.Stream*, %struct.Stream** %8
%17 = call i32 @set_error(%struct.Stream* %16, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %4
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
%struct.Buffer = type { i32 }
%struct.Stream = type { i32 }
@.str = [52 x i8] c"Insufficient capacity of encoded bytes' accumulator\00"
define i32 @store(%struct.Buffer* %0, i8* %1, i64 %2, %struct.Stream* %3) {
%5 = tail call i32 @buffer_put(%struct.Buffer* %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @set_error(%struct.Stream* %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int jpc_firstone(int x) {
  int n;
  assert(x >= 0);
  n = -1;
  while (x > 0) {
    x >>= 1;
    ++n;
  }
  return n;
}


x86 assembly (clang, -O0):
<jpc_firstone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1154 <jpc_firstone+0x44>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <jpc_firstone+0x23>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jpc_firstone>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
test   %ebx,%ebx
jle    113c <jpc_firstone+0x2c>
mov    %ebx,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%ebx
mov    %ecx,%ebx
ja     1130 <jpc_firstone+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @jpc_firstone(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ -1, %1 ]
%8 = phi i32 [ %9, %6 ], [ %0, %1 ]
%9 = lshr i32 %8, 1
%10 = add nsw i32 %7, 1
%11 = icmp ult i32 %8, 2
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %10, %6 ]
ret i32 %13
}
void halt() { __asm__("hlt"); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned int getMax(unsigned int a, unsigned int b) { return (a > b) ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @getMax(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void _sbus_writeb(unsigned char val, unsigned long addr) {
  *(volatile unsigned char *)addr = val;
}


x86 assembly (clang, -O0):
<_sbus_writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sbus_writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @_sbus_writeb(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = load i64, i64* %4
%7 = inttoptr i64 %6 to i8*
store volatile i8 %5, i8* %7
ret void
}

LLVM IR (-O2):
define void @_sbus_writeb(i8 zeroext %0, i64 %1) {
%3 = inttoptr i64 %1 to i8*
store volatile i8 %0, i8* %3
ret void
}
double tan(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @tan(double returned %0) {
ret double %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ GetTimeStampInMs();
int64_t GetTimeStamp() { return GetTimeStampInMs(); }


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

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

LLVM IR (-O0):
define i32 @GetTimeStamp() {
%1 = call i32 (...) @GetTimeStampInMs()
ret i32 %1
}

LLVM IR (-O2):
define i32 @GetTimeStamp() {
%1 = tail call i32 (...) @GetTimeStampInMs()
ret i32 %1
}
void _set_bit(volatile void *addr, unsigned long nr) {
  __asm__ __volatile__("bts %1,%0"
                       : "+m"(*(unsigned long *)addr)
                       : "Ir"(nr)
                       : "memory");
}


x86 assembly (clang, -O0):
<_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
bts    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_bit>:
bts    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @_set_bit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @_set_bit(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
tail call void asm sideeffect "bts $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1, i64* elementtype(i64) %3)
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int readRegister(int, int);
int16_t readZ(int file) {
  int16_t result = 0;
  result =
      readRegister(file, (0x32) + 4) | (readRegister(file, (0x32) + 5) << 8);
  return result;
}


x86 assembly (clang, -O0):
<readZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x36,%esi
call   1030 <readRegister@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x37,%esi
call   1030 <readRegister@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readZ>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x36,%esi
call   1030 <readRegister@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x37,%esi
call   1030 <readRegister@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readZ(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @readRegister(i32 %4, i32 54)
%6 = load i32, i32* %2
%7 = call i32 @readRegister(i32 %6, i32 55)
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @readZ(i32 %0) {
%2 = tail call i32 @readRegister(i32 %0, i32 54)
%3 = tail call i32 @readRegister(i32 %0, i32 55)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ tests();
int main() {
  tests();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tests()
ret i32 0
}
char *langRomTypeFmdas() { return "F&M Direct Assembler System"; }


x86 assembly (clang, -O0):
<langRomTypeFmdas>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeFmdas>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"F&M Direct Assembler System\00"
define i8* @langRomTypeFmdas() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [28 x i8] c"F&M Direct Assembler System\00"
define i8* @langRomTypeFmdas() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_final_vermont_workflow();
main(void) {
  test_final_vermont_workflow();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_final_vermont_workflow()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void stlreq_wrap_dlclose(void *obj) { dlclose(obj); }


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

x86 assembly (clang, -O2):
<stlreq_wrap_dlclose>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @stlreq_wrap_dlclose(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Dget_type(void *dataset_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Tclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Dget_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Dget_type>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Tclose\00"
define i8* @H5Dget_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @__coverity_alloc__(i32 10)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @__coverity_mark_as_afm_allocated__(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Tclose\00"
define i8* @H5Dget_type(i8* nocapture readnone %0) {
%2 = tail call i8* @__coverity_alloc__(i32 10)
%3 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void Dijikstra(int graph[9][9], int *distance_to, int *edge_to, int source_v) {
  memset(distance_to, 0, sizeof(int) * 9);
  memset(edge_to, 0, sizeof(int) * 9);
}


x86 assembly (clang, -O0):
<Dijikstra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dijikstra>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x24,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @Dijikstra([9 x i32]* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca [9 x i32]*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store [9 x i32]* %0, [9 x i32]** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %6
%10 = call i32 @memset(i32* %9, i32 0, i32 36)
%11 = load i32*, i32** %7
%12 = call i32 @memset(i32* %11, i32 0, i32 36)
ret void
}

LLVM IR (-O2):
define void @Dijikstra([9 x i32]* nocapture readnone %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32 @memset(i32* %1, i32 0, i32 36)
%6 = tail call i32 @memset(i32* %2, i32 0, i32 36)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ W_OK;
int access(char const *, int /*<<< orphan*/);
int strfile_writeable(const char *str) { return access(str, W_OK); }


x86 assembly (clang, -O0):
<strfile_writeable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfile_writeable>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <access@plt>

LLVM IR (-O0):
@W_OK = global i32 0
define i32 @strfile_writeable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @W_OK
%5 = call i32 @access(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@W_OK = global i32 0
define i32 @strfile_writeable(i8* nocapture %0) {
%2 = load i32, i32* @W_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ pr_BDS_30(int /*<<< orphan*/ *, void *, int);
void pr_VDS(FILE *fp, uint8_t vds, void *aux, int v) {
  fprintf(fp, "VDS:%02X\n", vds);
  if (vds == 0x30)
    pr_BDS_30(fp, aux, v);
}


x86 assembly (clang, -O0):
<pr_VDS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x30,-0xc(%rbp)
jne    1163 <pr_VDS+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <pr_BDS_30@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_VDS>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebx
mov    %rdi,%rbp
lea    0xec7(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
cmp    $0x30,%ebx
jne    115d <pr_VDS+0x3d>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <pr_BDS_30@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"VDS:%02X\0A\00"
define void @pr_VDS(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 48
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load i32*, i32** %5
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @pr_BDS_30(i32* %15, i8* %16, i32 %17)
br label %19
19: ; preds = %14, %4
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"VDS:%02X\0A\00"
define void @pr_VDS(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = icmp eq i32 %1, 48
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @pr_BDS_30(i32* %0, i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ putc(unsigned short, int /*<<< orphan*/ *);
int writeshort(FILE *f, unsigned short s) {
  putc(s, f);
  return putc(s >> 8, f) != EOF;
}


x86 assembly (clang, -O0):
<writeshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeshort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    0x2eb1(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @writeshort(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i32*, i32** %3
%7 = call i64 @putc(i16 zeroext %5, i32* %6)
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i16
%12 = load i32*, i32** %3
%13 = call i64 @putc(i16 zeroext %11, i32* %12)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @writeshort(i32* nocapture %0, i16 zeroext %1) {
%3 = tail call i64 @putc(i16 zeroext %1, i32* %0)
%4 = lshr i16 %1, 8
%5 = tail call i64 @putc(i16 zeroext %4, i32* %0)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int check_evaluate(char a[]) {
  int i = 0;
  for (i = 0; a[i] != '\0'; i++) {
    if (a[i] == '\'')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_evaluate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <check_evaluate+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
jne    114c <check_evaluate+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1166 <check_evaluate+0x66>
jmp    1151 <check_evaluate+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <check_evaluate+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_evaluate>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <check_evaluate+0x11>
cmp    $0x27,%al
je     1114 <check_evaluate+0x14>
add    $0x1,%rdi
jmp    1100 <check_evaluate>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_evaluate(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %9
i8 39, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input, output;
  scanf("%d", &input);
  output = input * input;
  printf("%d\n", output);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int dd_to_int(const double *a) { return ((int)a[0]); }


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

x86 assembly (clang, -O2):
<dd_to_int>:
cvttsd2si (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @dd_to_int(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @dd_to_int(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
ret i32 %3
}
int is_in_bound(int *arr, int size, int *ptr) {
  int i = 0;
  while (i != size) {
    if (&arr[i] == ptr) {
      return 1;
    }
    i++;
  }
  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)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1155 <is_in_bound+0x55>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
jne    1147 <is_in_bound+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115c <is_in_bound+0x5c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <is_in_bound+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
xor    %eax,%eax
test   %esi,%esi
je     111f <is_in_bound+0x1f>
mov    %esi,%ecx
add    $0xfffffffffffffffc,%rdi
nopl   0x0(%rax)
add    $0x4,%rdi
cmp    %rdx,%rdi
je     1120 <is_in_bound+0x20>
add    $0xffffffffffffffff,%rcx
jne    1110 <is_in_bound+0x10>
ret
mov    $0x1,%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*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 0, i32* %8
br label %9
9: ; preds = %21, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32*, i32** %7
%19 = icmp eq i32* %17, %18
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 1, i32* %4
br label %25
21: ; preds = %13
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
br label %9
24: ; preds = %9
store i32 0, i32* %4
br label %25
25: ; preds = %24, %20
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %13, %6
br i1 %8, label %14, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %13, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = icmp eq i32* %11, %2
%13 = add nuw nsw i64 %10, 1
br i1 %12, label %14, label %7
14: ; preds = %9, %7, %3
%15 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ nrf24_ce_digitalWrite(int /*<<< orphan*/);
int /*<<< orphan*/ nrf24_configRegister(int, int);
void nrf24_powerDown() {
  nrf24_ce_digitalWrite(0);
  nrf24_configRegister(0x00, ((1 << 3) | (0 << 2)));
}


x86 assembly (clang, -O0):
<nrf24_powerDown>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <nrf24_ce_digitalWrite@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1030 <nrf24_configRegister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf24_powerDown>:
push   %rax
xor    %edi,%edi
call   1040 <nrf24_ce_digitalWrite@plt>
xor    %edi,%edi
mov    $0x8,%esi
pop    %rax
jmp    1030 <nrf24_configRegister@plt>

LLVM IR (-O0):
define void @nrf24_powerDown() {
%1 = call i32 @nrf24_ce_digitalWrite(i32 0)
%2 = call i32 @nrf24_configRegister(i32 0, i32 8)
ret void
}

LLVM IR (-O2):
define void @nrf24_powerDown() {
%1 = tail call i32 @nrf24_ce_digitalWrite(i32 0)
%2 = tail call i32 @nrf24_configRegister(i32 0, i32 8)
ret void
}
/* Variables and functions */
int isnan(float);
bool isUndefined(float value) { return isnan(value); }


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

x86 assembly (clang, -O2):
<isUndefined>:
jmp    1030 <isnan@plt>

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

LLVM IR (-O2):
define i32 @isUndefined(float %0) {
%2 = tail call i32 @isnan(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ printf(char *, long);
long sysconf(int /*<<< orphan*/);
int main() {
  long sz = sysconf(_SC_PAGESIZE);
  printf("Page size %ld\n", sz);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@.str = [15 x i8] c"Page size %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = load i32, i32* @_SC_PAGESIZE
%4 = call i64 @sysconf(i32 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@.str = [15 x i8] c"Page size %ld\0A\00"
define i32 @main() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i64 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}