#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 */

/* Variables and functions */
int /*<<< orphan*/ print_gpio_alts_info(int);
int /*<<< orphan*/ printf(char *);
void print_gpio_alts_table(int gpio) {
  int n;
  printf("GPIO, DEFAULT PULL, ALT0, ALT1, ALT2, ALT3, ALT4, ALT5\n");
  if (gpio < 0) {
    for (n = 0; n < 54; n++) {
      print_gpio_alts_info(n);
    }
  } else {
    print_gpio_alts_info(gpio);
  }
}


x86 assembly (clang, -O0):
<print_gpio_alts_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jge    116d <print_gpio_alts_table+0x4d>
movl   $0x0,-0x8(%rbp)
cmpl   $0x36,-0x8(%rbp)
jge    1168 <print_gpio_alts_table+0x48>
mov    -0x8(%rbp),%edi
call   1040 <print_gpio_alts_info@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <print_gpio_alts_table+0x28>
jmp    1175 <print_gpio_alts_table+0x55>
mov    -0x4(%rbp),%edi
call   1040 <print_gpio_alts_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_gpio_alts_table>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
js     113b <print_gpio_alts_table+0x1b>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <print_gpio_alts_info@plt>
xor    %ebx,%ebx
nopl   (%rax)
mov    %ebx,%edi
call   1040 <print_gpio_alts_info@plt>
add    $0x1,%ebx
cmp    $0x36,%ebx
jne    1140 <print_gpio_alts_table+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"GPIO, DEFAULT PULL, ALT0, ALT1, ALT2, ALT3, ALT4, ALT5\0A\00"
define void @print_gpio_alts_table(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %14, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 54
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %3
%13 = call i32 @print_gpio_alts_info(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %8
17: ; preds = %8
br label %21
18: ; preds = %1
%19 = load i32, i32* %2
%20 = call i32 @print_gpio_alts_info(i32 %19)
br label %21
21: ; preds = %18, %17
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c"GPIO, DEFAULT PULL, ALT0, ALT1, ALT2, ALT3, ALT4, ALT5\00"
define void @print_gpio_alts_table(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @print_gpio_alts_info(i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 54
br i1 %8, label %11, label %4
9: ; preds = %1
%10 = tail call i32 @print_gpio_alts_info(i32 %0)
br label %11
11: ; preds = %4, %9
ret void
}