#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
void handle_command(int argc, char **argv) {
  if (argc == 0)
    return;
  if (strcmp(argv[0], "PING") == 0) {
    fputs("[PONG]\n", stdout);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<handle_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114e <handle_command+0x1e>
jmp    118e <handle_command+0x5e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xea4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118e <handle_command+0x5e>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
lea    0xe8a(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_command>:
push   %rbx
test   %edi,%edi
je     1149 <handle_command+0x19>
mov    (%rsi),%rdi
lea    0xec1(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114b <handle_command+0x1b>
pop    %rbx
ret
mov    0x2e8e(%rip),%rbx
mov    (%rbx),%esi
lea    0xeaa(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"PING\00"
@.str.1 = [8 x i8] c"[PONG]\0A\00"
@stdout = global i32 0
define void @handle_command(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %19
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = load i32, i32* @stdout
%16 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = call i32 @fflush(i32 %17)
br label %19
19: ; preds = %7, %14, %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"PING\00"
@.str.1 = [8 x i8] c"[PONG]\0A\00"
@stdout = global i32 0
define void @handle_command(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* @stdout
%10 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdout
%12 = tail call i32 @fflush(i32 %11)
br label %13
13: ; preds = %2, %8, %4
ret void
}