#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*/ sw_printf(char *, char *);
int /*<<< orphan*/ sw_strtoul(char *, void *, int);
unsigned int sw_xmodem_rec(int /*<<< orphan*/);
int cmd_xmodem_rec(char *arg_list[], int n) {
  unsigned int ret;
  if (n < 2) {
    sw_printf("%s", "sfsadf");
    return -1;
  }
  ret = sw_xmodem_rec(sw_strtoul(arg_list[1], ((void *)0), 16));
  return ret;
}


x86 assembly (clang, -O0):
<cmd_xmodem_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1168 <cmd_xmodem_rec+0x38>
lea    0xeb0(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1030 <sw_printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <cmd_xmodem_rec+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1050 <sw_strtoul@plt>
mov    %eax,%edi
call   1040 <sw_xmodem_rec@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_xmodem_rec>:
push   %rax
cmp    $0x1,%esi
jg     1150 <cmd_xmodem_rec+0x20>
lea    0xec3(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <sw_printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rdi),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <sw_strtoul@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sw_xmodem_rec@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"sfsadf\00"
define i32 @cmd_xmodem_rec(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @sw_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %18
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @sw_strtoul(i8* %14, i8* null, i32 16)
%16 = call i32 @sw_xmodem_rec(i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %18
18: ; preds = %11, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"sfsadf\00"
define i32 @cmd_xmodem_rec(i8** nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @sw_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %0, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @sw_strtoul(i8* %8, i8* null, i32 16)
%10 = tail call i32 @sw_xmodem_rec(i32 %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ -1, %4 ], [ %10, %6 ]
ret i32 %12
}