xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x20() {
  Assert_real((iscntrl(32) == 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_iscntrl.c",
              165, ("iscntrl should be 0 for  "));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x20>:
push   %rax
mov    $0x20,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa5,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for \00"
define void @t_iscntrl_0x20() {
%1 = call i64 @iscntrl(i32 32)
%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 165, i8* getelementptr inbounds ([26 x i8], [26 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for \00"
define void @t_iscntrl_0x20() {
%1 = tail call i64 @iscntrl(i32 32)
%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 165, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ktsan_thr_create(struct ktsan_thr_s *new, int tid) {}


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

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

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

LLVM IR (-O2):
%struct.ktsan_thr_s = type opaque
define void @ktsan_thr_create(%struct.ktsan_thr_s* nocapture %0, i32 %1) {
ret void
}
int test_imm_BBint64_midword_reg(long long val) {
  return ((val >> 16) & (0xBB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BBint64_midword_reg>:
test   $0xbb0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BBint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12255232
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_banner(void) {
  printf("#  Time (s)  |  Alt (m)  | Accel (m/s2) | Speed (m/s) |\n");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"# Time (s) | Alt (m) | Accel (m/s2) | Speed (m/s) |\0A\00"
define void @print_banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"# Time (s) | Alt (m) | Accel (m/s2) | Speed (m/s) |\00"
define void @print_banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
int g(int j) {
  int l = j + 2;
  return l;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0x2(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void hello(const char *s) { printf("Hello %s \n", s); }


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

x86 assembly (clang, -O2):
<hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hello %s \0A\00"
define void @hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((always_)) void kmemcheck_mark_initialized(void *address,
                                                         unsigned int n) {}


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

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

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

LLVM IR (-O2):
define void @kmemcheck_mark_initialized(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
void _puts_recursion(char *s) {
  if (*s == '\0') {
    _putchar('\n');
    return;
  }
  _putchar(*s);
  _puts_recursion(s + 1);
}


x86 assembly (clang, -O0):
<_puts_recursion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114b <_puts_recursion+0x2b>
mov    $0xa,%edi
call   1040 <_putchar@plt>
jmp    1164 <_puts_recursion+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <_putchar@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <_puts_recursion@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_puts_recursion>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <_puts_recursion+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_puts_recursion+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <_putchar@plt>

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

LLVM IR (-O2):
define void @_puts_recursion(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = tail call i32 @_putchar(i8 signext 10)
ret void
6: ; preds = %1, %6
%7 = phi i8 [ %11, %6 ], [ %2, %1 ]
%8 = phi i8* [ %10, %6 ], [ %0, %1 ]
%9 = tail call i32 @_putchar(i8 signext %7)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %6
}
int test_imm_16int64_highword_reg(long long val) {
  return ((val >> 32) & (0x16 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_16int64_highword_reg>:
movabs $0x1600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_16int64_highword_reg(i64 %0) {
%2 = and i64 %0, 94489280512
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ikmem_boot_once(void) {}


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

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

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

LLVM IR (-O2):
define void @ikmem_boot_once() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char *, int);
int strlen(char *);
void gator_annotate_marker_str(char *string) {
  int marker_annotation = 0x021c;
  kannotate_write((char *)&marker_annotation, 2);
  kannotate_write(string, strlen(string) + 1);
}


x86 assembly (clang, -O0):
<gator_annotate_marker_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x21c,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
call   1040 <kannotate_write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
add    $0x1,%esi
call   1040 <kannotate_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_marker_str>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x21c,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x2,%esi
call   1040 <kannotate_write@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%esi
mov    %rbx,%rdi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @gator_annotate_marker_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 540, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @kannotate_write(i8* %4, i32 2)
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = call i32 @kannotate_write(i8* %6, i32 %9)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_marker_str(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 540, i32* %2
%4 = call i32 @kannotate_write(i8* %3, i32 2)
%5 = call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 1
%7 = call i32 @kannotate_write(i8* %0, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void sleep10(int secs) { sleep(secs); }


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

x86 assembly (clang, -O2):
<sleep10>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @sleep10(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(const char *arg0, int retval) {
  fprintf(retval ? stderr : stdout,
          "usage: %s [-d port]  [-b baudrate] [-o outputfile] [-i inputfile]\n",
          arg0);
  exit(retval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <usage+0x2a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <usage+0x36>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
test   %esi,%esi
jne    1133 <usage+0x13>
mov    0x2ea7(%rip),%rax
jmp    113a <usage+0x1a>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [67 x i8] c"usage: %s [-d port] [-b baudrate] [-o outputfile] [-i inputfile]\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* @stderr
br label %11
9: ; preds = %2
%10 = load i32, i32* @stdout
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %4
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [67 x i8] c"usage: %s [-d port] [-b baudrate] [-o outputfile] [-i inputfile]\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @stdout
%6 = select i1 %3, i32 %5, i32 %4
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ swap(char ***, int /*<<< orphan*/, int /*<<< orphan*/);
void vecswap(char ***a, int i, int j, int n) {
  while (n-- > 0)
    swap(a, i++, j++);
}


x86 assembly (clang, -O0):
<vecswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    115d <vecswap+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
call   1030 <swap@plt>
jmp    1125 <vecswap+0x15>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecswap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %ecx,%ecx
jle    114c <vecswap+0x3c>
mov    %ecx,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rsi),%r15d
lea    0x1(%rdx),%ebp
mov    %r14,%rdi
call   1030 <swap@plt>
add    $0xffffffff,%ebx
mov    %ebp,%edx
mov    %r15d,%esi
cmp    $0x1,%ebx
ja     1130 <vecswap+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vecswap(i8*** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8***
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8*** %0, i8**** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
br label %9
9: ; preds = %13, %4
%10 = load i32, i32* %8
%11 = add nsw i32 %10, -1
store i32 %11, i32* %8
%12 = icmp sgt i32 %10, 0
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i8***, i8**** %5
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
%19 = call i32 @swap(i8*** %14, i32 %15, i32 %17)
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @vecswap(i8*** %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %15
6: ; preds = %4, %6
%7 = phi i32 [ %10, %6 ], [ %3, %4 ]
%8 = phi i32 [ %12, %6 ], [ %2, %4 ]
%9 = phi i32 [ %11, %6 ], [ %1, %4 ]
%10 = add nsw i32 %7, -1
%11 = add nsw i32 %9, 1
%12 = add nsw i32 %8, 1
%13 = tail call i32 @swap(i8*** %0, i32 %9, i32 %8)
%14 = icmp ugt i32 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %4
ret void
}
/* Variables and functions */
int *calloc(int, int);
int /*<<< orphan*/ free(int *);
scalar_t__ pipe(int *);
long OsCreateEvent(char *name) {
  int *pfd;
  pfd = calloc(sizeof(int), 2);
  if (pfd != NULL) {
    if (pipe(pfd)) {
      free(pfd);
      pfd = NULL;
    }
  }
  return ((long)pfd);
}


x86 assembly (clang, -O0):
<OsCreateEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
mov    $0x2,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1183 <OsCreateEvent+0x53>
mov    -0x10(%rbp),%rdi
call   1040 <pipe@plt>
cmp    $0x0,%rax
je     117e <OsCreateEvent+0x4e>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
jmp    1183 <OsCreateEvent+0x53>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsCreateEvent>:
push   %rbx
mov    $0x4,%edi
mov    $0x2,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     115d <OsCreateEvent+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <pipe@plt>
test   %rax,%rax
je     115f <OsCreateEvent+0x2f>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @OsCreateEvent(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @calloc(i32 4, i32 2)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = call i64 @pipe(i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = call i32 @free(i32* %12)
store i32* null, i32** %3
br label %14
14: ; preds = %11, %7
br label %15
15: ; preds = %14, %1
%16 = load i32*, i32** %3
%17 = ptrtoint i32* %16 to i64
ret i64 %17
}

LLVM IR (-O2):
define i64 @OsCreateEvent(i8* nocapture readnone %0) {
%2 = tail call i32* @calloc(i32 4, i32 2)
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @pipe(i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @free(i32* %2)
br label %9
9: ; preds = %4, %7, %1
%10 = phi i32* [ null, %7 ], [ %2, %4 ], [ null, %1 ]
%11 = ptrtoint i32* %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ INC16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Direct(int);
void OpE6M0(void) { INC16(SA1Direct(3), 0xFFFF); }


x86 assembly (clang, -O0):
<OpE6M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <INC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpE6M0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <INC16@plt>

LLVM IR (-O0):
define void @OpE6M0() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @INC16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @OpE6M0() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @INC16(i32 %1, i32 65535)
ret void
}
int isVowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isVowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
je     114b <isVowel+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x65,%eax
je     114b <isVowel+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x69,%eax
je     114b <isVowel+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x75,%eax
je     114b <isVowel+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
jne    1157 <isVowel+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <isVowel+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVowel>:
add    $0x9f,%dil
ror    %dil
xor    %eax,%eax
cmp    $0xa,%dil
ja     111d <isVowel+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isVowel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 97
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 101
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 105
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 117
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 111
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@switch.table.isVowel = [11 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1]
define i32 @isVowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 11
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i8 %3 to i64
%7 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.isVowel, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ XtPointer;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Widget;
typedef int /*<<< orphan*/ String;
typedef int /*<<< orphan*/ Cardinal;

/* Variables and functions */
int /*<<< orphan*/ XtCallCallbacks(int /*<<< orphan*/, char *,
                                   int /*<<< orphan*/);
void QuitAction(Widget w, XEvent *event, String params[],
                Cardinal *num_params) {
  XtCallCallbacks(w, "quitCallback", (XtPointer)event);
}


x86 assembly (clang, -O0):
<QuitAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec9(%rip),%rsi
call   1030 <XtCallCallbacks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuitAction>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <XtCallCallbacks@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"quitCallback\00"
define void @QuitAction(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @XtCallCallbacks(i32 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"quitCallback\00"
define void @QuitAction(i32 %0, i32* %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = ptrtoint i32* %1 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @XtCallCallbacks(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ putsn(char const *);
int puts(const char *s) {
  putsn(s);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <putsn@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1040 <putsn@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @putsn(i8* %3)
%5 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @putsn(i8* %0)
%3 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int);
int /*<<< orphan*/ write(int, char *, int);
void clear_hotplug() {
  int ofd = open("/proc/sys/kernel/hotplug", O_WRONLY | O_TRUNC);
  write(ofd, "", 1);
  close(ofd);
}


x86 assembly (clang, -O0):
<clear_hotplug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xeb5(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_hotplug>:
push   %rbx
mov    0x2e98(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xec0(%rip),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"/proc/sys/kernel/hotplug\00"
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@.str.1 = [1 x i8] zeroinitializer
define void @clear_hotplug() {
%1 = alloca i32
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_TRUNC
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @write(i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = load i32, i32* %1
%9 = call i32 @close(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/proc/sys/kernel/hotplug\00"
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@.str.1 = [1 x i8] zeroinitializer
define void @clear_hotplug() {
%1 = load i32, i32* @O_WRONLY
%2 = load i32, i32* @O_TRUNC
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call i32 @close(i32 %4)
ret void
}
/* Variables and functions */
int free_rng(int *);
int ffree_rng(int **genptr) { return free_rng(*genptr); }


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

x86 assembly (clang, -O2):
<ffree_rng>:
mov    (%rdi),%rdi
jmp    1030 <free_rng@plt>

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

LLVM IR (-O2):
define i32 @ffree_rng(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @free_rng(i32* %2)
ret i32 %3
}
void threshold_by_comparison_1_Bad() {
  int arr[50];
  for (int i = 0; i != 100; i++) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<threshold_by_comparison_1_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0xd4(%rbp)
cmpl   $0x64,-0xd4(%rbp)
je     1145 <threshold_by_comparison_1_Bad+0x45>
movslq -0xd4(%rbp),%rax
movl   $0x0,-0xd0(%rbp,%rax,4)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1112 <threshold_by_comparison_1_Bad+0x12>
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @threshold_by_comparison_1_Bad() {
%1 = alloca [50 x i32]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 100
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %8
store i32 0, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @threshold_by_comparison_1_Bad() {
ret void
}
unsigned int HSMMCSDIsXferComplete(unsigned int baseAddr, unsigned int retry) {
  volatile unsigned int status = 0;
  do {
    status =
        ((*((volatile unsigned int *)(baseAddr + (0x230)))) & (0x00000002u)) >>
        (0x00000001u);
    if ((1 == status) || (0 == retry)) {
      break;
    }
  } while (retry--);
  return status;
}


x86 assembly (clang, -O0):
<HSMMCSDIsXferComplete>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x2,%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1141 <HSMMCSDIsXferComplete+0x41>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1146 <HSMMCSDIsXferComplete+0x46>
jmp    115f <HSMMCSDIsXferComplete+0x5f>
jmp    114b <HSMMCSDIsXferComplete+0x4b>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jne    1111 <HSMMCSDIsXferComplete+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDIsXferComplete>:
movl   $0x0,-0x4(%rsp)
add    $0x230,%edi
xchg   %ax,%ax
mov    (%rdi),%eax
shr    %eax
and    $0x1,%eax
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
sub    $0x1,%esi
setb   %al
cmp    $0x1,%ecx
je     112e <HSMMCSDIsXferComplete+0x2e>
test   %al,%al
je     1110 <HSMMCSDIsXferComplete+0x10>
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @HSMMCSDIsXferComplete(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store volatile i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %3
%8 = add i32 %7, 560
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 2
%13 = lshr i32 %12, 1
store volatile i32 %13, i32* %5
%14 = load volatile i32, i32* %5
%15 = icmp eq i32 1, %14
br i1 %15, label %19, label %16
16: ; preds = %6
%17 = load i32, i32* %4
%18 = icmp eq i32 0, %17
br i1 %18, label %19, label %20
19: ; preds = %16, %6
br label %25
20: ; preds = %16
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add i32 %22, -1
store i32 %23, i32* %4
%24 = icmp ne i32 %22, 0
br i1 %24, label %6, label %25
25: ; preds = %21, %19
%26 = load volatile i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @HSMMCSDIsXferComplete(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = add i32 %0, 560
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
br label %8
8: ; preds = %8, %2
%9 = phi i32 [ %1, %2 ], [ %17, %8 ]
%10 = load volatile i32, i32* %7
%11 = lshr i32 %10, 1
%12 = and i32 %11, 1
store volatile i32 %12, i32* %3
%13 = load volatile i32, i32* %3
%14 = icmp eq i32 %13, 1
%15 = icmp eq i32 %9, 0
%16 = select i1 %14, i1 true, i1 %15
%17 = add i32 %9, -1
br i1 %16, label %18, label %8
18: ; preds = %8
%19 = load volatile i32, i32* %3
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ pprintf(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *sc = "hello\0";
  printf("printf:\n\tString Constant = [%s]\n", sc);
  pprintf("goodbye\0");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <pprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello\00\00"
@.str.1 = [33 x i8] c"printf:\0A\09String Constant = [%s]\0A\00"
@.str.2 = [9 x i8] c"goodbye\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @pprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello\00\00"
@.str.1 = [33 x i8] c"printf:\0A\09String Constant = [%s]\0A\00"
@.str.2 = [9 x i8] c"goodbye\00\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @pprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSMKR(const char *the_title) { return any_decrqss(the_title, "+r"); }


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

x86 assembly (clang, -O2):
<rpt_DECSMKR>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"+r\00"
define i32 @rpt_DECSMKR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"+r\00"
define i32 @rpt_DECSMKR(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void prtnl() { fprintf(stderr, "\n"); }


x86 assembly (clang, -O0):
<prtnl>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtnl>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @prtnl() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @prtnl() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Analyse(int, char **);
int main(int arg, char *argv[]) {
  int Eret = 0;
  Analyse(arg, argv);
  return Eret;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @Analyse(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void set_ACK() {
  short int temp = 0;
  temp = read_ZIGBEE_short(0x1B);
  temp = temp | 0x04;
  write_ZIGBEE_short(0x1B, temp);
}


x86 assembly (clang, -O0):
<set_ACK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
or     $0x4,%eax
mov    %ax,-0x2(%rbp)
mov    $0x1b,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ACK>:
push   %rax
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
or     $0x4,%eax
movswl %ax,%esi
mov    $0x1b,%edi
pop    %rax
jmp    1040 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @set_ACK() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call signext i16 @read_ZIGBEE_short(i32 27)
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = or i32 %4, 4
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @write_ZIGBEE_short(i32 27, i16 signext %7)
ret void
}

LLVM IR (-O2):
define void @set_ACK() {
%1 = tail call signext i16 @read_ZIGBEE_short(i32 27)
%2 = or i16 %1, 4
%3 = tail call i32 @write_ZIGBEE_short(i32 27, i16 signext %2)
ret void
}
void gencvt_l_d() {}


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

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

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

LLVM IR (-O2):
define void @gencvt_l_d() {
ret void
}
int compute_sealevel_pressure_offset(int altitudeFt, float temp_c) {
  float altitudeMeters = altitudeFt / 3.2808;
  float temp_k = temp_c + 273;
  if (temp_k == 0)
    return 0;
  else
    return (int)((float)(altitudeMeters / (temp_k / 29.263)));
}


x86 assembly (clang, -O0):
<compute_sealevel_pressure_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeef(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xed2(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    115b <compute_sealevel_pressure_offset+0x5b>
jp     115b <compute_sealevel_pressure_offset+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1188 <compute_sealevel_pressure_offset+0x88>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe9b(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_sealevel_pressure_offset>:
addss  0xef8(%rip),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1115 <compute_sealevel_pressure_offset+0x15>
jp     1115 <compute_sealevel_pressure_offset+0x15>
ret
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
divsd  0xee4(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
divsd  0xed8(%rip),%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @compute_sealevel_pressure_offset(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 3.280800e+00
%11 = fptrunc double %10 to float
store float %11, float* %6
%12 = load float, float* %5
%13 = fadd float %12, 2.730000e+02
store float %13, float* %7
%14 = load float, float* %7
%15 = fcmp oeq float %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 0, i32* %3
br label %26
17: ; preds = %2
%18 = load float, float* %6
%19 = fpext float %18 to double
%20 = load float, float* %7
%21 = fpext float %20 to double
%22 = fdiv double %21, 2.926300e+01
%23 = fdiv double %19, %22
%24 = fptrunc double %23 to float
%25 = fptosi float %24 to i32
store i32 %25, i32* %3
br label %26
26: ; preds = %17, %16
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compute_sealevel_pressure_offset(i32 %0, float %1) {
%3 = fadd float %1, 2.730000e+02
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = sitofp i32 %0 to double
%7 = fdiv double %6, 3.280800e+00
%8 = fptrunc double %7 to float
%9 = fpext float %8 to double
%10 = fpext float %3 to double
%11 = fdiv double %10, 2.926300e+01
%12 = fdiv double %9, %11
%13 = fptrunc double %12 to float
%14 = fptosi float %13 to i32
br label %15
15: ; preds = %2, %5
%16 = phi i32 [ %14, %5 ], [ 0, %2 ]
ret i32 %16
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int close(int);
int open(char *, int);
int /*<<< orphan*/ printf(char *, int);
void openFile() {
  int fd = open("test.txt", O_RDWR | O_CREAT);
  printf("new file fd = %d\n", fd);
  int ret = close(fd);
  printf("close new file ret = %d\n", ret);
}


x86 assembly (clang, -O0):
<openFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFile>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <close@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@.str.1 = [18 x i8] c"new file fd = %d\0A\00"
@.str.2 = [25 x i8] c"close new file ret = %d\0A\00"
define void @openFile() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_CREAT
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @close(i32 %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@.str.1 = [18 x i8] c"new file fd = %d\0A\00"
@.str.2 = [25 x i8] c"close new file ret = %d\0A\00"
define void @openFile() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @close(i32 %4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
struct drunkard {
  int dummy;
};

/* Variables and functions */
scalar_t__ drunkard_rng_chance(struct drunkard *, double);
int /*<<< orphan*/ drunkard_start_random_north_edge(struct drunkard *);
int /*<<< orphan*/ drunkard_start_random_south_edge(struct drunkard *);
void drunkard_start_random_northsouth_edge(struct drunkard *drunk) {
  if (drunkard_rng_chance(drunk, 0.5))
    drunkard_start_random_north_edge(drunk);
  else
    drunkard_start_random_south_edge(drunk);
}


x86 assembly (clang, -O0):
<drunkard_start_random_northsouth_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xeb8(%rip),%xmm0
call   1040 <drunkard_rng_chance@plt>
cmp    $0x0,%rax
je     1165 <drunkard_start_random_northsouth_edge+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <drunkard_start_random_north_edge@plt>
jmp    116e <drunkard_start_random_northsouth_edge+0x3e>
mov    -0x8(%rbp),%rdi
call   1050 <drunkard_start_random_south_edge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drunkard_start_random_northsouth_edge>:
push   %rbx
mov    %rdi,%rbx
movsd  0xec4(%rip),%xmm0
call   1040 <drunkard_rng_chance@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114f <drunkard_start_random_northsouth_edge+0x1f>
pop    %rbx
jmp    1030 <drunkard_start_random_north_edge@plt>
pop    %rbx
jmp    1050 <drunkard_start_random_south_edge@plt>

LLVM IR (-O0):
%struct.drunkard = type { i32 }
define void @drunkard_start_random_northsouth_edge(%struct.drunkard* %0) {
%2 = alloca %struct.drunkard*
store %struct.drunkard* %0, %struct.drunkard** %2
%3 = load %struct.drunkard*, %struct.drunkard** %2
%4 = call i64 @drunkard_rng_chance(%struct.drunkard* %3, double 5.000000e-01)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.drunkard*, %struct.drunkard** %2
%8 = call i32 @drunkard_start_random_north_edge(%struct.drunkard* %7)
br label %12
9: ; preds = %1
%10 = load %struct.drunkard*, %struct.drunkard** %2
%11 = call i32 @drunkard_start_random_south_edge(%struct.drunkard* %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
%struct.drunkard = type { i32 }
define void @drunkard_start_random_northsouth_edge(%struct.drunkard* %0) {
%2 = tail call i64 @drunkard_rng_chance(%struct.drunkard* %0, double 5.000000e-01)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @drunkard_start_random_north_edge(%struct.drunkard* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @drunkard_start_random_south_edge(%struct.drunkard* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_6184_fu_set_end(uint8_t *header) { header[0] |= 0x40; }


x86 assembly (clang, -O0):
<rtp_6184_fu_set_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x40,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_6184_fu_set_end>:
orb    $0x40,(%rdi)
ret

LLVM IR (-O0):
define void @rtp_6184_fu_set_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = or i32 %5, 64
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @rtp_6184_fu_set_end(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = or i32 %2, 64
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ current_path;

/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void Printpwd() {
  char current_path[1024];
  getcwd(current_path, sizeof(current_path));
  printf("%s", current_path);
}


x86 assembly (clang, -O0):
<Printpwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
lea    -0x400(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Printpwd>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @Printpwd() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 1024)
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @Printpwd() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 1024)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}