#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 chanset_t {
  int dummy;
};

/* Variables and functions */
struct chanset_t *findchan(char *);
int /*<<< orphan*/ got352or4(struct chanset_t *, char *, char *, char *,
                             char *);
char *newsplit(char **);
int got352(char *from, char *msg) {
  char *nick, *user, *host, *chname, *flags;
  struct chanset_t *chan;
  newsplit(&msg);
  chname = newsplit(&msg);
  chan = findchan(chname);
  if (chan) {
    user = newsplit(&msg);
    host = newsplit(&msg);
    newsplit(&msg);
    nick = newsplit(&msg);
    flags = newsplit(&msg);
    got352or4(chan, user, host, nick, flags);
  }
  return 0;
}


x86 assembly (clang, -O0):
<got352>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <newsplit@plt>
lea    -0x10(%rbp),%rdi
call   1040 <newsplit@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <findchan@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     11c4 <got352+0x94>
lea    -0x10(%rbp),%rdi
call   1040 <newsplit@plt>
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <newsplit@plt>
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <newsplit@plt>
lea    -0x10(%rbp),%rdi
call   1040 <newsplit@plt>
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <newsplit@plt>
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x38(%rbp),%r8
call   1050 <got352or4@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<got352>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <newsplit@plt>
mov    %rbx,%rdi
call   1040 <newsplit@plt>
mov    %rax,%rdi
call   1030 <findchan@plt>
test   %rax,%rax
je     11b1 <got352+0x81>
mov    %rax,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <newsplit@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <newsplit@plt>
mov    %rax,%r12
mov    %r14,%rdi
call   1040 <newsplit@plt>
mov    %r14,%rdi
call   1040 <newsplit@plt>
mov    %rax,%r13
mov    %r14,%rdi
call   1040 <newsplit@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rax,%r8
call   1050 <got352or4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.chanset_t = type { i32 }
define i32 @got352(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca %struct.chanset_t*
store i8* %0, i8** %3
store i8* %1, i8** %4
%11 = call i8* @newsplit(i8** %4)
%12 = call i8* @newsplit(i8** %4)
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = call %struct.chanset_t* @findchan(i8* %13)
store %struct.chanset_t* %14, %struct.chanset_t** %10
%15 = load %struct.chanset_t*, %struct.chanset_t** %10
%16 = icmp ne %struct.chanset_t* %15, null
br i1 %16, label %17, label %29
17: ; preds = %2
%18 = call i8* @newsplit(i8** %4)
store i8* %18, i8** %6
%19 = call i8* @newsplit(i8** %4)
store i8* %19, i8** %7
%20 = call i8* @newsplit(i8** %4)
%21 = call i8* @newsplit(i8** %4)
store i8* %21, i8** %5
%22 = call i8* @newsplit(i8** %4)
store i8* %22, i8** %9
%23 = load %struct.chanset_t*, %struct.chanset_t** %10
%24 = load i8*, i8** %6
%25 = load i8*, i8** %7
%26 = load i8*, i8** %5
%27 = load i8*, i8** %9
%28 = call i32 @got352or4(%struct.chanset_t* %23, i8* %24, i8* %25, i8* %26, i8* %27)
br label %29
29: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
%struct.chanset_t = type { i32 }
define i32 @got352(i8* nocapture readnone %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i8* @newsplit(i8** %3)
%5 = call i8* @newsplit(i8** %3)
%6 = call %struct.chanset_t* @findchan(i8* %5)
%7 = icmp eq %struct.chanset_t* %6, null
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = call i8* @newsplit(i8** %3)
%10 = call i8* @newsplit(i8** %3)
%11 = call i8* @newsplit(i8** %3)
%12 = call i8* @newsplit(i8** %3)
%13 = call i8* @newsplit(i8** %3)
%14 = call i32 @got352or4(%struct.chanset_t* %6, i8* %9, i8* %10, i8* %12, i8* %13)
br label %15
15: ; preds = %8, %2
ret i32 0
}