#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 dbt {
  int dummy;
};

/* Variables and functions */
struct dbt *dbtgetnxt(struct dbt *);
int /*<<< orphan*/ flistt(struct dbt *, char);
struct dbt *timeparse(char const *);
void flist(const char *stime, char ext2) {
  if (stime)
    flistt(timeparse(stime), ext2);
  else {
    struct dbt *dt = NULL;
    while ((dt = dbtgetnxt(dt)))
      flistt(dt, ext2);
  }
}


x86 assembly (clang, -O0):
<flist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1167 <flist+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <timeparse@plt>
mov    %rax,%rdi
movsbl -0x9(%rbp),%esi
call   1040 <flistt@plt>
jmp    119d <flist+0x6d>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <dbtgetnxt@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1198 <flist+0x68>
mov    -0x18(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <flistt@plt>
jmp    116f <flist+0x3f>
jmp    119d <flist+0x6d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flist>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %rdi,%rdi
je     1151 <flist+0x21>
call   1030 <timeparse@plt>
movsbl %bpl,%esi
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <flistt@plt>
xor    %edi,%edi
call   1050 <dbtgetnxt@plt>
test   %rax,%rax
je     118a <flist+0x5a>
mov    %rax,%rbx
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <flistt@plt>
mov    %rbx,%rdi
call   1050 <dbtgetnxt@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1170 <flist+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.dbt = type { i32 }
define void @flist(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca %struct.dbt*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call %struct.dbt* @timeparse(i8* %9)
%11 = load i8, i8* %4
%12 = call i32 @flistt(%struct.dbt* %10, i8 signext %11)
br label %23
13: ; preds = %2
store %struct.dbt* null, %struct.dbt** %5
br label %14
14: ; preds = %18, %13
%15 = load %struct.dbt*, %struct.dbt** %5
%16 = call %struct.dbt* @dbtgetnxt(%struct.dbt* %15)
store %struct.dbt* %16, %struct.dbt** %5
%17 = icmp ne %struct.dbt* %16, null
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load %struct.dbt*, %struct.dbt** %5
%20 = load i8, i8* %4
%21 = call i32 @flistt(%struct.dbt* %19, i8 signext %20)
br label %14
22: ; preds = %14
br label %23
23: ; preds = %22, %8
ret void
}

LLVM IR (-O2):
%struct.dbt = type { i32 }
define void @flist(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call %struct.dbt* @dbtgetnxt(%struct.dbt* null)
%6 = icmp eq %struct.dbt* %5, null
br i1 %6, label %15, label %10
7: ; preds = %2
%8 = tail call %struct.dbt* @timeparse(i8* %0)
%9 = tail call i32 @flistt(%struct.dbt* %8, i8 signext %1)
br label %15
10: ; preds = %4, %10
%11 = phi %struct.dbt* [ %13, %10 ], [ %5, %4 ]
%12 = tail call i32 @flistt(%struct.dbt* %11, i8 signext %1)
%13 = tail call %struct.dbt* @dbtgetnxt(%struct.dbt* %11)
%14 = icmp eq %struct.dbt* %13, null
br i1 %14, label %15, label %10
15: ; preds = %10, %4, %7
ret void
}