#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 pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_part_cmdload(struct driver_pmd *, struct pmd_part *);
void pmd_cmd_null_5(struct fmdriver_work *work, struct driver_pmd *pmd,
                    struct pmd_part *part) {
  (void)work;
  for (int i = 0; i < 5; i++) {
    pmd_part_cmdload(pmd, part);
  }
}


x86 assembly (clang, -O0):
<pmd_cmd_null_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    1150 <pmd_cmd_null_5+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <pmd_part_cmdload@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <pmd_cmd_null_5+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmd_cmd_null_5>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <pmd_part_cmdload@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <pmd_part_cmdload@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <pmd_part_cmdload@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <pmd_part_cmdload@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pmd_part_cmdload@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmd_null_5(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
%7 = alloca i32
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%8 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
store i32 0, i32* %7
br label %9
9: ; preds = %16, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%14 = load %struct.pmd_part*, %struct.pmd_part** %6
%15 = call i32 @pmd_part_cmdload(%struct.driver_pmd* %13, %struct.pmd_part* %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmd_null_5(%struct.fmdriver_work* nocapture readnone %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
%5 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
%6 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
%7 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
%8 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
ret void
}