#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*/ STDOUT_FILENO;
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void print_string(char *name) {
  char file_name[100];
  int name_size = 100;
  snprintf(file_name, name_size, "==> %s <==\n", name);
  int i;
  for (i = 0; i < 200; i++) {
    write(STDOUT_FILENO, &file_name[i], 1);
    if (file_name[i] == '\n') {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x64,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    -0x8(%rbp),%rcx
lea    0xeb8(%rip),%rdx
call   1040 <snprintf@plt>
movl   $0x0,-0x78(%rbp)
cmpl   $0xc8,-0x78(%rbp)
jge    11a9 <print_string+0x89>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
movslq -0x78(%rbp),%rax
lea    -0x70(%rbp),%rsi
add    %rax,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    1196 <print_string+0x76>
jmp    11a9 <print_string+0x89>
jmp    119b <print_string+0x7b>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1154 <print_string+0x34>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rcx
lea    0xecf(%rip),%rdx
mov    %rsp,%rdi
mov    $0x64,%esi
call   1040 <snprintf@plt>
xor    %ebx,%ebx
mov    0x2ea9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%edi
lea    (%rsp,%rbx,1),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0xa,(%rsp,%rbx,1)
je     1177 <print_string+0x57>
lea    0x1(%rbx),%rax
cmp    $0xc7,%rbx
mov    %rax,%rbx
jne    1150 <print_string+0x30>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"==> %s <==\0A\00"
@STDOUT_FILENO = global i32 0
define void @print_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 100, i32* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %4
%8 = load i8*, i8** %2
%9 = call i32 @snprintf(i8* %6, i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 0, i32* %5
br label %10
10: ; preds = %27, %1
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 200
br i1 %12, label %13, label %30
13: ; preds = %10
%14 = load i32, i32* @STDOUT_FILENO
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %16
%18 = call i32 @write(i32 %14, i8* %17, i32 1)
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 10
br i1 %24, label %25, label %26
25: ; preds = %13
br label %30
26: ; preds = %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %10
30: ; preds = %25, %10
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"==> %s <==\0A\00"
@STDOUT_FILENO = global i32 0
define void @print_string(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 100, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %5, %1
%6 = phi i64 [ 0, %1 ], [ %12, %5 ]
%7 = load i32, i32* @STDOUT_FILENO
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %6
%9 = call i32 @write(i32 %7, i8* %8, i32 1)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 10
%12 = add nuw nsw i64 %6, 1
%13 = icmp eq i64 %12, 200
%14 = select i1 %11, i1 true, i1 %13
br i1 %14, label %15, label %5
15: ; preds = %5
ret void
}