#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*/ sscanf(char *, char *, int *);
int main(int argc, char *argv[]) {
  int numbers[4] = {0};
  char *name = "sku";
  printf("numbers: %d %d %d %d\n", numbers[0], numbers[1], numbers[2],
         numbers[3]);
  printf("name each: %c %c %c %c\n", name[0], name[1], name[2], name[3]);
  printf("name: %s\n", name);
  numbers[0] = 1;
  numbers[1] = 2;
  numbers[2] = 3;
  numbers[3] = 4;
  printf("numbers: %d %d %d %d\n", numbers[0], numbers[1], numbers[2],
         numbers[3]);
  printf("name: %s\n", name);
  char *another = "ARU";
  printf("another: %s\n", another);
  printf("another each: %c %c %c %c\n", another[0], another[1], another[2],
         another[3]);
  int nameAsInt;
  sscanf(name, "%d", &nameAsInt);
  printf("Printing an array of 4 characters as integer %d\n", nameAsInt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    0xea3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%esi
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%edx
mov    -0x28(%rbp),%rax
movsbl 0x2(%rax),%ecx
mov    -0x28(%rbp),%rax
movsbl 0x3(%rax),%r8d
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe30(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
movsbl (%rax),%esi
mov    -0x30(%rbp),%rax
movsbl 0x1(%rax),%edx
mov    -0x30(%rbp),%rax
movsbl 0x2(%rax),%ecx
mov    -0x30(%rbp),%rax
movsbl 0x3(%rax),%r8d
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe0d(%rip),%rsi
lea    -0x34(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x34(%rbp),%esi
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x73,%esi
mov    $0x6b,%edx
mov    $0x75,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rbx
lea    0xe8f(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    0xe84(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x41,%esi
mov    $0x52,%edx
mov    $0x55,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe82(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
call   1040 <sscanf@plt>
mov    0xc(%rsp),%esi
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"sku\00"
@.str.1 = [22 x i8] c"numbers: %d %d %d %d\0A\00"
@.str.2 = [24 x i8] c"name each: %c %c %c %c\0A\00"
@.str.3 = [10 x i8] c"name: %s\0A\00"
@.str.4 = [4 x i8] c"ARU\00"
@.str.5 = [13 x i8] c"another: %s\0A\00"
@.str.6 = [27 x i8] c"another each: %c %c %c %c\0A\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [49 x i8] c"Printing an array of 4 characters as integer %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [4 x i32]* %6 to i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %7
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%12 = load i32, i32* %11
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
%16 = load i32, i32* %15
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14, i32 %16, i32 %18)
%20 = load i8*, i8** %7
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = load i8*, i8** %7
%29 = getelementptr inbounds i8, i8* %28, i64 2
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = load i8*, i8** %7
%33 = getelementptr inbounds i8, i8* %32, i64 3
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %27, i32 %31, i32 %35)
%37 = load i8*, i8** %7
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
store i32 1, i32* %39
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
store i32 2, i32* %40
%41 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
store i32 3, i32* %41
%42 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
store i32 4, i32* %42
%43 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%44 = load i32, i32* %43
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
%46 = load i32, i32* %45
%47 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
%48 = load i32, i32* %47
%49 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %46, i32 %48, i32 %50)
%52 = load i8*, i8** %7
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %52)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %8
%54 = load i8*, i8** %8
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %54)
%56 = load i8*, i8** %8
%57 = getelementptr inbounds i8, i8* %56, i64 0
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = load i8*, i8** %8
%61 = getelementptr inbounds i8, i8* %60, i64 1
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = load i8*, i8** %8
%65 = getelementptr inbounds i8, i8* %64, i64 2
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = load i8*, i8** %8
%69 = getelementptr inbounds i8, i8* %68, i64 3
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %59, i32 %63, i32 %67, i32 %71)
%73 = load i8*, i8** %7
%74 = call i32 @sscanf(i8* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %9)
%75 = load i32, i32* %9
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 %75)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"sku\00"
@.str.1 = [22 x i8] c"numbers: %d %d %d %d\0A\00"
@.str.2 = [24 x i8] c"name each: %c %c %c %c\0A\00"
@.str.3 = [10 x i8] c"name: %s\0A\00"
@.str.4 = [4 x i8] c"ARU\00"
@.str.5 = [13 x i8] c"another: %s\0A\00"
@.str.6 = [27 x i8] c"another each: %c %c %c %c\0A\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [49 x i8] c"Printing an array of 4 characters as integer %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 115, i32 107, i32 117, i32 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 65, i32 82, i32 85, i32 0)
%11 = bitcast i32* %3 to i8*
%12 = call i32 @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 %13)
ret i32 0
}