#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*/ strcpy(char *, char *);
int main() {
  int age = 22;
  char name[40] = "Ziad";
  printf(" I am %d years old\n", 22);
  printf(" I am %s\n", "Ziad");
  printf(" I am %d years old\n", age);
  printf(" I am %s\n", name);
  age = 26;
  strcpy(name, "Homood\n");
  printf("I am %s\n", name);
  printf(" I am %d years old\n", age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x16,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
movb   $0x5a,-0x30(%rbp)
movb   $0x69,-0x2f(%rbp)
movb   $0x61,-0x2e(%rbp)
movb   $0x64,-0x2d(%rbp)
lea    0xe93(%rip),%rdi
mov    $0x16,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
lea    0xe97(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1a,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movl   $0x6461695a,(%rsp)
lea    0xeb4(%rip),%r14
mov    %r14,%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb2(%rip),%r15
lea    0xeb5(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe6d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x1a,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c" I am %d years old\0A\00"
@.str.1 = [10 x i8] c" I am %s\0A\00"
@.str.2 = [5 x i8] c"Ziad\00"
@.str.3 = [8 x i8] c"Homood\0A\00"
@.str.4 = [9 x i8] c"I am %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [40 x i8]
store i32 0, i32* %1
store i32 22, i32* %2
%4 = bitcast [40 x i8]* %3 to i8*
%5 = bitcast i8* %4 to [40 x i8]*
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i32 0, i32 0
store i8 90, i8* %6
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i32 0, i32 1
store i8 105, i8* %7
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i32 0, i32 2
store i8 97, i8* %8
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i32 0, i32 3
store i8 100, i8* %9
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 22)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %14)
store i32 26, i32* %2
%16 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%18 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c" I am %d years old\0A\00"
@.str.1 = [10 x i8] c" I am %s\0A\00"
@.str.2 = [5 x i8] c"Ziad\00"
@.str.3 = [8 x i8] c"Homood\0A\00"
@.str.4 = [9 x i8] c"I am %s\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
store i8 90, i8* %2
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 1
store i8 105, i8* %3
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 2
store i8 97, i8* %4
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 3
store i8 100, i8* %5
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 22)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 22)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%10 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 26)
ret i32 0
}