#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct lfr_filter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lfr_filter_getf(struct lfr_filter *, int, double *);
char *lfr_info_name(int);
int /*<<< orphan*/ printf(char *, char const *, double);
void dump_filter(struct lfr_filter *fp) {
  int i;
  const char *name;
  double v;
  for (i = 0;; ++i) {
    name = lfr_info_name(i);
    if (!name)
      break;
    lfr_filter_getf(fp, i, &v);
    printf("%s: %f\n", name, v);
  }
}


x86 assembly (clang, -O0):
<dump_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <lfr_info_name@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115f <dump_filter+0x2f>
jmp    1192 <dump_filter+0x62>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x20(%rbp),%rdx
call   1050 <lfr_filter_getf@plt>
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <dump_filter+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_filter>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r12
xor    %ebp,%ebp
xor    %edi,%edi
call   1040 <lfr_info_name@plt>
test   %rax,%rax
je     1190 <dump_filter+0x60>
mov    %rax,%rbx
lea    0x8(%rsp),%r14
lea    0xea4(%rip),%r15
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1050 <lfr_filter_getf@plt>
movsd  0x8(%rsp),%xmm0
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %ebp,%edi
call   1040 <lfr_info_name@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1160 <dump_filter+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.lfr_filter = type { i32 }
@.str = [8 x i8] c"%s: %f\0A\00"
define void @dump_filter(%struct.lfr_filter* %0) {
%2 = alloca %struct.lfr_filter*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca double
store %struct.lfr_filter* %0, %struct.lfr_filter** %2
store i32 0, i32* %3
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %3
%8 = call i8* @lfr_info_name(i32 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %6
br label %22
12: ; preds = %6
%13 = load %struct.lfr_filter*, %struct.lfr_filter** %2
%14 = load i32, i32* %3
%15 = call i32 @lfr_filter_getf(%struct.lfr_filter* %13, i32 %14, double* %5)
%16 = load i8*, i8** %4
%17 = load double, double* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %16, double %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %6
22: ; preds = %11
ret void
}

LLVM IR (-O2):
%struct.lfr_filter = type { i32 }
@.str = [8 x i8] c"%s: %f\0A\00"
define void @dump_filter(%struct.lfr_filter* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i8* @lfr_info_name(i32 0)
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i8* [ %13, %6 ], [ %4, %1 ]
%8 = phi i32 [ %12, %6 ], [ 0, %1 ]
%9 = call i32 @lfr_filter_getf(%struct.lfr_filter* %0, i32 %8, double* %2)
%10 = load double, double* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, double %10)
%12 = add nuw nsw i32 %8, 1
%13 = call i8* @lfr_info_name(i32 %12)
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %1
ret void
}