xunge/DecIR huggingface dataset:
int cfunc() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cfunc() {
ret i32 0
}
/* Variables and functions */
#define SIGINT 129
#define SIGTERM 128
int /*<<< orphan*/ destroy_graphics();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_handler(int sig) {
  switch (sig) {
  case SIGINT:
  case SIGTERM:
    destroy_graphics();
    break;
  default:
    return;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     114b <sig_handler+0x2b>
jmp    113f <sig_handler+0x1f>
mov    $0x0,%al
call   1030 <destroy_graphics@plt>
jmp    1151 <sig_handler+0x31>
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
and    $0xfffffffe,%edi
cmp    $0x80,%edi
je     112c <sig_handler+0xc>
ret
push   %rax
xor    %eax,%eax
call   1030 <destroy_graphics@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 129, label %4
i32 128, label %4
]
4: ; preds = %1, %1
%5 = call i32 (...) @destroy_graphics()
br label %7
6: ; preds = %1
ret void
7: ; preds = %4
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 128
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @destroy_graphics()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adjustParallel();
int /*<<< orphan*/ adjustSide();
int /*<<< orphan*/ calcP();
int /*<<< orphan*/ checkWallAhead();
int /*<<< orphan*/ connect_to_robot();
int /*<<< orphan*/ initialize_robot();
int /*<<< orphan*/ lookForEnd();
int /*<<< orphan*/ lookForFront();
int /*<<< orphan*/ setSensors();
int /*<<< orphan*/ straight();
int main() {
  connect_to_robot();
  initialize_robot();
  setSensors();
  while (1) {
    adjustParallel();
    lookForFront();
    lookForEnd();
    straight();
    adjustSide();
    checkWallAhead();
    calcP();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <connect_to_robot@plt>
mov    $0x0,%al
call   10a0 <initialize_robot@plt>
mov    $0x0,%al
call   1060 <setSensors@plt>
mov    $0x0,%al
call   1080 <adjustParallel@plt>
mov    $0x0,%al
call   1040 <lookForFront@plt>
mov    $0x0,%al
call   1030 <lookForEnd@plt>
mov    $0x0,%al
call   1050 <straight@plt>
mov    $0x0,%al
call   10b0 <adjustSide@plt>
mov    $0x0,%al
call   1070 <checkWallAhead@plt>
mov    $0x0,%al
call   10c0 <calcP@plt>
jmp    11c4 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <connect_to_robot@plt>
xor    %eax,%eax
call   10a0 <initialize_robot@plt>
xor    %eax,%eax
call   1060 <setSensors@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <adjustParallel@plt>
xor    %eax,%eax
call   1040 <lookForFront@plt>
xor    %eax,%eax
call   1030 <lookForEnd@plt>
xor    %eax,%eax
call   1050 <straight@plt>
xor    %eax,%eax
call   10b0 <adjustSide@plt>
xor    %eax,%eax
call   1070 <checkWallAhead@plt>
xor    %eax,%eax
call   10c0 <calcP@plt>
jmp    11c0 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @connect_to_robot()
%3 = call i32 (...) @initialize_robot()
%4 = call i32 (...) @setSensors()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @adjustParallel()
%7 = call i32 (...) @lookForFront()
%8 = call i32 (...) @lookForEnd()
%9 = call i32 (...) @straight()
%10 = call i32 (...) @adjustSide()
%11 = call i32 (...) @checkWallAhead()
%12 = call i32 (...) @calcP()
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @connect_to_robot()
%2 = tail call i32 (...) @initialize_robot()
%3 = tail call i32 (...) @setSensors()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @adjustParallel()
%6 = tail call i32 (...) @lookForFront()
%7 = tail call i32 (...) @lookForEnd()
%8 = tail call i32 (...) @straight()
%9 = tail call i32 (...) @adjustSide()
%10 = tail call i32 (...) @checkWallAhead()
%11 = tail call i32 (...) @calcP()
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xf7() {
  Assert_real((isupper(247) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1240, ("isupper should be 0 for 0xf7"));
}


x86 assembly (clang, -O0):
<t_isupper_0xf7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf7,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4d8,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf7\00"
define void @t_isupper_0xf7() {
%1 = call i64 @isupper(i32 247)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf7\00"
define void @t_isupper_0xf7() {
%1 = tail call i64 @isupper(i32 247)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int worldXDim(void) { return (int)10; }


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

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

LLVM IR (-O0):
define i32 @worldXDim() {
ret i32 10
}

LLVM IR (-O2):
define i32 @worldXDim() {
ret i32 10
}
int GetBitfieldBit(char *bitfield, unsigned long index) {
  char temp;
  unsigned byte;
  int bit;
  byte = (unsigned)(index / 8);
  bit = (unsigned)(index % 8);
  temp = bitfield[byte];
  return (temp >> bit) & 1;
}


x86 assembly (clang, -O0):
<GetBitfieldBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x3,%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBitfieldBit>:
mov    %rsi,%rcx
mov    %rsi,%rax
shr    $0x3,%rax
mov    %eax,%eax
movsbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GetBitfieldBit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
%9 = udiv i64 %8, 8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i64, i64* %4
%12 = urem i64 %11, 8
%13 = trunc i64 %12 to i32
store i32 %13, i32* %7
%14 = load i8*, i8** %3
%15 = load i32, i32* %6
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %5
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = load i32, i32* %7
%22 = ashr i32 %20, %21
%23 = and i32 %22, 1
ret i32 %23
}

LLVM IR (-O2):
define i32 @GetBitfieldBit(i8* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 3
%4 = trunc i64 %1 to i32
%5 = and i32 %4, 7
%6 = and i64 %3, 4294967295
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = lshr i32 %9, %5
%11 = and i32 %10, 1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  assert(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_play_sample_with_proplist() {
  printf("NOT IMPLEMENTED:"
         "pa_context_play_sample_with_proplist"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"NOT IMPLEMENTED:pa_context_play_sample_with_proplist\0A\00"
define i32 @pa_context_play_sample_with_proplist() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [53 x i8] c"NOT IMPLEMENTED:pa_context_play_sample_with_proplist\00"
define i32 @pa_context_play_sample_with_proplist() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct list_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_delete(struct list_item *);
void hash_delete(struct list_item *item) { list_delete(item); }


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

x86 assembly (clang, -O2):
<hash_delete>:
jmp    1030 <list_delete@plt>

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

LLVM IR (-O2):
%struct.list_item = type { i32 }
define void @hash_delete(%struct.list_item* %0) {
%2 = tail call i32 @list_delete(%struct.list_item* %0)
ret void
}
/* Variables and functions */
long abs(long const);
int is_timediff_in_range(const long timestamp1, const long timestamp2,
                         const int delta) {
  long timediff = abs(timestamp1 - timestamp2);
  return delta <= timediff;
}


x86 assembly (clang, -O0):
<is_timediff_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
sub    -0x10(%rbp),%rdi
call   1030 <abs@plt>
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x20(%rbp),%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_timediff_in_range>:
sub    %rsi,%rdi
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
movslq %edx,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
setge  %al
ret

LLVM IR (-O0):
define i32 @is_timediff_in_range(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = sub nsw i64 %8, %9
%11 = call i64 @abs(i64 %10)
store i64 %11, i64* %7
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = load i64, i64* %7
%15 = icmp sle i64 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_timediff_in_range(i64 %0, i64 %1, i32 %2) {
%4 = sub nsw i64 %0, %1
%5 = tail call i64 @llvm.abs.i64(i64 %4, i1 true)
%6 = sext i32 %2 to i64
%7 = icmp sge i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int baz(void) {
  printf("%s:%s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/"
         "ARMToolChain/source/glibc-2.21/elf/tst-deep1mod3.c",
         __func__);
  return back();
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xf80(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <back@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xf83(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <back@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/ARMToolChain/source/glibc-2.21/elf/tst-deep1mod3.c\00"
@__func__.baz = [4 x i8] c"baz\00"
define i32 @baz() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.baz, i64 0, i64 0))
%2 = call i32 (...) @back()
ret i32 %2
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/ARMToolChain/source/glibc-2.21/elf/tst-deep1mod3.c\00"
@__func__.baz = [4 x i8] c"baz\00"
define i32 @baz() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.baz, i64 0, i64 0))
%2 = tail call i32 (...) @back()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fdasd_menu(void) {
  printf("Command action\n"
         "   m   print this menu\n"
         "   p   print the partition table\n"
         "   n   add a new partition\n"
         "   d   delete a partition\n"
         "   v   change volume serial\n"
         "   t   change partition type\n"
         "   r   re-create VTOC and delete all partitions\n"
         "   u   re-create VTOC re-using existing partition sizes\n"
         "   s   show mapping (partition number - data set name)\n"
         "   q   quit without saving changes\n"
         "   w   write table to disk and exit\n");
}


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

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

LLVM IR (-O0):
@.str = [412 x i8] c"Command action\0A m print this menu\0A p print the partition table\0A n add a new partition\0A d delete a partition\0A v change volume serial\0A t change partition type\0A r re-create VTOC and delete all partitions\0A u re-create VTOC re-using existing partition sizes\0A s show mapping (partition number - data set name)\0A q quit without saving changes\0A w write table to disk and exit\0A\00"
define void @fdasd_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([412 x i8], [412 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [411 x i8] c"Command action\0A m print this menu\0A p print the partition table\0A n add a new partition\0A d delete a partition\0A v change volume serial\0A t change partition type\0A r re-create VTOC and delete all partitions\0A u re-create VTOC re-using existing partition sizes\0A s show mapping (partition number - data set name)\0A q quit without saving changes\0A w write table to disk and exit\00"
define void @fdasd_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([411 x i8], [411 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *s, const char *delim) {
  static char *last;
  return strtok_r(s, delim, &last);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.last = internal global i8* null
define i8* @strtok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.last)
ret i8* %7
}

LLVM IR (-O2):
@strtok.last = internal global i8* null
define i8* @strtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.last)
ret i8* %3
}
/* Variables and functions */
double __nv_rnorm4d(double, double, double, double);
double rnorm4d(double __a, double __b, double __c, double __d) {
  return __nv_rnorm4d(__a, __b, __c, __d);
}


x86 assembly (clang, -O0):
<rnorm4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <__nv_rnorm4d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnorm4d>:
jmp    1030 <__nv_rnorm4d@plt>

LLVM IR (-O0):
define double @rnorm4d(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @__nv_rnorm4d(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @rnorm4d(double %0, double %1, double %2, double %3) {
%5 = tail call double @__nv_rnorm4d(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void error(void) {
  printf("You havn't input your numbers yet, please complete Option 1 to "
         "unlock options 2,3,4 & 5\n");
  printf("                              OK (Enter)\n");
  getchar();
  getchar();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [89 x i8] c"You havn't input your numbers yet, please complete Option 1 to unlock options 2,3,4 & 5\0A\00"
@.str.1 = [42 x i8] c" OK (Enter)\0A\00"
define void @error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @getchar()
%4 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [88 x i8] c"You havn't input your numbers yet, please complete Option 1 to unlock options 2,3,4 & 5\00"
@str.2 = [41 x i8] c" OK (Enter)\00"
define void @error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk_char(unsigned short const, char);
int /*<<< orphan*/ printk_uint(unsigned short const, unsigned int);
void printk_int(const unsigned short out, int val) {
  if (val < 0) {
    printk_char(out, '-');
    val *= -1;
  }
  printk_uint(out, (unsigned int)val);
}


x86 assembly (clang, -O0):
<printk_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1151 <printk_int+0x31>
mov    $0x2d,%esi
movzwl -0x2(%rbp),%edi
call   1030 <printk_char@plt>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%esi
movzwl %ax,%edi
call   1040 <printk_uint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printk_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
movzwl %di,%ebp
test   %esi,%esi
jns    113a <printk_int+0x1a>
mov    %ebp,%edi
mov    $0x2d,%esi
call   1030 <printk_char@plt>
neg    %ebx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printk_uint@plt>

LLVM IR (-O0):
define void @printk_int(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i16, i16* %3
%9 = call i32 @printk_char(i16 zeroext %8, i8 signext 45)
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, -1
store i32 %11, i32* %4
br label %12
12: ; preds = %7, %2
%13 = load i16, i16* %3
%14 = load i32, i32* %4
%15 = call i32 @printk_uint(i16 zeroext %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @printk_int(i16 zeroext %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printk_char(i16 zeroext %0, i8 signext 45)
%6 = sub nsw i32 0, %1
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ %1, %2 ]
%9 = tail call i32 @printk_uint(i16 zeroext %0, i32 %8)
ret void
}
/* Type definitions */
struct rb_root {
  int dummy;
};
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _left_rotate(struct rb_root *, struct rb_node *);
void left_rotate(struct rb_root *root, struct rb_node *node) {
  _left_rotate(root, node);
}


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

x86 assembly (clang, -O2):
<left_rotate>:
jmp    1030 <_left_rotate@plt>

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

LLVM IR (-O2):
%struct.rb_root = type { i32 }
%struct.rb_node = type { i32 }
define void @left_rotate(%struct.rb_root* %0, %struct.rb_node* %1) {
%3 = tail call i32 @_left_rotate(%struct.rb_root* %0, %struct.rb_node* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ green_max;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
unsigned long get_XStandardColormap_green_max(void *_p) {
  return (unsigned long)((XStandardColormap *)_p)->green_max;
}


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

x86 assembly (clang, -O2):
<get_XStandardColormap_green_max>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XStandardColormap_green_max(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XStandardColormap_green_max(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void prepare_clock(void) {}


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

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

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

LLVM IR (-O2):
define void @prepare_clock() {
ret void
}
int uwrite(fd, b, n)
char *b;
int fd, n;
{ return (write(fd, b, n)); }


x86 assembly (clang, -O0):
<uwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uwrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @uwrite(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int test();
int main(int argc, char **argv) { return test(); }


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <test@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 = call i32 (...) @test()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int munmap(void *, int);
int /*<<< orphan*/ perror(char *);
void ipc_close(int fd, void *data, int size) {
  if (munmap(data, size) == -1) {
    perror("munmap");
    exit(1);
  }
  close(fd);
  return;
}


x86 assembly (clang, -O0):
<ipc_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <munmap@plt>
cmp    $0xffffffff,%eax
jne    117d <ipc_close+0x3d>
lea    0xe92(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_close>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <munmap@plt>
cmp    $0xffffffff,%eax
je     115a <ipc_close+0x1a>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
lea    0xe9f(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"munmap\00"
define void @ipc_close(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @munmap(i8* %7, i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %3
%15 = load i32, i32* %4
%16 = call i32 @close(i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"munmap\00"
define void @ipc_close(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @munmap(i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
%10 = tail call i32 @close(i32 %0)
ret void
}
void do_66pushb_neg(void) {
  unsigned long long int block[3];
  __asm__ __volatile__("movq  %0, %%rdx\n\t"
                       "pushq $0x55555555\n\t"
                       "movq  %%rsp, 0(%%rdx)\n\t"
                       ".byte 0x66,0x6A,0xEE\n\t"
                       "movq  %%rsp, 8(%%rdx)\n\t"
                       "popq  %%rax\n\t"
                       "movq  %%rax,16(%%rdx)\n\t"
                       "movq  0(%%rdx),%%rsp\n\t"
                       "addq  $8, %%rsp"
                       :
                       : "r"(&block)
                       : "rax", "rdx", "cc", "memory");
  printf("66pushb_neg: delta %lld, top64 0x%016llx\n", block[0] - block[1],
         block[2]);
}


x86 assembly (clang, -O0):
<do_66pushb_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
pushw  $0xffee
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_66pushb_neg>:
sub    $0x18,%rsp
mov    %rsp,%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
pushw  $0xffee
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    (%rsp),%rsi
mov    0x10(%rsp),%rdx
sub    0x8(%rsp),%rsi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"66pushb_neg: delta %lld, top64 0x%016llx\0A\00"
define void @do_66pushb_neg() {
%1 = alloca [3 x i64]
%2 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%5 = load i64, i64* %4
%6 = sub i64 %3, %5
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%8 = load i64, i64* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"66pushb_neg: delta %lld, top64 0x%016llx\0A\00"
define void @do_66pushb_neg() {
%1 = alloca [3 x i64]
%2 = bitcast [3 x i64]* %1 to i8*
%3 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%9 = load i64, i64* %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int number = 0;
  while (1) {
    sleep(1);
    printf("Number %d\n", number);
    number++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Number %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = add nuw nsw i32 %2, 1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ mintaka_state_block();
void mintaka_state_block_() { mintaka_state_block(); }


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

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

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

LLVM IR (-O2):
define void @mintaka_state_block_() {
%1 = tail call i32 (...) @mintaka_state_block()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ stdout;
int print_help(void) {
  fprintf(stdout,
          "Copyright (c) 2005-2009 Esensors, Inc <TechHelp@eEsensors.com>\n");
  fprintf(stdout, ("This plugin is written mainly for Nagios/Cacti/RRDTool, "
                   "but can work standalone too. \nIt returns the HVAC data "
                   "from the EM01 Websensor\n\n"));
  print_usage();
  return 0;
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <print_usage@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf01(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <print_usage@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [64 x i8] c"Copyright (c) 2005-2009 Esensors, Inc <TechHelp@eEsensors.com>\0A\00"
@.str.1 = [137 x i8] c"This plugin is written mainly for Nagios/Cacti/RRDTool, but can work standalone too. \0AIt returns the HVAC data from the EM01 Websensor\0A\0A\00"
define i32 @print_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @print_usage()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [64 x i8] c"Copyright (c) 2005-2009 Esensors, Inc <TechHelp@eEsensors.com>\0A\00"
@.str.1 = [137 x i8] c"This plugin is written mainly for Nagios/Cacti/RRDTool, but can work standalone too. \0AIt returns the HVAC data from the EM01 Websensor\0A\0A\00"
define i32 @print_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @print_usage()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ set_interface_attribs(int, int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, char *, int);
void set_baud_115200(int fd) {
  write(fd, "ATBRD 23\r", 8);
  usleep(200000);
  set_interface_attribs(fd, B115200, 0);
  write(fd, "\r", 1);
  usleep(1000000);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xebb(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x30d40,%edi
call   1050 <usleep@plt>
mov    -0x4(%rbp),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <set_interface_attribs@plt>
mov    -0x4(%rbp),%edi
lea    0xe92(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xf4240,%edi
call   1050 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x30d40,%edi
call   1050 <usleep@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1040 <set_interface_attribs@plt>
lea    0xea1(%rip),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xf4240,%edi
pop    %rbx
jmp    1050 <usleep@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"ATBRD 23\0D\00"
@B115200 = global i32 0
@.str.1 = [2 x i8] c"\0D\00"
define void @set_baud_115200(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = call i32 @usleep(i32 200000)
%6 = load i32, i32* %2
%7 = load i32, i32* @B115200
%8 = call i32 @set_interface_attribs(i32 %6, i32 %7, i32 0)
%9 = load i32, i32* %2
%10 = call i32 @write(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%11 = call i32 @usleep(i32 1000000)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"ATBRD 23\0D\00"
@B115200 = global i32 0
@.str.1 = [2 x i8] c"\0D\00"
define void @set_baud_115200(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = tail call i32 @usleep(i32 200000)
%4 = load i32, i32* @B115200
%5 = tail call i32 @set_interface_attribs(i32 %0, i32 %4, i32 0)
%6 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = tail call i32 @usleep(i32 1000000)
ret void
}
void unw_resume() {}


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

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

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

LLVM IR (-O2):
define void @unw_resume() {
ret void
}
int mapping_print() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mapping_print() {
ret i32 0
}
/* Variables and functions */
int *A1();
int /*<<< orphan*/ A2();
int *D() {
  A2();
  return A1();
}


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

x86 assembly (clang, -O2):
<D>:
push   %rax
xor    %eax,%eax
call   1040 <A2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <A1@plt>

LLVM IR (-O0):
define i32* @D() {
%1 = call i32 (...) @A2()
%2 = call i32* (...) @A1()
ret i32* %2
}

LLVM IR (-O2):
define i32* @D() {
%1 = tail call i32 (...) @A2()
%2 = tail call i32* (...) @A1()
ret i32* %2
}
char *history_substring(string, start, end) const char *string;
int start, end;
{
  register int len;
  register char *result;
  len = end - start;
  result = (char *)xmalloc(len + 1);
  strncpy(result, string + start, len);
  result[len] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<history_substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <xmalloc@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
movslq -0x14(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<history_substring>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
sub    %esi,%ebx
lea    0x1(%rbx),%edi
xor    %eax,%eax
call   1040 <xmalloc@plt>
movslq %eax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
movslq %ebx,%rbx
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,0x0(%rbp,%rbx,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @history_substring(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = add nsw i32 %12, 1
%14 = call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %13)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %8
%17 = load i8*, i8** %8
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = call i8* @strncpy(i8* %17, i8* %21, i64 %23)
%25 = load i8*, i8** %8
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 0, i8* %28
%29 = load i8*, i8** %8
ret i8* %29
}

LLVM IR (-O2):
define i8* @history_substring(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = add nsw i32 %4, 1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = sext i32 %4 to i64
%12 = tail call i8* @strncpy(i8* dereferenceable(1) %8, i8* %10, i64 %11)
%13 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 0, i8* %13
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void indent(FILE *out, int level) {
  while (level-- > 0)
    fputc('\t', out);
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1146 <indent+0x36>
mov    -0x8(%rbp),%rsi
mov    $0x9,%edi
call   1030 <fputc@plt>
jmp    111f <indent+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1135 <indent+0x25>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
mov    $0x9,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <indent+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @indent(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = call i32 @fputc(i8 signext 9, i32* %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @fputc(i8 signext 9, i32* %0)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *realloc_it(void *ptrmem, size_t size) {
  void *p = realloc(ptrmem, size);
  if (!p) {
    free(ptrmem);
    fprintf(stderr, "realloc(): errno=%d\n", errno);
  }
  return p;
}


x86 assembly (clang, -O0):
<realloc_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1183 <realloc_it+0x53>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    0x2e63(%rip),%rax
mov    (%rax),%edx
lea    0xe82(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_it>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116a <realloc_it+0x3a>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"realloc(): errno=%d\0A\00"
@errno = global i32 0
define i8* @realloc_it(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* @stderr
%15 = load i32, i32* @errno
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %11, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"realloc(): errno=%d\0A\00"
@errno = global i32 0
define noalias i8* @realloc_it(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %5, %2
ret i8* %3
}