#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 uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char const *);
void print_ophead(uint16_t op, const char *name, int index) {
  assert(strlen(name) < 6);
  printf("%04X: [%04X]  %s", index + 0x200, op, name);
  for (int i = 0; i < 6 - strlen(name); i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<print_ophead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x14(%rbp),%esi
add    $0x200,%esi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x1c(%rbp),%eax
mov    $0x6,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    11bf <print_ophead+0x8f>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1180 <print_ophead+0x50>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ophead>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x6,%eax
setl   %dil
call   1060 <assert@plt>
add    $0x200,%r15d
lea    0xe8c(%rip),%rdi
xor    %ebp,%ebp
mov    %r15d,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x5,%eax
jg     11c0 <print_ophead+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x6,%ecx
sub    %eax,%ecx
cmp    %ecx,%ebp
jl     11a0 <print_ophead+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%04X: [%04X] %s\00"
@.str.1 = [2 x i8] c" \00"
define void @print_ophead(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 512
%15 = load i32, i32* %4
%16 = load i8*, i8** %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i8* %16)
store i32 0, i32* %7
br label %18
18: ; preds = %26, %3
%19 = load i32, i32* %7
%20 = load i8*, i8** %5
%21 = call i32 @strlen(i8* %20)
%22 = sub nsw i32 6, %21
%23 = icmp slt i32 %19, %22
br i1 %23, label %24, label %29
24: ; preds = %18
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %18
29: ; preds = %18
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%04X: [%04X] %s\00"
define void @print_ophead(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %4, 6
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = add nsw i32 %2, 512
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %0, i8* %1)
%10 = tail call i32 @strlen(i8* %1)
%11 = icmp slt i32 %10, 6
br i1 %11, label %13, label %12
12: ; preds = %13, %3
ret void
13: ; preds = %3, %13
%14 = phi i32 [ %16, %13 ], [ 0, %3 ]
%15 = tail call i32 @putchar(i32 32)
%16 = add nuw nsw i32 %14, 1
%17 = tail call i32 @strlen(i8* %1)
%18 = sub nsw i32 6, %17
%19 = icmp slt i32 %16, %18
br i1 %19, label %13, label %12
}