#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char const *);
int main(void) {
  char name[81];
  char talents[81];
  int i;
  const char m1[40] = "Limit yourself to one line's worth. ";
  const char m2[] = "If you can't think of anything, fake it. ";
  const char *m3 = "\nEnough about me - what's your name? ";
  const char *mytal[5] = {
      "Adding numbers swiftly", "Multiplying accurately", "Stashing data",
      "Following instructions to the letter", "Understanding the C language"};
  printf("Hi! I'm Clyde the Computer."
         " I have many talents.\n");
  printf("Let me tell you some of them.\n");
  puts("What were they? Ah, yes, here's a partial list. ");
  for (i = 0; i < 5; i++)
    puts(mytal[i]);
  puts(m3);
  gets(name);
  printf("Well, %s, %s\n", name, "You must have many talents. Tell me some.");
  printf("%s\n%s\n", m1, m2);
  gets(talents);
  puts("Let's see if I've got that list: ");
  puts(talents);
  printf("Thanks for the information, %s.\n", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf0(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x120(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x2a,%edx
call   1060 <memcpy@plt>
lea    0xec1(%rip),%rax
mov    %rax,-0x128(%rbp)
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    0xec6(%rip),%rax
mov    %rax,-0x150(%rbp)
lea    0xecf(%rip),%rax
mov    %rax,-0x148(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x140(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x138(%rbp)
lea    0xeef(%rip),%rax
mov    %rax,-0x130(%rbp)
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf33(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0xc4(%rbp)
cmpl   $0x5,-0xc4(%rbp)
jge    1260 <main+0x110>
movslq -0xc4(%rbp),%rax
mov    -0x150(%rbp,%rax,8),%rdi
ff
call   1030 <puts@plt>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    122b <main+0xdb>
mov    -0x128(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rdi
call   1070 <gets@plt>
lea    -0x60(%rbp),%rsi
lea    0xf00(%rip),%rdi
lea    0xf07(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xf0(%rbp),%rsi
lea    -0x120(%rbp),%rdx
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xc0(%rbp),%rdi
call   1070 <gets@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    -0xc0(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rsi
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x118,%rsp
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,(%rsp)
movq   $0x202e6874,0x20(%rsp)
2e 20
movups 0xee9(%rip),%xmm0
movups %xmm0,0x4a(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x102c(%rip),%rdi
call   1030 <puts@plt>
lea    0x1051(%rip),%rdi
call   1030 <puts@plt>
lea    0xf61(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
lea    0xc0(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0xf2e(%rip),%rdi
lea    0xf35(%rip),%rdx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf4e(%rip),%rdi
mov    %rsp,%rsi
lea    0x30(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.m1 = [40 x i8] c"Limit yourself to one line's worth. \00\00\00\00"
@__const.main.m2 = [42 x i8] c"If you can't think of anything, fake it. \00"
@.str = [38 x i8] c"\0AEnough about me - what's your name? \00"
@.str.1 = [23 x i8] c"Adding numbers swiftly\00"
@.str.2 = [23 x i8] c"Multiplying accurately\00"
@.str.3 = [14 x i8] c"Stashing data\00"
@.str.4 = [37 x i8] c"Following instructions to the letter\00"
@.str.5 = [29 x i8] c"Understanding the C language\00"
@.str.6 = [50 x i8] c"Hi! I'm Clyde the Computer. I have many talents.\0A\00"
@.str.7 = [31 x i8] c"Let me tell you some of them.\0A\00"
@.str.8 = [49 x i8] c"What were they? Ah, yes, here's a partial list. \00"
@.str.9 = [14 x i8] c"Well, %s, %s\0A\00"
@.str.10 = [42 x i8] c"You must have many talents. Tell me some.\00"
@.str.11 = [7 x i8] c"%s\0A%s\0A\00"
@.str.12 = [34 x i8] c"Let's see if I've got that list: \00"
@.str.13 = [33 x i8] c"Thanks for the information, %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = alloca [81 x i8]
%4 = alloca i32
%5 = alloca [40 x i8]
%6 = alloca [42 x i8]
%7 = alloca i8*
%8 = alloca [5 x i8*]
store i32 0, i32* %1
%9 = bitcast [40 x i8]* %5 to i8*
%10 = bitcast [42 x i8]* %6 to i8*
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8** %7
%11 = bitcast [5 x i8*]* %8 to i8*
%12 = bitcast i8* %11 to [5 x i8*]*
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 0
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i32 0, i32 0), i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i32 0, i32 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 3
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i32 0, i32 0), i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 4
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i32 0, i32 0), i8** %17
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %4
br label %21
21: ; preds = %30, %0
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 5
br i1 %23, label %24, label %33
24: ; preds = %21
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i64 0, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @puts(i8* %28)
br label %30
30: ; preds = %24
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %21
33: ; preds = %21
%34 = load i8*, i8** %7
%35 = call i32 @puts(i8* %34)
%36 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%37 = call i32 @gets(i8* %36)
%38 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %38, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%40 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%41 = getelementptr inbounds [42 x i8], [42 x i8]* %6, i64 0, i64 0
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %40, i8* %41)
%43 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%44 = call i32 @gets(i8* %43)
%45 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0))
%46 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%47 = call i32 @puts(i8* %46)
%48 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* %48)
ret i32 0
}

LLVM IR (-O2):
@__const.main.m1 = [40 x i8] c"Limit yourself to one line's worth. \00\00\00\00"
@__const.main.m2 = [42 x i8] c"If you can't think of anything, fake it. \00"
@.str = [38 x i8] c"\0AEnough about me - what's your name? \00"
@.str.1 = [23 x i8] c"Adding numbers swiftly\00"
@.str.2 = [23 x i8] c"Multiplying accurately\00"
@.str.3 = [14 x i8] c"Stashing data\00"
@.str.4 = [37 x i8] c"Following instructions to the letter\00"
@.str.5 = [29 x i8] c"Understanding the C language\00"
@.str.8 = [49 x i8] c"What were they? Ah, yes, here's a partial list. \00"
@.str.9 = [14 x i8] c"Well, %s, %s\0A\00"
@.str.10 = [42 x i8] c"You must have many talents. Tell me some.\00"
@.str.11 = [7 x i8] c"%s\0A%s\0A\00"
@.str.12 = [34 x i8] c"Let's see if I've got that list: \00"
@.str.13 = [33 x i8] c"Thanks for the information, %s.\0A\00"
@str = [49 x i8] c"Hi! I'm Clyde the Computer. I have many talents.\00"
@str.14 = [30 x i8] c"Let me tell you some of them.\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = alloca [81 x i8]
%3 = alloca [40 x i8]
%4 = alloca [42 x i8]
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [42 x i8], [42 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.14, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @gets(i8* %5)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %7, i8* %8)
%21 = call i32 @gets(i8* %6)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0))
%23 = call i32 @puts(i8* %6)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* %5)
ret i32 0
}