#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 EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ putppt(int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  int c;
  char *p;
  (void)puts("___________");
  if (argc > 1)
    while ((p = *++argv))
      for (; *p; ++p)
        putppt((int)*p);
  else
    while ((c = getchar()) != EOF)
      putppt(c);
  (void)puts("___________");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x1,-0x8(%rbp)
jle    11cb <main+0x8b>
jmp    1171 <main+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     11c6 <main+0x86>
jmp    1197 <main+0x57>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     11c1 <main+0x81>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1040 <putppt@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1197 <main+0x57>
jmp    1171 <main+0x31>
jmp    11fb <main+0xbb>
jmp    11d0 <main+0x90>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e07(%rip),%rcx
cmp    (%rcx),%eax
je     11f6 <main+0xb6>
mov    -0x14(%rbp),%edi
call   1040 <putppt@plt>
jmp    11d0 <main+0x90>
jmp    11fb <main+0xbb>
lea    0xdfe(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%ebp
jle    1175 <main+0x35>
mov    0x8(%rbx),%rbp
test   %rbp,%rbp
jne    11a4 <main+0x64>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e65(%rip),%rbx
cmp    (%rbx),%eax
je     1162 <main+0x22>
nopw   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1040 <putppt@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1190 <main+0x50>
jmp    1162 <main+0x22>
add    $0x8,%rbx
jmp    11bd <main+0x7d>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rbx),%rbp
add    $0x8,%rbx
test   %rbp,%rbp
je     1162 <main+0x22>
mov    0x0(%rbp),%al
test   %al,%al
je     11b0 <main+0x70>
add    $0x1,%rbp
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1040 <putppt@plt>
movzbl 0x0(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
jne    11d0 <main+0x90>
jmp    11b0 <main+0x70>

LLVM IR (-O0):
@.str = [12 x i8] c"___________\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %32
11: ; preds = %2
br label %12
12: ; preds = %30, %11
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i8*, i8** %14
store i8* %15, i8** %7
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %31
17: ; preds = %12
br label %18
18: ; preds = %27, %17
%19 = load i8*, i8** %7
%20 = load i8, i8* %19
%21 = icmp ne i8 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i8*, i8** %7
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 @putppt(i32 %25)
br label %27
27: ; preds = %22
%28 = load i8*, i8** %7
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %7
br label %18
30: ; preds = %18
br label %12
31: ; preds = %12
br label %41
32: ; preds = %2
br label %33
33: ; preds = %37, %32
%34 = call i32 (...) @getchar()
store i32 %34, i32* %6
%35 = load i32, i32* @EOF
%36 = icmp ne i32 %34, %35
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = load i32, i32* %6
%39 = call i32 @putppt(i32 %38)
br label %33
40: ; preds = %33
br label %41
41: ; preds = %40, %31
%42 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%43 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"___________\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 (...) @getchar()
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %36, label %30
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %36, label %17
13: ; preds = %22, %17
%14 = getelementptr inbounds i8*, i8** %19, i64 1
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %36, label %17
17: ; preds = %9, %13
%18 = phi i8* [ %15, %13 ], [ %11, %9 ]
%19 = phi i8** [ %14, %13 ], [ %10, %9 ]
%20 = load i8, i8* %18
%21 = icmp eq i8 %20, 0
br i1 %21, label %13, label %22
22: ; preds = %17, %22
%23 = phi i8 [ %28, %22 ], [ %20, %17 ]
%24 = phi i8* [ %27, %22 ], [ %18, %17 ]
%25 = sext i8 %23 to i32
%26 = tail call i32 @putppt(i32 %25)
%27 = getelementptr inbounds i8, i8* %24, i64 1
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 0
br i1 %29, label %13, label %22
30: ; preds = %5, %30
%31 = phi i32 [ %33, %30 ], [ %6, %5 ]
%32 = tail call i32 @putppt(i32 %31)
%33 = tail call i32 (...) @getchar()
%34 = load i32, i32* @EOF
%35 = icmp eq i32 %33, %34
br i1 %35, label %36, label %30
36: ; preds = %30, %13, %5, %9
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%38 = tail call i32 @exit(i32 0)
unreachable
}