#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 main() {
  char arr[1024];
  gets(arr);
  int i = 0;
  printf("{");
  for (i = 0; arr[i] != 0; i++) {
    printf("'%c',", arr[i]);
  }
  printf("0x00}");
  printf("\n\n\n\n");
  printf("{");
  for (i = 0; arr[i] != 0; i++) {
    printf("'%c',0x00,", arr[i]);
  }
  printf("0x00,0x00}");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
call   1040 <gets@plt>
movl   $0x0,-0x414(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x414(%rbp)
movslq -0x414(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     11a9 <main+0x89>
movslq -0x414(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%esi
ff
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1160 <main+0x40>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x414(%rbp)
movslq -0x414(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1226 <main+0x106>
movslq -0x414(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%esi
ff
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    11dd <main+0xbd>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rdi
call   1060 <gets@plt>
mov    $0x7b,%edi
call   1030 <putchar@plt>
mov    (%rsp),%al
test   %al,%al
je     1188 <main+0x48>
lea    0x1(%rsp),%rbx
lea    0xe91(%rip),%r14
nop
movsbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1170 <main+0x30>
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7b,%edi
call   1030 <putchar@plt>
mov    (%rsp),%al
test   %al,%al
je     11d8 <main+0x98>
lea    0x1(%rsp),%rbx
lea    0xe47(%rip),%r14
nop
movsbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11c0 <main+0x80>
lea    0xe32(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [6 x i8] c"'%c',\00"
@.str.2 = [6 x i8] c"0x00}\00"
@.str.3 = [5 x i8] c"\0A\0A\0A\0A\00"
@.str.4 = [11 x i8] c"'%c',0x00,\00"
@.str.5 = [11 x i8] c"0x00,0x00}\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
store i32 0, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %21, %0
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %7
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %7
24: ; preds = %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %28
28: ; preds = %42, %24
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %45
35: ; preds = %28
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %35
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %28
45: ; preds = %28
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"'%c',\00"
@.str.2 = [6 x i8] c"0x00}\00"
@.str.4 = [11 x i8] c"'%c',0x00,\00"
@.str.5 = [11 x i8] c"0x00,0x00}\00"
@str = [4 x i8] c"\0A\0A\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @putchar(i32 123)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %0, %7
%8 = phi i64 [ %12, %7 ], [ 0, %0 ]
%9 = phi i8 [ %14, %7 ], [ %5, %0 ]
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = add nuw i64 %8, 1
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %0
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%19 = call i32 @putchar(i32 123)
%20 = load i8, i8* %2
%21 = icmp eq i8 %20, 0
br i1 %21, label %31, label %22
22: ; preds = %16, %22
%23 = phi i64 [ %27, %22 ], [ 0, %16 ]
%24 = phi i8 [ %29, %22 ], [ %20, %16 ]
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = add nuw i64 %23, 1
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %31, label %22
31: ; preds = %22, %16
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}