#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 */
struct cnfnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append_node(struct cnfnode *, struct cnfnode *);
struct cnfnode *create_cnfnode(char const *);
struct cnfnode *parse_table_line(char const **, char **, int, int);
int /*<<< orphan*/ skip_spaces(char const **);
struct cnfnode *parse_snmp_table(const char *name, const char *p, char **cols,
                                 int ncols) {
  struct cnfnode *cn_table, *cn_top;
  cn_top = create_cnfnode(name);
  skip_spaces(&p);
  cn_table = parse_table_line(&p, cols, ncols, -1);
  append_node(cn_top, cn_table);
  return cn_top;
}


x86 assembly (clang, -O0):
<parse_snmp_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <create_cnfnode@plt>
mov    %rax,-0x30(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <skip_spaces@plt>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x10(%rbp),%rdi
mov    $0xffffffff,%ecx
call   1050 <parse_table_line@plt>
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <append_node@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_snmp_table>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,(%rsp)
call   1060 <create_cnfnode@plt>
mov    %rax,%rbp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <skip_spaces@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
mov    $0xffffffff,%ecx
call   1050 <parse_table_line@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1030 <append_node@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.cnfnode = type { i32 }
define %struct.cnfnode* @parse_snmp_table(i8* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca %struct.cnfnode*
%10 = alloca %struct.cnfnode*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%11 = load i8*, i8** %5
%12 = call %struct.cnfnode* @create_cnfnode(i8* %11)
store %struct.cnfnode* %12, %struct.cnfnode** %10
%13 = call i32 @skip_spaces(i8** %6)
%14 = load i8**, i8*** %7
%15 = load i32, i32* %8
%16 = call %struct.cnfnode* @parse_table_line(i8** %6, i8** %14, i32 %15, i32 -1)
store %struct.cnfnode* %16, %struct.cnfnode** %9
%17 = load %struct.cnfnode*, %struct.cnfnode** %10
%18 = load %struct.cnfnode*, %struct.cnfnode** %9
%19 = call i32 @append_node(%struct.cnfnode* %17, %struct.cnfnode* %18)
%20 = load %struct.cnfnode*, %struct.cnfnode** %10
ret %struct.cnfnode* %20
}

LLVM IR (-O2):
%struct.cnfnode = type { i32 }
define %struct.cnfnode* @parse_snmp_table(i8* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca i8*
store i8* %1, i8** %5
%6 = tail call %struct.cnfnode* @create_cnfnode(i8* %0)
%7 = call i32 @skip_spaces(i8** %5)
%8 = call %struct.cnfnode* @parse_table_line(i8** %5, i8** %2, i32 %3, i32 -1)
%9 = call i32 @append_node(%struct.cnfnode* %6, %struct.cnfnode* %8)
ret %struct.cnfnode* %6
}