void drawbox(left, top, right, bottom) {
  register int k;
  gotoxy(left, top);
  putch(0xda);
  for (k = left + 1; k < right; k++)
    putch(0xc4);
  putch(0xbf);
  for (k = top + 1; k < bottom; k++) {
    gotoxy(left, k);
    putch(0xb3);
    gotoxy(right, k);
    putch(0xb3);
  }
  gotoxy(left, bottom);
  putch(0xc0);
  for (k = left + 1; k < right; k++)
    putch(0xc4);
  putch(0xd9);
}


x86 assembly (clang, -O0):
<drawbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <gotoxy@plt>
mov    $0xda,%edi
mov    $0x0,%al
call   1040 <putch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117c <drawbox+0x5c>
mov    $0xc4,%edi
mov    $0x0,%al
call   1040 <putch@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <drawbox+0x36>
mov    $0xbf,%edi
mov    $0x0,%al
call   1040 <putch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11dd <drawbox+0xbd>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <gotoxy@plt>
mov    $0xb3,%edi
mov    $0x0,%al
call   1040 <putch@plt>
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <gotoxy@plt>
mov    $0xb3,%edi
mov    $0x0,%al
call   1040 <putch@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1191 <drawbox+0x71>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <gotoxy@plt>
mov    $0xc0,%edi
mov    $0x0,%al
call   1040 <putch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1225 <drawbox+0x105>
mov    $0xc4,%edi
mov    $0x0,%al
call   1040 <putch@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ff <drawbox+0xdf>
mov    $0xd9,%edi
mov    $0x0,%al
call   1040 <putch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawbox>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%r12d
xor    %eax,%eax
call   1030 <gotoxy@plt>
mov    $0xda,%edi
xor    %eax,%eax
call   1040 <putch@plt>
lea    0x1(%r12),%eax
mov    %r12d,%ebx
not    %ebx
mov    %eax,0x4(%rsp)
cmp    %r14d,%eax
jge    1172 <drawbox+0x52>
lea    (%rbx,%r14,1),%r13d
mov    $0xc4,%edi
xor    %eax,%eax
call   1040 <putch@plt>
add    $0xffffffff,%r13d
jne    1160 <drawbox+0x40>
mov    $0xbf,%edi
xor    %eax,%eax
call   1040 <putch@plt>
add    $0x1,%ebp
cmp    %r15d,%ebp
jge    11c8 <drawbox+0xa8>
cs nopw 0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <gotoxy@plt>
mov    $0xb3,%edi
xor    %eax,%eax
call   1040 <putch@plt>
mov    %r14d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <gotoxy@plt>
mov    $0xb3,%edi
xor    %eax,%eax
call   1040 <putch@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1190 <drawbox+0x70>
mov    %r12d,%edi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <gotoxy@plt>
mov    $0xc0,%edi
xor    %eax,%eax
call   1040 <putch@plt>
cmp    %r14d,0x4(%rsp)
jge    1201 <drawbox+0xe1>
add    %r14d,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0xc4,%edi
xor    %eax,%eax
call   1040 <putch@plt>
add    $0xffffffff,%ebx
jne    11f0 <drawbox+0xd0>
mov    $0xd9,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <putch@plt>

LLVM IR (-O0):
define void @drawbox(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %10, i32 %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 218)
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %9
br label %16
16: ; preds = %22, %4
%17 = load i32, i32* %9
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 196)
br label %22
22: ; preds = %20
%23 = load i32, i32* %9
%24 = add nsw i32 %23, 1
store i32 %24, i32* %9
br label %16
25: ; preds = %16
%26 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 191)
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %29
29: ; preds = %42, %25
%30 = load i32, i32* %9
%31 = load i32, i32* %8
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %45
33: ; preds = %29
%34 = load i32, i32* %5
%35 = load i32, i32* %9
%36 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %34, i32 %35)
%37 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 179)
%38 = load i32, i32* %7
%39 = load i32, i32* %9
%40 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %38, i32 %39)
%41 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 179)
br label %42
42: ; preds = %33
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %29
45: ; preds = %29
%46 = load i32, i32* %5
%47 = load i32, i32* %8
%48 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %46, i32 %47)
%49 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 192)
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %9
br label %52
52: ; preds = %58, %45
%53 = load i32, i32* %9
%54 = load i32, i32* %7
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %61
56: ; preds = %52
%57 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 196)
br label %58
58: ; preds = %56
%59 = load i32, i32* %9
%60 = add nsw i32 %59, 1
store i32 %60, i32* %9
br label %52
61: ; preds = %52
%62 = call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 217)
ret void
}

LLVM IR (-O2):
define void @drawbox(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 218)
%7 = add nsw i32 %0, 1
%8 = icmp slt i32 %7, %2
br i1 %8, label %9, label %14
9: ; preds = %4, %9
%10 = phi i32 [ %12, %9 ], [ %7, %4 ]
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 196)
%12 = add i32 %10, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %9
14: ; preds = %9, %4
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 191)
%16 = add nsw i32 %1, 1
%17 = icmp slt i32 %16, %3
br i1 %17, label %18, label %26
18: ; preds = %14, %18
%19 = phi i32 [ %24, %18 ], [ %16, %14 ]
%20 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %0, i32 %19)
%21 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 179)
%22 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %2, i32 %19)
%23 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 179)
%24 = add i32 %19, 1
%25 = icmp eq i32 %24, %3
br i1 %25, label %26, label %18
26: ; preds = %18, %14
%27 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gotoxy to i32 (i32, i32, ...)*)(i32 %0, i32 %3)
%28 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 192)
br i1 %8, label %29, label %34
29: ; preds = %26, %29
%30 = phi i32 [ %32, %29 ], [ %7, %26 ]
%31 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 196)
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %2
br i1 %33, label %34, label %29
34: ; preds = %29, %26
%35 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 217)
ret void
}