#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*/ putchar(int);
void dump_sector(int c, int h, int s) {
  int a;
  putchar(c);
  putchar(h);
  putchar(c);
  putchar(h);
  putchar(s);
  putchar(3);
  putchar(0);
  putchar(4);
  for (a = 0; a < 1024; a++)
    putchar(0xe5);
}


x86 assembly (clang, -O0):
<dump_sector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x400,-0x10(%rbp)
jge    1190 <dump_sector+0x80>
mov    $0xe5,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116b <dump_sector+0x5b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sector>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
call   1030 <putchar@plt>
mov    $0x400,%ebx
nopl   (%rax)
mov    $0xe5,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1160 <dump_sector+0x50>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @dump_sector(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = call i32 @putchar(i32 %8)
%10 = load i32, i32* %5
%11 = call i32 @putchar(i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @putchar(i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @putchar(i32 %14)
%16 = load i32, i32* %6
%17 = call i32 @putchar(i32 %16)
%18 = call i32 @putchar(i32 3)
%19 = call i32 @putchar(i32 0)
%20 = call i32 @putchar(i32 4)
store i32 0, i32* %7
br label %21
21: ; preds = %26, %3
%22 = load i32, i32* %7
%23 = icmp slt i32 %22, 1024
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = call i32 @putchar(i32 229)
br label %26
26: ; preds = %24
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %21
29: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @dump_sector(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @putchar(i32 %0)
%5 = tail call i32 @putchar(i32 %1)
%6 = tail call i32 @putchar(i32 %0)
%7 = tail call i32 @putchar(i32 %1)
%8 = tail call i32 @putchar(i32 %2)
%9 = tail call i32 @putchar(i32 3)
%10 = tail call i32 @putchar(i32 0)
%11 = tail call i32 @putchar(i32 4)
br label %12
12: ; preds = %3, %12
%13 = phi i32 [ 0, %3 ], [ %15, %12 ]
%14 = tail call i32 @putchar(i32 229)
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, 1024
br i1 %16, label %17, label %12
17: ; preds = %12
ret void
}