#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*/ printChar(char);
int /*<<< orphan*/ printInt(char);
void main() {
  int d = 7, i, text_len = 0;
  char text[50] = "sodifh pesrupriu pseori peof sodifo.";
  char hex_digits[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                         '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
  char x[1] = {10};
  while (text[text_len] != 0)
    text_len++;
  for (i = 0; i < 128; i++) {
    printInt(x[i]);
    printChar('\n');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x7,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x32,%edx
call   1040 <memcpy@plt>
mov    0xede(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x51(%rbp)
movslq -0xc(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     119a <main+0x6a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117a <main+0x4a>
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    11d4 <main+0xa4>
movslq -0x8(%rbp),%rax
movsbl -0x51(%rbp,%rax,1),%edi
call   1030 <printInt@plt>
mov    $0xa,%edi
call   1050 <printChar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a1 <main+0x71>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <printInt@plt>
mov    $0xa,%edi
call   1040 <printChar@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.text = [50 x i8] c"sodifh pesrupriu pseori peof sodifo.\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.hex_digits = [16 x i8] c"0123456789ABCDEF"
@__const.main.x = [1 x i8] c"\0A"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [50 x i8]
%5 = alloca [16 x i8]
%6 = alloca [1 x i8]
store i32 7, i32* %1
store i32 0, i32* %3
%7 = bitcast [50 x i8]* %4 to i8*
%8 = bitcast [16 x i8]* %5 to i8*
%9 = bitcast [1 x i8]* %6 to i8*
br label %10
10: ; preds = %17, %0
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %10
20: ; preds = %10
store i32 0, i32* %2
br label %21
21: ; preds = %31, %20
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 128
br i1 %23, label %24, label %34
24: ; preds = %21
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = call i32 @printInt(i8 signext %28)
%30 = call i32 @printChar(i8 signext 10)
br label %31
31: ; preds = %24
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %21
34: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ %5, %1 ], [ 0, %0 ]
%3 = tail call i32 @printInt(i8 signext 10)
%4 = tail call i32 @printChar(i8 signext 10)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 128
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}