#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char const *, char *);
scalar_t__ strcmp(char *, char *);
char *strip_html(char *);
void incoming_im(void *handle, const char *who, const int automessage,
                 const char *message) {
  char *msg;
  msg = strip_html((char *)message);
  printf("[%s] %s\n", who, msg);
  if (strcmp(msg, "quit now") == 0) {
    free(msg);
    exit(0);
  }
  free(msg);
}


x86 assembly (clang, -O0):
<incoming_im>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strip_html@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11b2 <incoming_im+0x62>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incoming_im>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rcx,%rdi
call   1040 <strip_html@plt>
mov    %rax,%rbx
lea    0xe97(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <printf@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r14,%r14
je     119b <incoming_im+0x4b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"[%s] %s\0A\00"
@.str.1 = [9 x i8] c"quit now\00"
define void @incoming_im(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = call i8* @strip_html(i8* %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %6
%13 = load i8*, i8** %9
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = load i8*, i8** %9
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %4
%19 = load i8*, i8** %9
%20 = call i32 @free(i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %4
%23 = load i8*, i8** %9
%24 = call i32 @free(i8* %23)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"[%s] %s\0A\00"
@.str.1 = [9 x i8] c"quit now\00"
define void @incoming_im(i8* nocapture readnone %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i8* @strip_html(i8* %3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %5)
%7 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = tail call i32 @free(i8* %5)
br i1 %8, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %4
ret void
}