int main() {
  char strValue[51];
  printf("\nPlease enter some characters to see what their hexidecimal "
         "equivalant is -->");
  gets(strValue);
  printf("\nYou entered:");
  puts(strValue);
  printf("\nWhich is the samwe as the following in hexidecimal:\n");
  for (int i = 0; i < 51; ++i) {
    printf("%x "), strValue[i];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <gets@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x33,-0x44(%rbp)
jge    11ac <main+0x7c>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1186 <main+0x56>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
lea    0xef6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x33,%ebp
lea    0xedb(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [78 x i8] c"\0APlease enter some characters to see what their hexidecimal equivalant is -->\00"
@.str.1 = [14 x i8] c"\0AYou entered:\00"
@.str.2 = [54 x i8] c"\0AWhich is the samwe as the following in hexidecimal:\0A\00"
@.str.3 = [4 x i8] c"%x \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [51 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %11
11: ; preds = %20, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 51
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
br label %20
20: ; preds = %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %11
23: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [78 x i8] c"\0APlease enter some characters to see what their hexidecimal equivalant is -->\00"
@.str.1 = [14 x i8] c"\0AYou entered:\00"
@.str.3 = [4 x i8] c"%x \00"
@str = [53 x i8] c"\0AWhich is the samwe as the following in hexidecimal:\00"
define i32 @main() {
%1 = alloca [51 x i8]
%2 = getelementptr inbounds [51 x i8], [51 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %2)
%7 = call i32 bitcast (i32 (...)* @puts to i32 (i8*)*)(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
br label %9
8: ; preds = %9
ret i32 0
9: ; preds = %0, %9
%10 = phi i32 [ 0, %0 ], [ %12, %9 ]
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, 51
br i1 %13, label %8, label %9
}