#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 *);
void createBranch(FILE *fp, int size) {
  int i = 0;
  do {
    if (i == 0 || i % 10 == 0)
      fprintf(fp, "v ");
    else
      fprintf(fp, "- ");
    i++;
  } while (i < ((size - 1) * 10) + 1);
  fprintf(fp, "\n");
}


x86 assembly (clang, -O0):
<createBranch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1144 <createBranch+0x34>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1159 <createBranch+0x49>
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1169 <createBranch+0x59>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
imul   $0xa,%ecx,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jl     1126 <createBranch+0x16>
mov    -0x8(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createBranch>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
lea    (%rsi,%rsi,4),%eax
add    %eax,%eax
add    $0xfffffff7,%eax
cmp    $0x2,%eax
mov    $0x1,%r12d
cmovge %eax,%r12d
xor    %ebx,%ebx
mov    $0xcccccccd,%r15d
lea    0xeae(%rip),%rbp
xor    %r13d,%r13d
jmp    1185 <createBranch+0x65>
nopw   0x0(%rax,%rax,1)
test   %r13d,%r13d
cmove  %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
add    $0x1,%r13d
add    $0xffffffff,%ebx
cmp    %r13d,%r12d
je     11a5 <createBranch+0x85>
mov    %r13d,%eax
imul   %r15,%rax
shr    $0x23,%rax
lea    (%rax,%rax,4),%eax
add    %eax,%eax
mov    %rbp,%rdi
add    %ebx,%eax
je     1160 <createBranch+0x40>
lea    0xe60(%rip),%rdi
jmp    1160 <createBranch+0x40>
mov    $0xa,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"v \00"
@.str.1 = [3 x i8] c"- \00"
define void @createBranch(i32* nocapture %0, i32 %1) {
%3 = mul i32 %1, 10
%4 = add i32 %3, -9
%5 = call i32 @llvm.smax.i32(i32 %4, i32 1)
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ 0, %2 ], [ %14, %6 ]
%8 = icmp eq i32 %7, 0
%9 = urem i32 %7, 10
%10 = icmp eq i32 %9, 0
%11 = or i1 %8, %10
%12 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%13 = tail call i64 @fwrite(i8* %12, i64 2, i64 1, i32* %0)
%14 = add nuw nsw i32 %7, 1
%15 = icmp eq i32 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %6
%17 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}