#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*/ fputc(char, int /*<<< orphan*/ *);
void write_octave(FILE *file, int octave) {
  int i;
  if (octave > 2)
    for (i = 2; i != octave; i++)
      fputc('\'', file);
  if (octave < 2)
    for (i = 2; i != octave; i--)
      fputc(',', file);
}


x86 assembly (clang, -O0):
<write_octave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    115d <write_octave+0x4d>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1158 <write_octave+0x48>
mov    -0x8(%rbp),%rsi
mov    $0x27,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <write_octave+0x20>
jmp    115d <write_octave+0x4d>
cmpl   $0x2,-0xc(%rbp)
jge    119b <write_octave+0x8b>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1196 <write_octave+0x86>
mov    -0x8(%rbp),%rsi
mov    $0x2c,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    116e <write_octave+0x5e>
jmp    119b <write_octave+0x8b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_octave>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
cmp    $0x3,%esi
jl     1142 <write_octave+0x32>
lea    -0x2(%rbx),%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x27,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <write_octave+0x20>
cmp    $0x1,%ebx
jg     1161 <write_octave+0x51>
add    $0xfffffffe,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2c,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
inc    %ebx
jne    1150 <write_octave+0x40>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @write_octave(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %20
8: ; preds = %2
store i32 2, i32* %5
br label %9
9: ; preds = %16, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32*, i32** %3
%15 = call i32 @fputc(i8 signext 39, i32* %14)
br label %16
16: ; preds = %13
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %9
19: ; preds = %9
br label %20
20: ; preds = %19, %2
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 2
br i1 %22, label %23, label %35
23: ; preds = %20
store i32 2, i32* %5
br label %24
24: ; preds = %31, %23
%25 = load i32, i32* %5
%26 = load i32, i32* %4
%27 = icmp ne i32 %25, %26
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = load i32*, i32** %3
%30 = call i32 @fputc(i8 signext 44, i32* %29)
br label %31
31: ; preds = %28
%32 = load i32, i32* %5
%33 = add nsw i32 %32, -1
store i32 %33, i32* %5
br label %24
34: ; preds = %24
br label %35
35: ; preds = %34, %20
ret void
}

LLVM IR (-O2):
define void @write_octave(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 2
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 2, %2 ]
%6 = tail call i32 @fputc(i8 signext 39, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = icmp slt i32 %1, 2
br i1 %10, label %11, label %16
11: ; preds = %9, %11
%12 = phi i32 [ %14, %11 ], [ 2, %9 ]
%13 = tail call i32 @fputc(i8 signext 44, i32* %0)
%14 = add nsw i32 %12, -1
%15 = icmp eq i32 %14, %1
br i1 %15, label %16, label %11
16: ; preds = %11, %9
ret void
}