#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*/ lprintf(int, char *, ...);
int decode_availablenets(unsigned char *element, int element_len) {
  int c;
  lprintf(14, "Available Networks:");
  for (c = 0; c < element_len; c++) {
    lprintf(14, " %d", (int)*(element + c));
  }
  lprintf(14, "\r\n");
  return 0;
}


x86 assembly (clang, -O0):
<decode_availablenets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xe,%edi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <lprintf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1172 <decode_availablenets+0x62>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
mov    $0xe,%edi
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   1030 <lprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1139 <decode_availablenets+0x29>
mov    $0xe,%edi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1030 <lprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_availablenets>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
lea    0xedd(%rip),%rsi
mov    $0xe,%edi
xor    %eax,%eax
call   1030 <lprintf@plt>
test   %ebp,%ebp
jle    115d <decode_availablenets+0x4d>
mov    %ebp,%ebp
lea    0xed8(%rip),%r14
xor    %ebx,%ebx
xchg   %ax,%ax
movzbl (%r15,%rbx,1),%edx
mov    $0xe,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <lprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <decode_availablenets+0x30>
lea    0xeb4(%rip),%rsi
mov    $0xe,%edi
xor    %eax,%eax
call   1030 <lprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Available Networks:\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define i32 @decode_availablenets(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
%23 = call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Available Networks:\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define i32 @decode_availablenets(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = tail call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = tail call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}