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

/* Variables and functions */
int /*<<< orphan*/ die(char *, char const *);
int /*<<< orphan*/ handle_command(char const *, char const *,
                                  struct line_buffer *);
char *strchr(char const *, char);
void handle_line(const char *line, struct line_buffer *stdin_buf) {
  const char *arg = strchr(line, ' ');
  if (!arg)
    die("no argument in line: %s", line);
  handle_command(line, arg + 1, stdin_buf);
}


x86 assembly (clang, -O0):
<handle_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <handle_line+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1050 <die@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rdx
call   1030 <handle_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_line>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x20,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115c <handle_line+0x2c>
lea    0xeac(%rip),%rdi
mov    %r15,%rsi
call   1050 <die@plt>
add    $0x1,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <handle_command@plt>

LLVM IR (-O0):
%struct.line_buffer = type { i32 }
@.str = [24 x i8] c"no argument in line: %s\00"
define void @handle_line(i8* %0, %struct.line_buffer* %1) {
%3 = alloca i8*
%4 = alloca %struct.line_buffer*
%5 = alloca i8*
store i8* %0, i8** %3
store %struct.line_buffer* %1, %struct.line_buffer** %4
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 32)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load %struct.line_buffer*, %struct.line_buffer** %4
%18 = call i32 @handle_command(i8* %14, i8* %16, %struct.line_buffer* %17)
ret void
}

LLVM IR (-O2):
%struct.line_buffer = type { i32 }
@.str = [24 x i8] c"no argument in line: %s\00"
define void @handle_line(i8* %0, %struct.line_buffer* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @handle_command(i8* %0, i8* %8, %struct.line_buffer* %1)
ret void
}