#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 */
scalar_t__ XtMalloc(int);
scalar_t__ XtRealloc(char *, int);
int atoi(char *);
int *XfwfTablist2Tabs(char *tablist) {
  register int *tabs = NULL;
  register int ntabs = 0;
  if (!tablist) {
    return NULL;
  }
  for (;;) {
    while (*tablist && *tablist == ' ') {
      ++tablist;
    }
    if (!*tablist) {
      break;
    }
    if (ntabs) {
      tabs = (int *)XtRealloc((char *)tabs, (ntabs + 1) * sizeof(int));
    } else {
      tabs = (int *)XtMalloc((ntabs + 1) * sizeof(int));
    }
    tabs[ntabs++] = atoi(tablist);
    while (*tablist && *tablist != ' ') {
      ++tablist;
    }
  }
  return tabs;
}


x86 assembly (clang, -O0):
<XfwfTablist2Tabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <XfwfTablist2Tabs+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1279 <XfwfTablist2Tabs+0x149>
jmp    1168 <XfwfTablist2Tabs+0x38>
jmp    116d <XfwfTablist2Tabs+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
je     1192 <XfwfTablist2Tabs+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    11a2 <XfwfTablist2Tabs+0x72>
jmp    11b3 <XfwfTablist2Tabs+0x83>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116d <XfwfTablist2Tabs+0x3d>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11c5 <XfwfTablist2Tabs+0x95>
jmp    1271 <XfwfTablist2Tabs+0x141>
cmpl   $0x0,-0x1c(%rbp)
je     11ef <XfwfTablist2Tabs+0xbf>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%esi
call   1040 <XtRealloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1206 <XfwfTablist2Tabs+0xd6>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <XtMalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1e(%rbp)
je     124b <XfwfTablist2Tabs+0x11b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    125b <XfwfTablist2Tabs+0x12b>
jmp    126c <XfwfTablist2Tabs+0x13c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1226 <XfwfTablist2Tabs+0xf6>
jmp    1168 <XfwfTablist2Tabs+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XfwfTablist2Tabs>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     11ab <XfwfTablist2Tabs+0x7b>
mov    %rdi,%rbx
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    1154 <XfwfTablist2Tabs+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
mov    (%rbx),%al
cmp    $0x20,%al
je     1150 <XfwfTablist2Tabs+0x20>
test   %al,%al
je     11ae <XfwfTablist2Tabs+0x7e>
test   %r15,%r15
je     1175 <XfwfTablist2Tabs+0x45>
lea    0x4(,%r15,4),%esi
mov    %r14,%rdi
call   1040 <XtRealloc@plt>
jmp    117f <XfwfTablist2Tabs+0x4f>
mov    $0x4,%edi
call   1030 <XtMalloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %eax,(%r14,%r15,4)
add    $0x1,%r15
testb  $0xdf,(%rbx)
je     1154 <XfwfTablist2Tabs+0x24>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
testb  $0xdf,(%rbx)
jne    11a0 <XfwfTablist2Tabs+0x70>
jmp    1154 <XfwfTablist2Tabs+0x24>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @XfwfTablist2Tabs(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* null, i32** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i32* null, i32** %2
br label %78
9: ; preds = %1
br label %10
10: ; preds = %75, %9
br label %11
11: ; preds = %23, %10
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 32
br label %21
21: ; preds = %16, %11
%22 = phi i1 [ false, %11 ], [ %20, %16 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %3
br label %11
26: ; preds = %21
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = icmp ne i8 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %26
br label %76
31: ; preds = %26
%32 = load i32, i32* %5
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %44
34: ; preds = %31
%35 = load i32*, i32** %4
%36 = bitcast i32* %35 to i8*
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = mul i64 %39, 4
%41 = trunc i64 %40 to i32
%42 = call i64 @XtRealloc(i8* %36, i32 %41)
%43 = inttoptr i64 %42 to i32*
store i32* %43, i32** %4
br label %52
44: ; preds = %31
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = mul i64 %47, 4
%49 = trunc i64 %48 to i32
%50 = call i64 @XtMalloc(i32 %49)
%51 = inttoptr i64 %50 to i32*
store i32* %51, i32** %4
br label %52
52: ; preds = %44, %34
%53 = load i8*, i8** %3
%54 = call i32 @atoi(i8* %53)
%55 = load i32*, i32** %4
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds i32, i32* %55, i64 %58
store i32 %54, i32* %59
br label %60
60: ; preds = %72, %52
%61 = load i8*, i8** %3
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %60
%66 = load i8*, i8** %3
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp ne i32 %68, 32
br label %70
70: ; preds = %65, %60
%71 = phi i1 [ false, %60 ], [ %69, %65 ]
br i1 %71, label %72, label %75
72: ; preds = %70
%73 = load i8*, i8** %3
%74 = getelementptr inbounds i8, i8* %73, i32 1
store i8* %74, i8** %3
br label %60
75: ; preds = %70
br label %10
76: ; preds = %30
%77 = load i32*, i32** %4
store i32* %77, i32** %2
br label %78
78: ; preds = %76, %8
%79 = load i32*, i32** %2
ret i32* %79
}

LLVM IR (-O2):
define i32* @XfwfTablist2Tabs(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %34, label %4
3: ; preds = %29, %29
br label %4
4: ; preds = %1, %3
%5 = phi i64 [ %27, %3 ], [ 0, %1 ]
%6 = phi i8* [ %30, %3 ], [ %0, %1 ]
%7 = phi i32* [ %25, %3 ], [ null, %1 ]
br label %8
8: ; preds = %11, %4
%9 = phi i8* [ %6, %4 ], [ %12, %11 ]
%10 = load i8, i8* %9
switch i8 %10, label %13 [
i8 32, label %11
i8 0, label %34
]
11: ; preds = %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
br label %8
13: ; preds = %8
%14 = icmp eq i64 %5, 0
br i1 %14, label %21, label %15
15: ; preds = %13
%16 = bitcast i32* %7 to i8*
%17 = trunc i64 %5 to i32
%18 = shl i32 %17, 2
%19 = add i32 %18, 4
%20 = tail call i64 @XtRealloc(i8* %16, i32 %19)
br label %23
21: ; preds = %13
%22 = tail call i64 @XtMalloc(i32 4)
br label %23
23: ; preds = %21, %15
%24 = phi i64 [ %20, %15 ], [ %22, %21 ]
%25 = inttoptr i64 %24 to i32*
%26 = tail call i32 @atoi(i8* %9)
%27 = add nuw i64 %5, 1
%28 = getelementptr inbounds i32, i32* %25, i64 %5
store i32 %26, i32* %28
br label %29
29: ; preds = %32, %23
%30 = phi i8* [ %9, %23 ], [ %33, %32 ]
%31 = load i8, i8* %30
switch i8 %31, label %32 [
i8 0, label %3
i8 32, label %3
]
32: ; preds = %29
%33 = getelementptr inbounds i8, i8* %30, i64 1
br label %29
34: ; preds = %8, %1
%35 = phi i32* [ null, %1 ], [ %7, %8 ]
ret i32* %35
}