brack(n, c) int n, c;
{
  int j;
  down(n - 1);
  for (j = 0; j < n; j++) {
    putchar(c);
    back(1);
    up(2);
  }
  down(n + 1);
  fwd(1);
}


x86 assembly (clang, -O0):
<brack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x0,%al
call   1060 <down@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ae <brack+0x5e>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <putchar@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <back@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   1070 <up@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1172 <brack+0x22>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1060 <down@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <fwd@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brack>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
lea    -0x1(%r14),%edi
xor    %eax,%eax
call   1060 <down@plt>
test   %r14d,%r14d
jle    1196 <brack+0x46>
mov    %r14d,%ebx
nopl   0x0(%rax)
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <putchar@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <back@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1070 <up@plt>
add    $0xffffffff,%ebx
jne    1170 <brack+0x20>
add    $0x1,%r14d
mov    %r14d,%edi
xor    %eax,%eax
call   1060 <down@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fwd@plt>

LLVM IR (-O0):
define i32 @brack(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @down to i32 (i32, ...)*)(i32 %8)
store i32 0, i32* %6
br label %10
10: ; preds = %19, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32, i32* %5
%16 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %15)
%17 = call i32 (i32, ...) bitcast (i32 (...)* @back to i32 (i32, ...)*)(i32 1)
%18 = call i32 (i32, ...) bitcast (i32 (...)* @up to i32 (i32, ...)*)(i32 2)
br label %19
19: ; preds = %14
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %10
22: ; preds = %10
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
%25 = call i32 (i32, ...) bitcast (i32 (...)* @down to i32 (i32, ...)*)(i32 %24)
%26 = call i32 (i32, ...) bitcast (i32 (...)* @fwd to i32 (i32, ...)*)(i32 1)
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @brack(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @down to i32 (i32, ...)*)(i32 %3)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %13
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ 0, %2 ]
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %1)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @back to i32 (i32, ...)*)(i32 1)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @up to i32 (i32, ...)*)(i32 2)
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = add nsw i32 %0, 1
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @down to i32 (i32, ...)*)(i32 %14)
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @fwd to i32 (i32, ...)*)(i32 1)
ret i32 undef
}