xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Status: 200 OK\r");
  puts("Content-Type: text/html\r");
  puts("\r");
  puts("Hello, world.");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Status: 200 OK\0D\00"
@.str.1 = [25 x i8] c"Content-Type: text/html\0D\00"
@.str.2 = [2 x i8] c"\0D\00"
@.str.3 = [14 x i8] c"Hello, world.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [16 x i8] c"Status: 200 OK\0D\00"
@.str.1 = [25 x i8] c"Content-Type: text/html\0D\00"
@.str.2 = [2 x i8] c"\0D\00"
@.str.3 = [14 x i8] c"Hello, world.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ display_restore();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void out_of_memory(const char *msg) {
  display_restore();
  (void)fprintf(stderr, "Out of memory: %s.\n", msg);
}


x86 assembly (clang, -O0):
<out_of_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <display_restore@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_of_memory>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <display_restore@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Out of memory: %s.\0A\00"
define void @out_of_memory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @display_restore()
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Out of memory: %s.\0A\00"
define void @out_of_memory(i8* %0) {
%2 = tail call i32 (...) @display_restore()
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void arch_timer_tick(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_timer_tick() {
ret void
}
void border_sw_ext_corner_special_sand_short_vert(unsigned char *pic,
                                                  unsigned char *mirr) {
  *pic = 0x2C;
  *mirr = 0x01;
}


x86 assembly (clang, -O0):
<border_sw_ext_corner_special_sand_short_vert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2c,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_sw_ext_corner_special_sand_short_vert>:
movb   $0x2c,(%rdi)
movb   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @border_sw_ext_corner_special_sand_short_vert(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
store i8 44, i8* %5
%6 = load i8*, i8** %4
store i8 1, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_sw_ext_corner_special_sand_short_vert(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 44, i8* %0
store i8 1, i8* %1
ret void
}
int test_imm_0Bint64_highword_reg(long long val) {
  return ((val >> 32) & (0x0B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Bint64_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, 11
%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_0Bint64_highword_reg(i64 %0) {
%2 = and i64 %0, 47244640256
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int Flip01(int x) {
  if (x == 0)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<Flip01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <Flip01+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <Flip01+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Flip01(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ module_var_add(struct module const *, char *, char *, double,
                                  int);
void module_init(const struct module *mod) {
  module_var_add(mod, "scpufreq", "get_scpufreq", 1.0, 1 | 16);
}


x86 assembly (clang, -O0):
<module_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xee5(%rip),%rsi
lea    0xeda(%rip),%rdx
movsd  0xeca(%rip),%xmm0
mov    $0x11,%ecx
call   1030 <module_var_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_init>:
lea    0xef5(%rip),%rsi
lea    0xeea(%rip),%rdx
movsd  0xeda(%rip),%xmm0
mov    $0x11,%ecx
jmp    1030 <module_var_add@plt>

LLVM IR (-O0):
%struct.module = type { i32 }
@.str = [9 x i8] c"scpufreq\00"
@.str.1 = [13 x i8] c"get_scpufreq\00"
define void @module_init(%struct.module* %0) {
%2 = alloca %struct.module*
store %struct.module* %0, %struct.module** %2
%3 = load %struct.module*, %struct.module** %2
%4 = call i32 @module_var_add(%struct.module* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+00, i32 17)
ret void
}

LLVM IR (-O2):
%struct.module = type { i32 }
@.str = [9 x i8] c"scpufreq\00"
@.str.1 = [13 x i8] c"get_scpufreq\00"
define void @module_init(%struct.module* %0) {
%2 = tail call i32 @module_var_add(%struct.module* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+00, i32 17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void sigchldHandler(int i) {
  printf("DMTCP is a guest.  It should never generate a SIGCHLD for user.\n");
  printf("*************************** This is a DMTCP bug.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<sigchldHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [65 x i8] c"DMTCP is a guest. It should never generate a SIGCHLD for user.\0A\00"
@.str.1 = [50 x i8] c"*************************** This is a DMTCP bug.\0A\00"
define void @sigchldHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [64 x i8] c"DMTCP is a guest. It should never generate a SIGCHLD for user.\00"
@str.2 = [49 x i8] c"*************************** This is a DMTCP bug.\00"
define void @sigchldHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
void XtCancelSelectionRequest() {}


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

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

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

LLVM IR (-O2):
define void @XtCancelSelectionRequest() {
ret void
}
unsigned int on_uint(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @on_uint() {
ret i32 1
}

LLVM IR (-O2):
define i32 @on_uint() {
ret i32 1
}
int atoi(const char *p) {
  int val = 0;
  char c;
  while (c = *p++) {
    if ((c < '0') || (c > '9')) {
      break;
    }
    val = val * 10 + (c - '0');
  }
  return (val);
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
cmp    $0x0,%al
je     115f <atoi+0x5f>
movsbl -0xd(%rbp),%eax
cmp    $0x30,%eax
jl     1145 <atoi+0x45>
movsbl -0xd(%rbp),%eax
cmp    $0x39,%eax
jle    114a <atoi+0x4a>
jmp    115f <atoi+0x5f>
imul   $0xa,-0xc(%rbp),%eax
movsbl -0xd(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x3a(%rcx),%edx
xor    %eax,%eax
cmp    $0xf6,%dl
jb     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x3a(%rcx),%edx
add    $0x1,%rdi
cmp    $0xf5,%dl
ja     1120 <atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -58
%4 = icmp ult i8 %3, -10
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = phi i32 [ %13, %5 ], [ 0, %1 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %6 to i32
%11 = mul nsw i32 %8, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = load i8, i8* %9
%15 = add i8 %14, -58
%16 = icmp ult i8 %15, -10
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int tolower(int);
int tohex(int c) {
  c = tolower(c);
  if (c > '9')
    return c - 'a';
  return c - '0';
}


x86 assembly (clang, -O0):
<tohex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x39,-0x8(%rbp)
jle    113e <tohex+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <tohex+0x37>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohex>:
push   %rax
call   1030 <tolower@plt>
lea    -0x30(%rax),%edx
lea    -0x61(%rax),%ecx
cmp    $0x3a,%eax
cmovl  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tohex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @tolower(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 57
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 97
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 48
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @tohex(i32 %0) {
%2 = tail call i32 @tolower(i32 %0)
%3 = icmp sgt i32 %2, 57
%4 = select i1 %3, i32 -97, i32 -48
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clear(int);
char *gets();
int /*<<< orphan*/ idt_init();
int /*<<< orphan*/ kb_init();
int /*<<< orphan*/ puts(char *, int);
void kmain(void) {
  int color = 0xf0;
  clear(color);
  idt_init();
  kb_init();
  puts("Welcome to tnyOS\n", color);
  char *string = gets();
  puts(string, color);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xf0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1070 <clear@plt>
mov    $0x0,%al
call   1050 <idt_init@plt>
mov    $0x0,%al
call   1060 <kb_init@plt>
mov    -0x4(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <gets@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <puts@plt>
jmp    119b <kmain+0x4b>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
mov    $0xf0,%edi
call   1070 <clear@plt>
xor    %eax,%eax
call   1050 <idt_init@plt>
xor    %eax,%eax
call   1060 <kb_init@plt>
lea    0xe90(%rip),%rdi
mov    $0xf0,%esi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <gets@plt>
mov    %rax,%rdi
mov    $0xf0,%esi
call   1030 <puts@plt>
xchg   %ax,%ax
jmp    1190 <kmain+0x40>

LLVM IR (-O0):
@.str = [18 x i8] c"Welcome to tnyOS\0A\00"
define void @kmain() {
%1 = alloca i32
%2 = alloca i8*
store i32 240, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @clear(i32 %3)
%5 = call i32 (...) @idt_init()
%6 = call i32 (...) @kb_init()
%7 = load i32, i32* %1
%8 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i8* (...) @gets()
store i8* %9, i8** %2
%10 = load i8*, i8** %2
%11 = load i32, i32* %1
%12 = call i32 @puts(i8* %10, i32 %11)
br label %13
13: ; preds = %0, %13
br label %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"Welcome to tnyOS\0A\00"
define void @kmain() {
%1 = tail call i32 @clear(i32 240)
%2 = tail call i32 (...) @idt_init()
%3 = tail call i32 (...) @kb_init()
%4 = tail call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 240)
%5 = tail call i8* (...) @gets()
%6 = tail call i32 @puts(i8* %5, i32 240)
br label %7
7: ; preds = %7, %0
br label %7
}
/* Variables and functions */
scalar_t__ isspace(char);
void strtrunc(char *first, char *last) {
  for (; first < last && isspace(*last); last--)
    *last = '\0';
}


x86 assembly (clang, -O0):
<strtrunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
jae    1149 <strtrunc+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1159 <strtrunc+0x49>
jmp    1171 <strtrunc+0x61>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strtrunc+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtrunc>:
push   %r14
push   %rbx
push   %rax
cmp    %rdi,%rsi
jbe    1139 <strtrunc+0x29>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <strtrunc+0x29>
movb   $0x0,(%rbx)
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
ja     1120 <strtrunc+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strtrunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %18, %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp ult i8* %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = call i64 @isspace(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %5
%15 = phi i1 [ false, %5 ], [ %13, %9 ]
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = load i8*, i8** %4
store i8 0, i8* %17
br label %18
18: ; preds = %16
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 -1
store i8* %20, i8** %4
br label %5
21: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @strtrunc(i8* readnone %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2, %9
%5 = phi i8* [ %10, %9 ], [ %1, %2 ]
%6 = load i8, i8* %5
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
store i8 0, i8* %5
%10 = getelementptr inbounds i8, i8* %5, i64 -1
%11 = icmp ugt i8* %10, %0
br i1 %11, label %4, label %12
12: ; preds = %4, %9, %2
ret void
}
int test_imm_50uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x50 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_50uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 80
%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_50uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 80
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
int random_int(int max) {
  int retval = (((double)rand()) / RAND_MAX * (max + 1));
  if (retval > max)
    return max;
  return retval;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eba(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    115e <random_int+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <random_int+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec2(%rip),%rax
divsd  (%rax),%xmm0
lea    0x1(%rbx),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
cmp    %ebx,%eax
cmovg  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @random_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fmul double %8, %11
%13 = fptosi double %12 to i32
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %21
19: ; preds = %1
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @random_int(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
%6 = add nsw i32 %0, 1
%7 = sitofp i32 %6 to double
%8 = fmul double %5, %7
%9 = fptosi double %8 to i32
%10 = icmp sgt i32 %9, %0
%11 = select i1 %10, i32 %0, i32 %9
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t c_fread(void *ptr, size_t size, size_t nmemb, void *stream) {
  return fread(ptr, size, nmemb, (FILE *)stream);
}


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

x86 assembly (clang, -O2):
<c_fread>:
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i64 @c_fread(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i8*, i8** %8
%13 = bitcast i8* %12 to i32*
%14 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @c_fread(i8* nocapture %0, i64 %1, i64 %2, i8* nocapture %3) {
%5 = bitcast i8* %3 to i32*
%6 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %5)
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
void *mem_filemap(int /*<<< orphan*/ *);
int mem_fileunmap(int /*<<< orphan*/ *, void *);
int main(int argc, char *argv[]) {
  FILE *fobj = fopen("/usr/home/pirogoeth/tedit/platform/test.txt", "r+");
  void *map = mem_filemap(fobj);
  return mem_fileunmap(fobj, map);
}


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)
lea    0xeb3(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <mem_filemap@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <mem_fileunmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeed(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <mem_filemap@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1050 <mem_fileunmap@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"/usr/home/pirogoeth/tedit/platform/test.txt\00"
@.str.1 = [3 x i8] c"r+\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = call i8* @mem_filemap(i32* %9)
store i8* %10, i8** %7
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = call i32 @mem_fileunmap(i32* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [44 x i8] c"/usr/home/pirogoeth/tedit/platform/test.txt\00"
@.str.1 = [3 x i8] c"r+\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @mem_filemap(i32* %3)
%5 = tail call i32 @mem_fileunmap(i32* %3, i8* %4)
ret i32 %5
}
unsigned int xlat_version(void) { return (4 << 24) | (1 << 16) | (5 << 8) | 0; }


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

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

LLVM IR (-O0):
define i32 @xlat_version() {
ret i32 67175680
}

LLVM IR (-O2):
define i32 @xlat_version() {
ret i32 67175680
}
int f4(int x) {
#pragma omp declare simd simdlen(8) aligned(b : 8 * sizeof(int))
  __extension__ __extension__ __extension__ extern int f5(int a, int *b, int c);
  {
    x++;
#pragma omp declare simd simdlen(4) linear(c)
    extern int f6(int a, int *b, int c);
  }
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @f4(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t rfcomm_event_channel_opened_get_status(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<rfcomm_event_channel_opened_get_status>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @rfcomm_event_channel_opened_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA8_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA8_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRA8_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
dozip() { ; }


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

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

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

LLVM IR (-O2):
define i32 @dozip() {
ret i32 undef
}
void CFGMR3QueryS32Def(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryS32Def() {
ret void
}
__attribute__((__unused__)) int tolower(int c) {
  if (('A' <= (c)) && ((c) <= 'Z')) {
    return (c - ('A' - 'a'));
  }
  return (c);
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     112d <tolower+0x2d>
cmpl   $0x5a,-0x8(%rbp)
jg     112d <tolower+0x2d>
mov    -0x8(%rbp),%eax
sub    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <tolower+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
char *strchr(char const *, int);
char *index(const char *p, int ch) { return strchr(p, ch); }


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

x86 assembly (clang, -O2):
<index>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @index(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
__attribute__((always_)) int zonelist_node_idx(struct zoneref *zoneref) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.zoneref = type opaque
define i32 @zonelist_node_idx(%struct.zoneref* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int hputc(char *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, long long);
int hputi8(char *hstring, const char *keyword, long long int ival) {
  char value[30];
  sprintf(value, "%lld", ival);
  return (hputc(hstring, keyword, value));
}


x86 assembly (clang, -O0):
<hputi8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <hputc@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputi8>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <hputc@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define i32 @hputi8(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [30 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%9 = load i64, i64* %6
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%14 = call i32 @hputc(i8* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @hputi8(i8* %0, i8* %1, i64 %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
%7 = call i32 @hputc(i8* %0, i8* %1, i8* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M554_f(char *s) {
  debug("M554_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M554_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M554_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M554_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M554_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M554_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M554_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
signed int vsprintf(char *restrict __s, const char *restrict __fmt,
                    void **__ap) {
  signed int return_value___builtin___vsprintf_chk$1;
  return_value___builtin___vsprintf_chk$1 =
      __builtin___vsprintf_chk(__s, 2 - 1, 18446744073709551615ul, __fmt, __ap);
  return return_value___builtin___vsprintf_chk$1;
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x1,%esi
mov    $0xffffffffffffffff,%rdx
call   1030 <__vsprintf_chk@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    $0x1,%esi
mov    $0xffffffffffffffff,%rdx
jmp    1030 <__vsprintf_chk@plt>

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @vsprintf(i8* noalias %0, i8* noalias %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = bitcast i8** %10 to %struct.__va_list_tag*
%12 = call i32 @__vsprintf_chk(i8* %8, i32 1, i64 -1, i8* %9, %struct.__va_list_tag* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @vsprintf(i8* noalias %0, i8* noalias %1, i8** %2) {
%4 = bitcast i8** %2 to %struct.__va_list_tag*
%5 = tail call i32 @__vsprintf_chk(i8* %0, i32 1, i64 -1, i8* %1, %struct.__va_list_tag* %4)
ret i32 %5
}
void przezadres(int n, int k, int *q, int *r) {
  *q = n / k;
  *r = n % k;
}


x86 assembly (clang, -O0):
<przezadres>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<przezadres>:
mov    %rdx,%r8
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,(%r8)
mov    %edx,(%rcx)
ret

LLVM IR (-O0):
define void @przezadres(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 = sdiv i32 %9, %10
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = srem i32 %13, %14
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @przezadres(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sdiv i32 %0, %1
store i32 %5, i32* %2
%6 = srem i32 %0, %1
store i32 %6, i32* %3
ret void
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int pt_comm_accept(int fd) {
  struct sockaddr_un addr;
  socklen_t addrlen = sizeof(addr);
  return accept(fd, (struct sockaddr *)&addr, &addrlen);
}


x86 assembly (clang, -O0):
<pt_comm_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <accept@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_comm_accept>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @pt_comm_accept(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_un
%4 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%7 = call i32 @accept(i32 %5, %struct.sockaddr* %6, i32* %4)
ret i32 %7
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @pt_comm_accept(i32 %0) {
%2 = alloca %struct.sockaddr_un
%3 = alloca i32
%4 = bitcast %struct.sockaddr_un* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_un* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
ret i32 %7
}
void ff_hevc_put_hevc_bi_w_qpel_v64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v64_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("How are you doing?\n");
  printf("I am      free\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [20 x i8] c"How are you doing?\0A\00"
@.str.2 = [16 x i8] c"I am free\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.3 = [19 x i8] c"How are you doing?\00"
@str.4 = [15 x i8] c"I am free\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
void skip(unsigned long int bytes) {
  while (bytes--) {
    (void)getchar();
  }
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1141 <skip+0x31>
mov    $0x0,%al
call   1030 <getchar@plt>
jmp    111c <skip+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %rbx
test   %rdi,%rdi
je     112d <skip+0x1d>
mov    %rdi,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <skip+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @skip(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load i64, i64* %2
%5 = add i64 %4, -1
store i64 %5, i64* %2
%6 = icmp ne i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @getchar()
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @skip(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ %0, %1 ]
%5 = add i64 %4, -1
%6 = tail call i32 (...) @getchar()
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
OP(dd, eb) {
  illegal_1();
  op_eb();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_eb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_eb()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ initATA();
int /*<<< orphan*/ initDevice();
int /*<<< orphan*/ initLog();
int /*<<< orphan*/ initPCI();
int /*<<< orphan*/ initPIC();
int /*<<< orphan*/ initRTC();
void afterFS() {
  initDevice();
  initLog();
  initPIC();
  initRTC();
  initPCI();
  initATA();
}


x86 assembly (clang, -O0):
<afterFS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initDevice@plt>
mov    $0x0,%al
call   1050 <initLog@plt>
mov    $0x0,%al
call   1030 <initPIC@plt>
mov    $0x0,%al
call   1080 <initRTC@plt>
mov    $0x0,%al
call   1060 <initPCI@plt>
mov    $0x0,%al
call   1070 <initATA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<afterFS>:
push   %rax
xor    %eax,%eax
call   1040 <initDevice@plt>
xor    %eax,%eax
call   1050 <initLog@plt>
xor    %eax,%eax
call   1030 <initPIC@plt>
xor    %eax,%eax
call   1080 <initRTC@plt>
xor    %eax,%eax
call   1060 <initPCI@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <initATA@plt>

LLVM IR (-O0):
define void @afterFS() {
%1 = call i32 (...) @initDevice()
%2 = call i32 (...) @initLog()
%3 = call i32 (...) @initPIC()
%4 = call i32 (...) @initRTC()
%5 = call i32 (...) @initPCI()
%6 = call i32 (...) @initATA()
ret void
}

LLVM IR (-O2):
define void @afterFS() {
%1 = tail call i32 (...) @initDevice()
%2 = tail call i32 (...) @initLog()
%3 = tail call i32 (...) @initPIC()
%4 = tail call i32 (...) @initRTC()
%5 = tail call i32 (...) @initPCI()
%6 = tail call i32 (...) @initATA()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_ampl_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("ampl", " #comment"),
                            "comment", "#comment");
}


x86 assembly (clang, -O0):
<test_ampl_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec7(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ampl_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecc(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ampl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_ampl_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ampl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_ampl_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}