#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
butler() {
  char name[40];
  printf("\nhelloworld\n %c", '\007');
  unsigned int a;
  short b;
  unsigned long c;
  a = 64535;
  a = a + 1;
  b = a + 3;
  c = 4294967295 / 34;
  char grade = 65;
  printf("\n%d,%d,%d,%c\n", a, b, c, grade);
  printf("What is your Name");
  scanf("%s", name);
  printf("\n My name is %s and my strn len = %d\n", name, strlen(name));
}


x86 assembly (clang, -O0):
<butler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xfc17,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x3,%eax
mov    %ax,-0x36(%rbp)
movq   $0x7878787,-0x40(%rbp)
07
movb   $0x41,-0x41(%rbp)
mov    -0x34(%rbp),%esi
movswl -0x36(%rbp),%edx
mov    -0x40(%rbp),%rcx
movsbl -0x41(%rbp),%r8d
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x50(%rbp),%rsi
mov    %eax,%edx
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<butler>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x7878787,%ecx
mov    $0xfc18,%esi
mov    $0xfffffc1b,%edx
mov    $0x41,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0Ahelloworld\0A %c\00"
@.str.1 = [14 x i8] c"\0A%d,%d,%d,%c\0A\00"
@.str.2 = [18 x i8] c"What is your Name\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [38 x i8] c"\0A My name is %s and my strn len = %d\0A\00"
define i32 @butler() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca i32
%4 = alloca i16
%5 = alloca i64
%6 = alloca i8
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 7)
store i32 64535, i32* %3
%8 = load i32, i32* %3
%9 = add i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = add i32 %10, 3
%12 = trunc i32 %11 to i16
store i16 %12, i16* %4
store i64 126322567, i64* %5
store i8 65, i8* %6
%13 = load i32, i32* %3
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
%16 = load i64, i64* %5
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %15, i64 %16, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%21 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%25 = call i32 @strlen(i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %23, i32 %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0Ahelloworld\0A %c\00"
@.str.1 = [14 x i8] c"\0A%d,%d,%d,%c\0A\00"
@.str.2 = [18 x i8] c"What is your Name\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [38 x i8] c"\0A My name is %s and my strn len = %d\0A\00"
define i32 @butler() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 7)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 64536, i32 -997, i64 126322567, i32 65)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%7 = call i32 @strlen(i8* %2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %2, i32 %7)
ret i32 undef
}