void wl_refresh(wtab) struct xgwindow *wtab[];
{
  struct xgwindow **pw, *w;
  int row, col;
  row = rowcursor();
  col = colcursor();
  for (pw = wtab; 1; pw++) {
    w = *pw;
    if (w == 0)
      break;
    wl_draw(w);
  }
  setcursor(row, col);
}


x86 assembly (clang, -O0):
<wl_refresh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <rowcursor@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <colcursor@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1177 <wl_refresh+0x37>
jmp    11ae <wl_refresh+0x6e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1192 <wl_refresh+0x52>
jmp    11ae <wl_refresh+0x6e>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <wl_draw@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1168 <wl_refresh+0x28>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x0,%al
call   1060 <setcursor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_refresh>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <rowcursor@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <colcursor@plt>
mov    %eax,%ebp
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1183 <wl_refresh+0x43>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <wl_draw@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1170 <wl_refresh+0x30>
mov    %r14d,%edi
mov    %ebp,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <setcursor@plt>

LLVM IR (-O0):
%struct.xgwindow = type opaque
%struct.xgwindow.0 = type opaque
define void @wl_refresh(%struct.xgwindow** %0) {
%2 = alloca %struct.xgwindow**
%3 = alloca %struct.xgwindow.0**
%4 = alloca %struct.xgwindow.0*
%5 = alloca i32
%6 = alloca i32
store %struct.xgwindow** %0, %struct.xgwindow*** %2
%7 = call i32 (...) @rowcursor()
store i32 %7, i32* %5
%8 = call i32 (...) @colcursor()
store i32 %8, i32* %6
%9 = load %struct.xgwindow**, %struct.xgwindow*** %2
%10 = bitcast %struct.xgwindow** %9 to %struct.xgwindow.0**
store %struct.xgwindow.0** %10, %struct.xgwindow.0*** %3
br label %11
11: ; preds = %21, %1
br i1 true, label %12, label %24
12: ; preds = %11
%13 = load %struct.xgwindow.0**, %struct.xgwindow.0*** %3
%14 = load %struct.xgwindow.0*, %struct.xgwindow.0** %13
store %struct.xgwindow.0* %14, %struct.xgwindow.0** %4
%15 = load %struct.xgwindow.0*, %struct.xgwindow.0** %4
%16 = icmp eq %struct.xgwindow.0* %15, null
br i1 %16, label %17, label %18
17: ; preds = %12
br label %24
18: ; preds = %12
%19 = load %struct.xgwindow.0*, %struct.xgwindow.0** %4
%20 = call i32 (%struct.xgwindow.0*, ...) bitcast (i32 (...)* @wl_draw to i32 (%struct.xgwindow.0*, ...)*)(%struct.xgwindow.0* %19)
br label %21
21: ; preds = %18
%22 = load %struct.xgwindow.0**, %struct.xgwindow.0*** %3
%23 = getelementptr inbounds %struct.xgwindow.0*, %struct.xgwindow.0** %22, i32 1
store %struct.xgwindow.0** %23, %struct.xgwindow.0*** %3
br label %11
24: ; preds = %17, %11
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = call i32 (i32, i32, ...) bitcast (i32 (...)* @setcursor to i32 (i32, i32, ...)*)(i32 %25, i32 %26)
ret void
}

LLVM IR (-O2):
%struct.xgwindow = type opaque
%struct.xgwindow.0 = type opaque
define void @wl_refresh(%struct.xgwindow** nocapture %0) {
%2 = tail call i32 (...) @rowcursor()
%3 = tail call i32 (...) @colcursor()
%4 = bitcast %struct.xgwindow** %0 to %struct.xgwindow.0**
%5 = load %struct.xgwindow.0*, %struct.xgwindow.0** %4
%6 = icmp eq %struct.xgwindow.0* %5, null
br i1 %6, label %14, label %7
7: ; preds = %1, %7
%8 = phi %struct.xgwindow.0* [ %12, %7 ], [ %5, %1 ]
%9 = phi %struct.xgwindow.0** [ %11, %7 ], [ %4, %1 ]
%10 = tail call i32 (%struct.xgwindow.0*, ...) bitcast (i32 (...)* @wl_draw to i32 (%struct.xgwindow.0*, ...)*)(%struct.xgwindow.0* %8)
%11 = getelementptr inbounds %struct.xgwindow.0*, %struct.xgwindow.0** %9, i64 1
%12 = load %struct.xgwindow.0*, %struct.xgwindow.0** %11
%13 = icmp eq %struct.xgwindow.0* %12, null
br i1 %13, label %14, label %7
14: ; preds = %7, %1
%15 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @setcursor to i32 (i32, i32, ...)*)(i32 %2, i32 %3)
ret void
}