#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 */
char getchar();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, char *);
void main1() {
  char c = 'A';
  char c1, c2, c3;
  putchar(c);
  putchar('A');
  putchar('\101');
  putchar('\x41');
  putchar(65);
  putchar('\n');
  c1 = getchar();
  c2 = getchar();
  c3 = getchar();
  putchar(c1);
  putchar(c2);
  putchar(c3);
  scanf("%s", &c);
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x3(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x4(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x3(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x4(%rbp),%edi
call   1030 <putchar@plt>
lea    0xe49(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1050 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x41,0xf(%rsp)
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r14d
movsbl %bl,%edi
call   1030 <putchar@plt>
movsbl %bpl,%edi
call   1030 <putchar@plt>
movsbl %r14b,%edi
call   1030 <putchar@plt>
lea    0xe4a(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @main1() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 65, i8* %1
%5 = load i8, i8* %1
%6 = call i32 @putchar(i8 signext %5)
%7 = call i32 @putchar(i8 signext 65)
%8 = call i32 @putchar(i8 signext 65)
%9 = call i32 @putchar(i8 signext 65)
%10 = call i32 @putchar(i8 signext 65)
%11 = call i32 @putchar(i8 signext 10)
%12 = call signext i8 (...) @getchar()
store i8 %12, i8* %2
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %3
%14 = call signext i8 (...) @getchar()
store i8 %14, i8* %4
%15 = load i8, i8* %2
%16 = call i32 @putchar(i8 signext %15)
%17 = load i8, i8* %3
%18 = call i32 @putchar(i8 signext %17)
%19 = load i8, i8* %4
%20 = call i32 @putchar(i8 signext %19)
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @main1() {
%1 = alloca i8
store i8 65, i8* %1
%2 = tail call i32 @putchar(i8 signext 65)
%3 = tail call i32 @putchar(i8 signext 65)
%4 = tail call i32 @putchar(i8 signext 65)
%5 = tail call i32 @putchar(i8 signext 65)
%6 = tail call i32 @putchar(i8 signext 65)
%7 = tail call i32 @putchar(i8 signext 10)
%8 = tail call signext i8 (...) @getchar()
%9 = tail call signext i8 (...) @getchar()
%10 = tail call signext i8 (...) @getchar()
%11 = tail call i32 @putchar(i8 signext %8)
%12 = tail call i32 @putchar(i8 signext %9)
%13 = tail call i32 @putchar(i8 signext %10)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}