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

/* Variables and functions */
int /*<<< orphan*/ uio_single_mmap(struct uio_info_t *, int, int);
void uio_mmap(struct uio_info_t *info, int fd) {
  int map_num;
  if (!fd)
    return;
  for (map_num = 0; map_num < 5; map_num++)
    uio_single_mmap(info, map_num, fd);
}


x86 assembly (clang, -O0):
<uio_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112e <uio_mmap+0x1e>
jmp    115c <uio_mmap+0x4c>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    115c <uio_mmap+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <uio_single_mmap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <uio_mmap+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uio_mmap>:
test   %esi,%esi
je     1169 <uio_mmap+0x59>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <uio_single_mmap@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <uio_single_mmap@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    %ebx,%edx
call   1030 <uio_single_mmap@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebx,%edx
call   1030 <uio_single_mmap@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <uio_single_mmap@plt>
ret

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

LLVM IR (-O2):
%struct.uio_info_t = type { i32 }
define void @uio_mmap(%struct.uio_info_t* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @uio_single_mmap(%struct.uio_info_t* %0, i32 0, i32 %1)
%6 = tail call i32 @uio_single_mmap(%struct.uio_info_t* %0, i32 1, i32 %1)
%7 = tail call i32 @uio_single_mmap(%struct.uio_info_t* %0, i32 2, i32 %1)
%8 = tail call i32 @uio_single_mmap(%struct.uio_info_t* %0, i32 3, i32 %1)
%9 = tail call i32 @uio_single_mmap(%struct.uio_info_t* %0, i32 4, i32 %1)
br label %10
10: ; preds = %4, %2
ret void
}