#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 */
char *append(char *, char *);
int asmNewLine(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
scalar_t__ fwrite(char *, int, scalar_t__, int /*<<< orphan*/ *);
scalar_t__ strlen(char *);
int asmComment(FILE *file, char *string, int inner) {
  int i = 0;
  char *buffer = append(inner ? "\t; " : "; ", string);
  if (fwrite(buffer, sizeof(char), strlen(buffer), file) != strlen(buffer))
    goto out;
  i = asmNewLine(file);
out:
  free(buffer);
  return i;
}


x86 assembly (clang, -O0):
<asmComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
lea    0xe8d(%rip),%rdi
lea    0xe85(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <append@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1070 <fwrite@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     11d7 <asmComment+0x87>
jmp    11e3 <asmComment+0x93>
mov    -0x8(%rbp),%rdi
call   1050 <asmNewLine@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asmComment>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %edx,%edx
lea    0xe9e(%rip),%rax
lea    0xe96(%rip),%rdi
cmove  %rax,%rdi
call   1040 <append@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
mov    %r14,%rcx
call   1070 <fwrite@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1060 <strlen@plt>
xor    %ebp,%ebp
cmp    %rax,%r15
jne    11ad <asmComment+0x5d>
mov    %r14,%rdi
call   1050 <asmNewLine@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\09; \00"
@.str.1 = [3 x i8] c"; \00"
define i32 @asmComment(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%13 = load i8*, i8** %5
%14 = call i8* @append(i8* %12, i8* %13)
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = load i8*, i8** %8
%17 = call i64 @strlen(i8* %16)
%18 = load i32*, i32** %4
%19 = call i64 @fwrite(i8* %15, i32 1, i64 %17, i32* %18)
%20 = load i8*, i8** %8
%21 = call i64 @strlen(i8* %20)
%22 = icmp ne i64 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %3
br label %27
24: ; preds = %3
%25 = load i32*, i32** %4
%26 = call i32 @asmNewLine(i32* %25)
store i32 %26, i32* %7
br label %27
27: ; preds = %24, %23
%28 = load i8*, i8** %8
%29 = call i32 @free(i8* %28)
%30 = load i32, i32* %7
ret i32 %30
}

LLVM IR (-O2):
@.str = [4 x i8] c"\09; \00"
@.str.1 = [3 x i8] c"; \00"
define i32 @asmComment(i32* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%6 = tail call i8* @append(i8* %5, i8* %1)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %6)
%8 = tail call i64 @fwrite(i8* %6, i32 1, i64 %7, i32* %0)
%9 = tail call i64 @strlen(i8* dereferenceable(1) %6)
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = tail call i32 @asmNewLine(i32* %0)
br label %13
13: ; preds = %3, %11
%14 = phi i32 [ 0, %3 ], [ %12, %11 ]
%15 = tail call i32 @free(i8* %6)
ret i32 %14
}