#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 */
scalar_t__ EOF;
scalar_t__ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ nrerror(char *);
void print_sep(FILE *fp, char x, long n) {
  long i;
  for (i = 1; i <= n; i++)
    if (fputc(x, fp) == EOF)
      nrerror("error writing characters to the stream");
  if (fputc('\n', fp) == EOF)
    nrerror("error writing '\n' to the stream");
}


x86 assembly (clang, -O0):
<print_sep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     118d <print_sep+0x6d>
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
jne    1177 <print_sep+0x57>
lea    0xe8e(%rip),%rdi
call   1030 <nrerror@plt>
jmp    117c <print_sep+0x5c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113e <print_sep+0x1e>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    0x2e46(%rip),%rcx
cmp    (%rcx),%rax
jne    11b7 <print_sep+0x97>
lea    0xe75(%rip),%rdi
call   1030 <nrerror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sep>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
test   %rdx,%rdx
jle    1170 <print_sep+0x50>
mov    %rdx,%rbx
movsbl %sil,%ebp
mov    0x2eaa(%rip),%r12
lea    0xebb(%rip),%r15
jmp    1156 <print_sep+0x36>
nopw   0x0(%rax,%rax,1)
add    $0xffffffffffffffff,%rbx
je     1170 <print_sep+0x50>
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
cmp    (%r12),%rax
jne    1150 <print_sep+0x30>
mov    %r15,%rdi
call   1030 <nrerror@plt>
jmp    1150 <print_sep+0x30>
mov    $0xa,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    0x2e64(%rip),%rcx
cmp    (%rcx),%rax
jne    119d <print_sep+0x7d>
lea    0xe97(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <nrerror@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [39 x i8] c"error writing characters to the stream\00"
@.str.1 = [32 x i8] c"error writing '\0A' to the stream\00"
define void @print_sep(i32* %0, i8 signext %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
store i64 1, i64* %7
br label %8
8: ; preds = %21, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp sle i64 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i8, i8* %5
%14 = load i32*, i32** %4
%15 = call i64 @fputc(i8 signext %13, i32* %14)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 @nrerror(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %12
br label %21
21: ; preds = %20
%22 = load i64, i64* %7
%23 = add nsw i64 %22, 1
store i64 %23, i64* %7
br label %8
24: ; preds = %8
%25 = load i32*, i32** %4
%26 = call i64 @fputc(i8 signext 10, i32* %25)
%27 = load i64, i64* @EOF
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29, %24
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [39 x i8] c"error writing characters to the stream\00"
@.str.1 = [32 x i8] c"error writing '\0A' to the stream\00"
define void @print_sep(i32* nocapture %0, i8 signext %1, i64 %2) {
%4 = icmp slt i64 %2, 1
br i1 %4, label %15, label %5
5: ; preds = %3, %12
%6 = phi i64 [ %13, %12 ], [ 1, %3 ]
%7 = tail call i64 @fputc(i8 signext %1, i32* %0)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @nrerror(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %5, %10
%13 = add nuw i64 %6, 1
%14 = icmp eq i64 %6, %2
br i1 %14, label %15, label %5
15: ; preds = %12, %3
%16 = tail call i64 @fputc(i8 signext 10, i32* %0)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
ret void
}