#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*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void print_hrt(char cat_number[]) {
  char hrt[25];
  int i, j;
  printf("        <rect x=\"57.00\" y=\"28.00\" width=\"61.00\" "
         "height=\"5.00\" fill=\"white\" />\n");
  strcpy(hrt, "C ");
  for (i = 0, j = 2; i < strlen(cat_number); i++) {
    hrt[j] = cat_number[i];
    j++;
    if ((i % 2) != 0) {
      hrt[j] = ' ';
      j++;
    }
  }
  hrt[j] = '\0';
  printf("        <text x=\"58.00\" y=\"32.00\" font-family=\"Verdana\" "
         "font-size=\"5\">%s</text>\n",
         hrt);
}


x86 assembly (clang, -O0):
<print_hrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xefa(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jge    11d9 <print_hrt+0xa9>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x38(%rbp),%rax
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11c6 <print_hrt+0x96>
movslq -0x38(%rbp),%rax
movb   $0x20,-0x30(%rbp,%rax,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11cb <print_hrt+0x9b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1168 <print_hrt+0x38>
movslq -0x38(%rbp),%rax
movb   $0x0,-0x30(%rbp,%rax,1)
lea    -0x30(%rbp),%rsi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hrt>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%r14
lea    0xf01(%rip),%rdi
call   1040 <puts@plt>
lea    0xea1(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    11b9 <print_hrt+0x79>
mov    $0x2,%eax
xor    %ebx,%ebx
jmp    1197 <print_hrt+0x57>
nopl   0x0(%rax)
add    $0x1,%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
mov    %r15d,%eax
cmp    %rcx,%rbx
jge    11bf <print_hrt+0x7f>
movzbl (%r14,%rbx,1),%ecx
movslq %eax,%r15
mov    %cl,(%rsp,%r15,1)
add    $0x1,%r15
test   $0x1,%bl
je     1180 <print_hrt+0x40>
movb   $0x20,(%rsp,%r15,1)
add    $0x2,%eax
mov    %eax,%r15d
jmp    1180 <print_hrt+0x40>
mov    $0x2,%r15d
movslq %r15d,%rax
movb   $0x0,(%rsp,%rax,1)
lea    0xe36(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [79 x i8] c" <rect x=\2257.00\22 y=\2228.00\22 width=\2261.00\22 height=\225.00\22 fill=\22white\22 />\0A\00"
@.str.1 = [3 x i8] c"C \00"
@.str.2 = [81 x i8] c" <text x=\2258.00\22 y=\2232.00\22 font-family=\22Verdana\22 font-size=\225\22>%s</text>\0A\00"
define void @print_hrt(i8* %0) {
%2 = alloca i8*
%3 = alloca [25 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
store i32 2, i32* %5
br label %9
9: ; preds = %35, %1
%10 = load i32, i32* %4
%11 = load i8*, i8** %2
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %38
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 %21
store i8 %19, i8* %22
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
%25 = load i32, i32* %4
%26 = srem i32 %25, 2
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %14
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 %30
store i8 32, i8* %31
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %34
34: ; preds = %28, %14
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %9
38: ; preds = %9
%39 = load i32, i32* %5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 %40
store i8 0, i8* %41
%42 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), i8* %42)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"C \00"
@.str.2 = [81 x i8] c" <text x=\2258.00\22 y=\2232.00\22 font-family=\22Verdana\22 font-size=\225\22>%s</text>\0A\00"
@str = [78 x i8] c" <rect x=\2257.00\22 y=\2228.00\22 width=\2261.00\22 height=\225.00\22 fill=\22white\22 />\00"
define void @print_hrt(i8* %0) {
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%5 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @strlen(i8* %0)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %28
8: ; preds = %1, %22
%9 = phi i64 [ %24, %22 ], [ 0, %1 ]
%10 = phi i32 [ %23, %22 ], [ 2, %1 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = sext i32 %10 to i64
%14 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 %13
store i8 %12, i8* %14
%15 = add nsw i32 %10, 1
%16 = and i64 %9, 1
%17 = icmp eq i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %8
%19 = sext i32 %15 to i64
%20 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 %19
store i8 32, i8* %20
%21 = add nsw i32 %10, 2
br label %22
22: ; preds = %8, %18
%23 = phi i32 [ %21, %18 ], [ %15, %8 ]
%24 = add nuw nsw i64 %9, 1
%25 = call i32 @strlen(i8* %0)
%26 = sext i32 %25 to i64
%27 = icmp slt i64 %24, %26
br i1 %27, label %8, label %28
28: ; preds = %22, %1
%29 = phi i32 [ 2, %1 ], [ %23, %22 ]
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 %30
store i8 0, i8* %31
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}