#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char *);
void midnam_avail_channel(FILE *f, int c) {
  int i;
  for (i = 1; i <= 16; i++) {
    fprintf(f, "        <AvailableChannel Channel=\"%d\" Available=\"%s\"/>\n",
            i, (i == c) ? "true" : "false");
  }
}


x86 assembly (clang, -O0):
<midnam_avail_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jg     116d <midnam_avail_channel+0x5d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%r8d
lea    0xef9(%rip),%rcx
lea    0xeed(%rip),%rax
cmp    %r8d,%esi
cmove  %rax,%rcx
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <midnam_avail_channel+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midnam_avail_channel>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
cmp    $0x1,%esi
lea    0xf12(%rip),%r12
lea    0xf10(%rip),%rbx
mov    %rbx,%rcx
cmove  %r12,%rcx
lea    0xec4(%rip),%r15
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <fprintf@plt>
cmp    $0x2,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <fprintf@plt>
cmp    $0x3,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x3,%edx
call   1030 <fprintf@plt>
cmp    $0x4,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1030 <fprintf@plt>
cmp    $0x5,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x5,%edx
call   1030 <fprintf@plt>
cmp    $0x6,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x6,%edx
call   1030 <fprintf@plt>
cmp    $0x7,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x7,%edx
call   1030 <fprintf@plt>
cmp    $0x8,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
call   1030 <fprintf@plt>
cmp    $0x9,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x9,%edx
call   1030 <fprintf@plt>
cmp    $0xa,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xa,%edx
call   1030 <fprintf@plt>
cmp    $0xb,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xb,%edx
call   1030 <fprintf@plt>
cmp    $0xc,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xc,%edx
call   1030 <fprintf@plt>
cmp    $0xd,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xd,%edx
call   1030 <fprintf@plt>
cmp    $0xe,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xe,%edx
call   1030 <fprintf@plt>
cmp    $0xf,%ebp
mov    %rbx,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xf,%edx
call   1030 <fprintf@plt>
cmp    $0x10,%ebp
cmove  %r12,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c" <AvailableChannel Channel=\22%d\22 Available=\22%s\22/>\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define void @midnam_avail_channel(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 16
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp eq i32 %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%17 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %16)
br label %18
18: ; preds = %9
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c" <AvailableChannel Channel=\22%d\22 Available=\22%s\22/>\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define void @midnam_avail_channel(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 1, i8* %4)
%6 = icmp eq i32 %1, 2
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 2, i8* %7)
%9 = icmp eq i32 %1, 3
%10 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 3, i8* %10)
%12 = icmp eq i32 %1, 4
%13 = select i1 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%14 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 4, i8* %13)
%15 = icmp eq i32 %1, 5
%16 = select i1 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%17 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 5, i8* %16)
%18 = icmp eq i32 %1, 6
%19 = select i1 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%20 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 6, i8* %19)
%21 = icmp eq i32 %1, 7
%22 = select i1 %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%23 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 7, i8* %22)
%24 = icmp eq i32 %1, 8
%25 = select i1 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%26 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 8, i8* %25)
%27 = icmp eq i32 %1, 9
%28 = select i1 %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%29 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 9, i8* %28)
%30 = icmp eq i32 %1, 10
%31 = select i1 %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%32 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 10, i8* %31)
%33 = icmp eq i32 %1, 11
%34 = select i1 %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%35 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 11, i8* %34)
%36 = icmp eq i32 %1, 12
%37 = select i1 %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%38 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 12, i8* %37)
%39 = icmp eq i32 %1, 13
%40 = select i1 %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%41 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 13, i8* %40)
%42 = icmp eq i32 %1, 14
%43 = select i1 %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%44 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 14, i8* %43)
%45 = icmp eq i32 %1, 15
%46 = select i1 %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%47 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 15, i8* %46)
%48 = icmp eq i32 %1, 16
%49 = select i1 %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%50 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 16, i8* %49)
ret void
}