#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 main(int argc, char **argv) {
  char values[10] = "hello";
  size_t i;
  printf("[");
  for (i = 0; values[i] != '\0'; i++) {
    printf("'%c', ", values[i]);
  }
  printf("]\n");
  printf("(%s)\n", values);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl -0x1a(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     118c <main+0x7c>
mov    -0x28(%rbp),%rax
movsbl -0x1a(%rbp,%rax,1),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1152 <main+0x42>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1a(%rbp),%rsi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6f6c6c6568,%rax
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
mov    $0x5b,%edi
call   1030 <putchar@plt>
lea    0x9(%rsp),%rbx
mov    $0x68,%al
lea    0xea5(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
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+0x40>
lea    0xe88(%rip),%rdi
call   1040 <puts@plt>
lea    0xe76(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.values = [10 x i8] c"hello\00\00\00\00\00"
@.str = [2 x i8] c"[\00"
@.str.1 = [7 x i8] c"'%c', \00"
@.str.2 = [3 x i8] c"]\0A\00"
@.str.3 = [6 x i8] c"(%s)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i8]* %6 to i8*
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %7
br label %10
10: ; preds = %22, %2
%11 = load i64, i64* %7
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %10
%17 = load i64, i64* %7
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %16
%23 = load i64, i64* %7
%24 = add i64 %23, 1
store i64 %24, i64* %7
br label %10
25: ; preds = %10
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.values = [10 x i8] c"hello\00\00\00\00\00"
@.str.1 = [7 x i8] c"'%c', \00"
@.str.3 = [6 x i8] c"(%s)\0A\00"
@str = [2 x i8] c"]\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @putchar(i32 91)
br label %6
6: ; preds = %2, %6
%7 = phi i8 [ %13, %6 ], [ 104, %2 ]
%8 = phi i64 [ %11, %6 ], [ 0, %2 ]
%9 = sext i8 %7 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = add i64 %8, 1
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %4)
ret i32 0
}