#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf(";*** File made by to_coe (by Dries007), don't edit manually! ***\n");
  printf("memory_initialization_radix=16;\n");
  printf("memory_initialization_vector=\n");
  int c;
  int count = 0;
  while ((c = getchar()) != -1) {
    if (c == '\n')
      printf("\n");
    else
      printf("%02X ", c);
  }
  printf(";");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     11a6 <main+0x86>
cmpl   $0xa,-0x8(%rbp)
jne    1190 <main+0x70>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a1 <main+0x81>
mov    -0x8(%rbp),%esi
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1160 <main+0x40>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
lea    0xef3(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
lea    0xe94(%rip),%rbx
jmp    117a <main+0x3a>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%eax
je     1170 <main+0x30>
cmp    $0xffffffff,%eax
je     1199 <main+0x59>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    117a <main+0x3a>
mov    $0x3b,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [66 x i8] c";*** File made by to_coe (by Dries007), don't edit manually! ***\0A\00"
@.str.1 = [33 x i8] c"memory_initialization_radix=16;\0A\00"
@.str.2 = [31 x i8] c"memory_initialization_vector=\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [6 x i8] c"%02X \00"
@.str.5 = [2 x i8] c";\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %18, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %2
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %18
15: ; preds = %10
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %13
br label %7
19: ; preds = %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [6 x i8] c"%02X \00"
@str = [65 x i8] c";*** File made by to_coe (by Dries007), don't edit manually! ***\00"
@str.6 = [32 x i8] c"memory_initialization_radix=16;\00"
@str.7 = [30 x i8] c"memory_initialization_vector=\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0))
br label %4
4: ; preds = %10, %0
%5 = tail call i32 (...) @getchar()
switch i32 %5, label %8 [
i32 -1, label %11
i32 10, label %6
]
6: ; preds = %4
%7 = tail call i32 @putchar(i32 10)
br label %10
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %8, %6
br label %4
11: ; preds = %4
%12 = tail call i32 @putchar(i32 59)
ret i32 0
}