#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ emit_label(char *);
int /*<<< orphan*/ emitf(int, char *, ...);
char *make_label();
int emit_regsave_area(void) {
  int pos = -304;
  emitf(1497,
        "\t"
        "mov %%rdi, %d(%%rsp)",
        pos);
  emitf(1498,
        "\t"
        "mov %%rsi, %d(%%rsp)",
        (pos += 8));
  emitf(1499,
        "\t"
        "mov %%rdx, %d(%%rsp)",
        (pos += 8));
  emitf(1500,
        "\t"
        "mov %%rcx, %d(%%rsp)",
        (pos += 8));
  emitf(1501,
        "\t"
        "mov %%r8, %d(%%rsp)",
        (pos += 8));
  emitf(1502,
        "\t"
        "mov %%r9, %d(%%rsp)",
        pos + 8);
  char *end = make_label();
  for (int i = 0; i < 16; i++) {
    emitf(1505, "\t"
                "test %%al, %%al");
    emitf(1506,
          "\t"
          "jz %s",
          end);
    emitf(1507,
          "\t"
          "movsd %%xmm%d, %d(%%rsp)",
          i, (pos += 16));
    emitf(1508, "\t"
                "sub $1, %%al");
  }
  emit_label(end);
  emitf(1511,
        "\t"
        "sub $%d, %%rsp",
        304);
  return 304;
}


x86 assembly (clang, -O0):
<emit_regsave_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xfffffed0,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x5d9,%edi
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x4(%rbp),%edx
add    $0x8,%edx
mov    %edx,-0x4(%rbp)
mov    $0x5da,%edi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x4(%rbp),%edx
add    $0x8,%edx
mov    %edx,-0x4(%rbp)
mov    $0x5db,%edi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x4(%rbp),%edx
add    $0x8,%edx
mov    %edx,-0x4(%rbp)
mov    $0x5dc,%edi
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x4(%rbp),%edx
add    $0x8,%edx
mov    %edx,-0x4(%rbp)
mov    $0x5dd,%edi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x4(%rbp),%edx
add    $0x8,%edx
mov    $0x5de,%edi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    $0x0,%al
call   1030 <make_label@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1264 <emit_regsave_area+0x134>
mov    $0x5e1,%edi
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x10(%rbp),%rdx
mov    $0x5e2,%edi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%ecx
add    $0x10,%ecx
mov    %ecx,-0x4(%rbp)
mov    $0x5e3,%edi
lea    0xe5e(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    $0x5e4,%edi
lea    0xe65(%rip),%rsi
mov    $0x0,%al
call   1040 <emitf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f0 <emit_regsave_area+0xc0>
mov    -0x10(%rbp),%rdi
call   1050 <emit_label@plt>
mov    $0x5e7,%edi
lea    0xe49(%rip),%rsi
mov    $0x130,%edx
mov    $0x0,%al
call   1040 <emitf@plt>
mov    $0x130,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_regsave_area>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rsi
mov    $0x5d9,%edi
mov    $0xfffffed0,%edx
xor    %eax,%eax
call   1040 <emitf@plt>
lea    0xebc(%rip),%rsi
mov    $0x5da,%edi
mov    $0xfffffed8,%edx
xor    %eax,%eax
call   1040 <emitf@plt>
lea    0xeba(%rip),%rsi
mov    $0x5db,%edi
mov    $0xfffffee0,%edx
xor    %eax,%eax
call   1040 <emitf@plt>
lea    0xeb8(%rip),%rsi
mov    $0x5dc,%edi
mov    $0xfffffee8,%edx
xor    %eax,%eax
call   1040 <emitf@plt>
lea    0xeb6(%rip),%rsi
mov    $0x5dd,%edi
mov    $0xfffffef0,%edx
xor    %eax,%eax
call   1040 <emitf@plt>
lea    0xeb3(%rip),%rsi
mov    $0x5de,%edi
mov    $0xfffffef8,%edx
xor    %eax,%eax
call   1040 <emitf@plt>
xor    %eax,%eax
call   1030 <make_label@plt>
mov    %rax,%rbx
mov    $0xffffff00,%ebp
lea    0xeb2(%rip),%r15
lea    0xeb2(%rip),%r12
lea    0xec5(%rip),%r13
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x5e1,%edi
lea    0xe76(%rip),%rsi
xor    %eax,%eax
call   1040 <emitf@plt>
mov    $0x5e2,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <emitf@plt>
mov    $0x5e3,%edi
mov    %r12,%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <emitf@plt>
mov    $0x5e4,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <emitf@plt>
add    $0x1,%r14d
add    $0x10,%ebp
cmp    $0x10,%r14d
jne    1200 <emit_regsave_area+0xd0>
mov    %rbx,%rdi
call   1050 <emit_label@plt>
lea    0xe5e(%rip),%rsi
mov    $0x5e7,%edi
mov    $0x130,%edx
xor    %eax,%eax
call   1040 <emitf@plt>
mov    $0x130,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\09mov %%rdi, %d(%%rsp)\00"
@.str.1 = [22 x i8] c"\09mov %%rsi, %d(%%rsp)\00"
@.str.2 = [22 x i8] c"\09mov %%rdx, %d(%%rsp)\00"
@.str.3 = [22 x i8] c"\09mov %%rcx, %d(%%rsp)\00"
@.str.4 = [21 x i8] c"\09mov %%r8, %d(%%rsp)\00"
@.str.5 = [21 x i8] c"\09mov %%r9, %d(%%rsp)\00"
@.str.6 = [17 x i8] c"\09test %%al, %%al\00"
@.str.7 = [7 x i8] c"\09jz %s\00"
@.str.8 = [26 x i8] c"\09movsd %%xmm%d, %d(%%rsp)\00"
@.str.9 = [14 x i8] c"\09sub $1, %%al\00"
@.str.10 = [16 x i8] c"\09sub $%d, %%rsp\00"
define i32 @emit_regsave_area() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 -304, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i32, i8*, ...) @emitf(i32 1497, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 8
store i32 %7, i32* %1
%8 = call i32 (i32, i8*, ...) @emitf(i32 1498, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 8
store i32 %10, i32* %1
%11 = call i32 (i32, i8*, ...) @emitf(i32 1499, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 8
store i32 %13, i32* %1
%14 = call i32 (i32, i8*, ...) @emitf(i32 1500, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 8
store i32 %16, i32* %1
%17 = call i32 (i32, i8*, ...) @emitf(i32 1501, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 8
%20 = call i32 (i32, i8*, ...) @emitf(i32 1502, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = call i8* (...) @make_label()
store i8* %21, i8** %2
store i32 0, i32* %3
br label %22
22: ; preds = %34, %0
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 16
br i1 %24, label %25, label %37
25: ; preds = %22
%26 = call i32 (i32, i8*, ...) @emitf(i32 1505, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%27 = load i8*, i8** %2
%28 = call i32 (i32, i8*, ...) @emitf(i32 1506, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %27)
%29 = load i32, i32* %3
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 16
store i32 %31, i32* %1
%32 = call i32 (i32, i8*, ...) @emitf(i32 1507, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %29, i32 %31)
%33 = call i32 (i32, i8*, ...) @emitf(i32 1508, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %34
34: ; preds = %25
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %22
37: ; preds = %22
%38 = load i8*, i8** %2
%39 = call i32 @emit_label(i8* %38)
%40 = call i32 (i32, i8*, ...) @emitf(i32 1511, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 304)
ret i32 304
}

LLVM IR (-O2):
@.str = [22 x i8] c"\09mov %%rdi, %d(%%rsp)\00"
@.str.1 = [22 x i8] c"\09mov %%rsi, %d(%%rsp)\00"
@.str.2 = [22 x i8] c"\09mov %%rdx, %d(%%rsp)\00"
@.str.3 = [22 x i8] c"\09mov %%rcx, %d(%%rsp)\00"
@.str.4 = [21 x i8] c"\09mov %%r8, %d(%%rsp)\00"
@.str.5 = [21 x i8] c"\09mov %%r9, %d(%%rsp)\00"
@.str.6 = [17 x i8] c"\09test %%al, %%al\00"
@.str.7 = [7 x i8] c"\09jz %s\00"
@.str.8 = [26 x i8] c"\09movsd %%xmm%d, %d(%%rsp)\00"
@.str.9 = [14 x i8] c"\09sub $1, %%al\00"
@.str.10 = [16 x i8] c"\09sub $%d, %%rsp\00"
define i32 @emit_regsave_area() {
%1 = tail call i32 (i32, i8*, ...) @emitf(i32 1497, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 -304)
%2 = tail call i32 (i32, i8*, ...) @emitf(i32 1498, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 -296)
%3 = tail call i32 (i32, i8*, ...) @emitf(i32 1499, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 -288)
%4 = tail call i32 (i32, i8*, ...) @emitf(i32 1500, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 -280)
%5 = tail call i32 (i32, i8*, ...) @emitf(i32 1501, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 -272)
%6 = tail call i32 (i32, i8*, ...) @emitf(i32 1502, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 -264)
%7 = tail call i8* (...) @make_label()
br label %11
8: ; preds = %11
%9 = tail call i32 @emit_label(i8* %7)
%10 = tail call i32 (i32, i8*, ...) @emitf(i32 1511, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 304)
ret i32 304
11: ; preds = %0, %11
%12 = phi i32 [ 0, %0 ], [ %19, %11 ]
%13 = phi i32 [ -272, %0 ], [ %16, %11 ]
%14 = tail call i32 (i32, i8*, ...) @emitf(i32 1505, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%15 = tail call i32 (i32, i8*, ...) @emitf(i32 1506, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %7)
%16 = add nuw nsw i32 %13, 16
%17 = tail call i32 (i32, i8*, ...) @emitf(i32 1507, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %12, i32 %16)
%18 = tail call i32 (i32, i8*, ...) @emitf(i32 1508, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%19 = add nuw nsw i32 %12, 1
%20 = icmp eq i32 %19, 16
br i1 %20, label %8, label %11
}