#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*/ GetStr(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ broadcast(char *);
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
char *get_user_name();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void Yell() {
  char *ibuf, *obuf;
  printf("\n\x1b[1;35mEnter Msg To Broadcast!\n\x1b[0;34m:\x1b[32m ");
  ibuf = calloc(79, sizeof(char));
  GetStr(ibuf, 77, 0);
  if (ibuf[0] != '\0') {
    obuf = calloc(256, sizeof(char));
    sprintf(obuf, "\x1b[0;35m<\x1b[33m%s\x1b[35m> \x1b[36m%s\n\x1b[0m",
            get_user_name(), ibuf);
    broadcast(obuf);
    free(obuf);
  } else
    printf("Broadcast cancelled.\n");
  free(ibuf);
  return;
}


x86 assembly (clang, -O0):
<Yell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4f,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4d,%esi
xor    %edx,%edx
call   1090 <GetStr@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1207 <Yell+0x97>
mov    $0x100,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1070 <get_user_name@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xe44(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <broadcast@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1213 <Yell+0xa3>
lea    0xe44(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Yell>:
push   %r14
push   %rbx
push   %rax
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4f,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4d,%esi
xor    %edx,%edx
call   10a0 <GetStr@plt>
cmpb   $0x0,(%rbx)
je     11f6 <Yell+0x76>
mov    $0x100,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1080 <get_user_name@plt>
lea    0xe59(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1090 <sprintf@plt>
mov    %r14,%rdi
call   1070 <broadcast@plt>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    1202 <Yell+0x82>
lea    0xe55(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\0A\1B[1;35mEnter Msg To Broadcast!\0A\1B[0;34m:\1B[32m \00"
@.str.1 = [35 x i8] c"\1B[0;35m<\1B[33m%s\1B[35m> \1B[36m%s\0A\1B[0m\00"
@.str.2 = [22 x i8] c"Broadcast cancelled.\0A\00"
define void @Yell() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @calloc(i32 79, i32 1)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @GetStr(i8* %5, i32 77, i32 0)
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %0
%13 = call i8* @calloc(i32 256, i32 1)
store i8* %13, i8** %2
%14 = load i8*, i8** %2
%15 = call i8* (...) @get_user_name()
%16 = load i8*, i8** %1
%17 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i8*, i8** %2
%19 = call i32 @broadcast(i8* %18)
%20 = load i8*, i8** %2
%21 = call i32 @free(i8* %20)
br label %24
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %12
%25 = load i8*, i8** %1
%26 = call i32 @free(i8* %25)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0A\1B[1;35mEnter Msg To Broadcast!\0A\1B[0;34m:\1B[32m \00"
@.str.1 = [35 x i8] c"\1B[0;35m<\1B[33m%s\1B[35m> \1B[36m%s\0A\1B[0m\00"
@str = [21 x i8] c"Broadcast cancelled.\00"
define void @Yell() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(79) i8* @calloc(i32 79, i32 1)
%3 = tail call i32 @GetStr(i8* %2, i32 77, i32 0)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = tail call dereferenceable_or_null(256) i8* @calloc(i32 256, i32 1)
%8 = tail call i8* (...) @get_user_name()
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %2)
%10 = tail call i32 @broadcast(i8* %7)
%11 = tail call i32 @free(i8* %7)
br label %14
12: ; preds = %0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
%15 = tail call i32 @free(i8* %2)
ret void
}