#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void write_comment(unsigned int indent, FILE *f, const char *comment) {
  do {
    unsigned int _n;
    for (_n = 0; _n < indent; _n++)
      fputc('\t', f);
    fprintf(f, "/* ");
  } while (0);
  do {
    unsigned int _n;
    for (_n = 0; _n < indent; _n++)
      fputc('\t', f);
    fprintf(f, "%s */\n", comment);
  } while (0);
}


x86 assembly (clang, -O0):
<write_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1162 <write_comment+0x42>
mov    -0x10(%rbp),%rsi
mov    $0x9,%edi
call   1030 <fputc@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <write_comment+0x1a>
mov    -0x10(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1179 <write_comment+0x59>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    11a8 <write_comment+0x88>
mov    -0x10(%rbp),%rsi
mov    $0x9,%edi
call   1030 <fputc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1180 <write_comment+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_comment>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
test   %edi,%edi
je     1194 <write_comment+0x64>
mov    %edi,%ebx
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x9,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1150 <write_comment+0x20>
lea    0xe97(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fwrite@plt>
test   %ebx,%ebx
je     11ad <write_comment+0x7d>
nop
mov    $0x9,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1180 <write_comment+0x50>
jmp    11ad <write_comment+0x7d>
lea    0xe65(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fwrite@plt>
lea    0xe50(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"/* \00"
@.str.1 = [7 x i8] c"%s */\0A\00"
define void @write_comment(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
br label %9
9: ; preds = %3
store i32 0, i32* %7
br label %10
10: ; preds = %17, %9
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32*, i32** %5
%16 = call i32 @fputc(i8 signext 9, i32* %15)
br label %17
17: ; preds = %14
%18 = load i32, i32* %7
%19 = add i32 %18, 1
store i32 %19, i32* %7
br label %10
20: ; preds = %10
%21 = load i32*, i32** %5
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %20
br label %24
24: ; preds = %23
store i32 0, i32* %8
br label %25
25: ; preds = %32, %24
%26 = load i32, i32* %8
%27 = load i32, i32* %4
%28 = icmp ult i32 %26, %27
br i1 %28, label %29, label %35
29: ; preds = %25
%30 = load i32*, i32** %5
%31 = call i32 @fputc(i8 signext 9, i32* %30)
br label %32
32: ; preds = %29
%33 = load i32, i32* %8
%34 = add i32 %33, 1
store i32 %34, i32* %8
br label %25
35: ; preds = %25
%36 = load i32*, i32** %5
%37 = load i8*, i8** %6
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %35
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"/* \00"
@.str.1 = [7 x i8] c"%s */\0A\00"
define void @write_comment(i32 %0, i32* nocapture %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %1)
br label %19
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @fputc(i8 signext 9, i32* %1)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %7
12: ; preds = %7
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %1)
br i1 %4, label %19, label %14
14: ; preds = %12, %14
%15 = phi i32 [ %17, %14 ], [ 0, %12 ]
%16 = tail call i32 @fputc(i8 signext 9, i32* %1)
%17 = add nuw i32 %15, 1
%18 = icmp eq i32 %17, %0
br i1 %18, label %19, label %14
19: ; preds = %14, %5, %12
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}