#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ip4_print_option(int const *);
void ip4_print_options(const uint8_t *opts) {
  while (opts[0] != 0) {
    if (opts[0] == 1) {
      opts++;
    } else {
      ip4_print_option(opts);
      opts += (2 + opts[1]);
    }
  }
}


x86 assembly (clang, -O0):
<ip4_print_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1171 <ip4_print_options+0x61>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1147 <ip4_print_options+0x37>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    116c <ip4_print_options+0x5c>
mov    -0x8(%rbp),%rdi
call   1030 <ip4_print_option@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x2,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ip4_print_options+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4_print_options>:
push   %rbx
mov    %rdi,%rbx
jmp    1124 <ip4_print_options+0x14>
cs nopw 0x0(%rax,%rax,1)
lea    (%rbx,%rax,4),%rbx
mov    (%rbx),%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1120 <ip4_print_options+0x10>
test   %ecx,%ecx
je     1146 <ip4_print_options+0x36>
mov    %rbx,%rdi
call   1030 <ip4_print_option@plt>
movslq 0x4(%rbx),%rax
add    $0x2,%rax
jmp    1120 <ip4_print_options+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ip4_print_options(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %26, %1
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i32 1
store i32* %15, i32** %2
br label %26
16: ; preds = %8
%17 = load i32*, i32** %2
%18 = call i32 @ip4_print_option(i32* %17)
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
%22 = add nsw i32 2, %21
%23 = load i32*, i32** %2
%24 = sext i32 %22 to i64
%25 = getelementptr inbounds i32, i32* %23, i64 %24
store i32* %25, i32** %2
br label %26
26: ; preds = %16, %13
br label %3
27: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ip4_print_options(i32* %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i32* [ %0, %1 ], [ %13, %11 ]
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 0, label %14
i32 1, label %11
]
5: ; preds = %2
%6 = tail call i32 @ip4_print_option(i32* %3)
%7 = getelementptr inbounds i32, i32* %3, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 2
%10 = sext i32 %9 to i64
br label %11
11: ; preds = %2, %5
%12 = phi i64 [ %10, %5 ], [ 1, %2 ]
%13 = getelementptr inbounds i32, i32* %3, i64 %12
br label %2
14: ; preds = %2
ret void
}