void print_comp_data(design) struct Design *design;
{
  void fprint_data();
  int i;
  i = 0;
  while (++i <= 10)
    fprint_data(design, i);
}


x86 assembly (clang, -O0):
<print_comp_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
jg     1148 <print_comp_data+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <fprint_data@plt>
jmp    1123 <print_comp_data+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_comp_data>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprint_data@plt>

LLVM IR (-O0):
%struct.Design = type opaque
define void @print_comp_data(%struct.Design* %0) {
%2 = alloca %struct.Design*
%3 = alloca i32
store %struct.Design* %0, %struct.Design** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = icmp sle i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load %struct.Design*, %struct.Design** %2
%10 = load i32, i32* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.Design = type opaque
define void @print_comp_data(%struct.Design* %0) {
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 1)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 2)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 3)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 4)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 5)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 6)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 7)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 8)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 9)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 10)
ret void
}