#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void writePadding(FILE *out_file) {
  int i;
  for (i = 58; i < 66; ++i) {
    fputc(0x10, out_file);
    fputc(0x02, out_file);
    fputc(0x00, out_file);
    fputc(0x00, out_file);
    fputc(0x01, out_file);
    fputc(0x00, out_file);
    fputc(0x00, out_file);
    fputc(0x00, out_file);
  }
  fputc(0x30, out_file);
}


x86 assembly (clang, -O0):
<writePadding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x3a,-0xc(%rbp)
cmpl   $0x42,-0xc(%rbp)
jge    119c <writePadding+0x8c>
mov    -0x8(%rbp),%rsi
mov    $0x10,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <writePadding+0x13>
mov    -0x8(%rbp),%rsi
mov    $0x30,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writePadding>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x8,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x10,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1120 <writePadding+0x10>
mov    $0x30,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

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

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