#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 */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ get_string(char *, char *, int);
int /*<<< orphan*/ msg_format(char *, char *);
int /*<<< orphan*/ my_strcpy(char *, char *, int);
void do_cmd_note(void) {
  char tmp[80];
  my_strcpy(tmp, "", sizeof(tmp));
  if (!get_string("Note: ", tmp, sizeof(tmp)))
    return;
  if (!tmp[0] || (tmp[0] == ' '))
    return;
  msg_format("Note: %s", tmp);
}


x86 assembly (clang, -O0):
<do_cmd_note>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x50,%edx
call   1030 <my_strcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x50,%edx
call   1040 <get_string@plt>
cmp    $0x0,%eax
jne    1170 <do_cmd_note+0x40>
jmp    119c <do_cmd_note+0x6c>
cmpb   $0x0,-0x50(%rbp)
je     1187 <do_cmd_note+0x57>
movsbl -0x50(%rbp),%eax
cmp    $0x20,%eax
jne    118c <do_cmd_note+0x5c>
jmp    119c <do_cmd_note+0x6c>
lea    -0x50(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1050 <msg_format@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_note>:
push   %rbx
sub    $0x50,%rsp
lea    0xeca(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%edx
call   1030 <my_strcpy@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    $0x50,%edx
call   1040 <get_string@plt>
test   %eax,%eax
je     1179 <do_cmd_note+0x49>
testb  $0xdf,(%rsp)
je     1179 <do_cmd_note+0x49>
lea    0xe96(%rip),%rdi
mov    %rsp,%rsi
call   1050 <msg_format@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Note: \00"
@.str.2 = [9 x i8] c"Note: %s\00"
define void @do_cmd_note() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 80)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
br label %21
8: ; preds = %0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 32
br i1 %16, label %17, label %18
17: ; preds = %12, %8
br label %21
18: ; preds = %12
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%20 = call i32 @msg_format(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %18, %17, %7
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Note: \00"
@.str.2 = [9 x i8] c"Note: %s\00"
define void @do_cmd_note() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 80)
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = load i8, i8* %2
%8 = and i8 %7, -33
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = call i32 @msg_format(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %2)
br label %12
12: ; preds = %6, %0, %10
ret void
}