declist(sclass) {
  register sc, elsize, offset;
  int type;
  offset = 0;
  sc = sclass;
  while ((elsize = getkeywords(&sclass, &type)) != -1) {
    offset = declare(sclass, type, offset, elsize);
    sclass = sc;
  }
  return (offset + align(0, offset, 0));
}


x86 assembly (clang, -O0):
<declist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <getkeywords@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
je     1184 <declist+0x54>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x0,%al
call   1030 <declare@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <declist+0x18>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%esi
xor    %edx,%edx
mov    %edx,%edi
mov    $0x0,%al
call   1040 <align@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declist>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,(%rsp)
xor    %ebp,%ebp
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <getkeywords@plt>
cmp    $0xffffffff,%eax
je     1189 <declist+0x59>
mov    %rsp,%r14
lea    0x4(%rsp),%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <declare@plt>
mov    %eax,%ebp
mov    %ebx,(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <getkeywords@plt>
cmp    $0xffffffff,%eax
jne    1160 <declist+0x30>
xor    %edi,%edi
mov    %ebp,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <align@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @declist(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %5
%7 = load i32, i32* %2
store i32 %7, i32* %3
br label %8
8: ; preds = %11, %1
%9 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @getkeywords to i32 (i32*, i32*, ...)*)(i32* %2, i32* %6)
store i32 %9, i32* %4
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @declare to i32 (i32, i32, i32, i32, ...)*)(i32 %12, i32 %13, i32 %14, i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %3
store i32 %17, i32* %2
br label %8
18: ; preds = %8
%19 = load i32, i32* %5
%20 = load i32, i32* %5
%21 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @align to i32 (i32, i32, i32, ...)*)(i32 0, i32 %20, i32 0)
%22 = add nsw i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @declist(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @getkeywords to i32 (i32*, i32*, ...)*)(i32* %2, i32* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %15, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %13, %7 ], [ %5, %1 ]
%9 = phi i32 [ %12, %7 ], [ 0, %1 ]
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @declare to i32 (i32, i32, i32, i32, ...)*)(i32 %10, i32 %11, i32 %9, i32 %8)
store i32 %0, i32* %2
%13 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @getkeywords to i32 (i32*, i32*, ...)*)(i32* %2, i32* %3)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %7
15: ; preds = %7, %1
%16 = phi i32 [ 0, %1 ], [ %12, %7 ]
%17 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @align to i32 (i32, i32, i32, ...)*)(i32 0, i32 %16, i32 0)
%18 = add nsw i32 %17, %16
ret i32 %18
}