#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ emit_help();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ isprint(char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  char *c;
  setlocale(LC_ALL, "C");
  argv++;
  if (!*argv)
    emit_help();
  while (*argv) {
    c = *argv;
    while (*c != '\0') {
      printf("%3c", isprint(*c) ? *c : '?');
      c++;
    }
    putchar('\n');
    c = *argv;
    while (*c != '\0')
      printf("%3x", *c++ & 255);
    putchar('\n');
    argv++;
  }
  exit(EXIT_SUCCESS);
}


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)
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
call   1060 <setlocale@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11ac <main+0x4c>
mov    $0x0,%al
call   1040 <emit_help@plt>
jmp    11b1 <main+0x51>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1295 <main+0x135>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     122c <main+0xcc>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1070 <isprint@plt>
cmp    $0x0,%rax
je     11ff <main+0x9f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    120c <main+0xac>
mov    $0x3f,%eax
mov    %eax,-0x1c(%rbp)
jmp    120c <main+0xac>
mov    -0x1c(%rbp),%esi
lea    0xdec(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11ca <main+0x6a>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     127a <main+0x11a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%esi
and    $0xff,%esi
lea    0xd96(%rip),%rdi
call   1050 <printf@plt>
jmp    1241 <main+0xe1>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    11b1 <main+0x51>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1060 <setlocale@plt>
mov    0x8(%r14),%rbx
add    $0x8,%r14
test   %rbx,%rbx
jne    11aa <main+0x4a>
xor    %eax,%eax
call   1040 <emit_help@plt>
mov    (%r14),%rbx
test   %rbx,%rbx
jne    11aa <main+0x4a>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
lea    0xe55(%rip),%r15
lea    0xe4a(%rip),%r12
jmp    11d7 <main+0x77>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%r14),%rbx
add    $0x8,%r14
test   %rbx,%rbx
je     119c <main+0x3c>
mov    (%rbx),%al
test   %al,%al
je     1220 <main+0xc0>
add    $0x1,%rbx
jmp    1207 <main+0xa7>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl -0x1(%rbx),%esi
mov    %r12,%rdi
call   1050 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1220 <main+0xc0>
movsbl %al,%edi
call   1070 <isprint@plt>
test   %rax,%rax
jne    11f0 <main+0x90>
mov    $0x3f,%esi
jmp    11f4 <main+0x94>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%r14),%rbx
mov    (%rbx),%al
test   %al,%al
je     11c0 <main+0x60>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movzbl %al,%esi
mov    %r15,%rdi
call   1050 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1240 <main+0xe0>
jmp    11c0 <main+0x60>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [4 x i8] c"%3c\00"
@.str.2 = [4 x i8] c"%3x\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @LC_ALL
%8 = call i32 @setlocale(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %5
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = call i32 (...) @emit_help()
br label %16
16: ; preds = %14, %2
br label %17
17: ; preds = %60, %16
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %64
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
store i8* %23, i8** %6
br label %24
24: ; preds = %39, %21
%25 = load i8*, i8** %6
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %44
29: ; preds = %24
%30 = load i8*, i8** %6
%31 = load i8, i8* %30
%32 = call i64 @isprint(i8 signext %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = load i8*, i8** %6
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
br label %39
38: ; preds = %29
br label %39
39: ; preds = %38, %34
%40 = phi i32 [ %37, %34 ], [ 63, %38 ]
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = load i8*, i8** %6
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %6
br label %24
44: ; preds = %24
%45 = call i32 @putchar(i8 signext 10)
%46 = load i8**, i8*** %5
%47 = load i8*, i8** %46
store i8* %47, i8** %6
br label %48
48: ; preds = %53, %44
%49 = load i8*, i8** %6
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %48
%54 = load i8*, i8** %6
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %6
%56 = load i8, i8* %54
%57 = sext i8 %56 to i32
%58 = and i32 %57, 255
%59 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %58)
br label %48
60: ; preds = %48
%61 = call i32 @putchar(i8 signext 10)
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i32 1
store i8** %63, i8*** %5
br label %17
64: ; preds = %17
%65 = load i32, i32* @EXIT_SUCCESS
%66 = call i32 @exit(i32 %65)
unreachable
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [4 x i8] c"%3c\00"
@.str.2 = [4 x i8] c"%3x\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = tail call i32 (...) @emit_help()
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %51, label %12
12: ; preds = %2, %8
%13 = phi i8* [ %6, %2 ], [ %10, %8 ]
br label %14
14: ; preds = %12, %46
%15 = phi i8* [ %49, %46 ], [ %13, %12 ]
%16 = phi i8** [ %48, %46 ], [ %5, %12 ]
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %33, label %19
19: ; preds = %14, %27
%20 = phi i8 [ %31, %27 ], [ %17, %14 ]
%21 = phi i8* [ %30, %27 ], [ %15, %14 ]
%22 = tail call i64 @isprint(i8 signext %20)
%23 = icmp eq i64 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %19
%25 = load i8, i8* %21
%26 = sext i8 %25 to i32
br label %27
27: ; preds = %19, %24
%28 = phi i32 [ %26, %24 ], [ 63, %19 ]
%29 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds i8, i8* %21, i64 1
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 0
br i1 %32, label %33, label %19
33: ; preds = %27, %14
%34 = tail call i32 @putchar(i8 signext 10)
%35 = load i8*, i8** %16
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, 0
br i1 %37, label %46, label %38
38: ; preds = %33, %38
%39 = phi i8 [ %44, %38 ], [ %36, %33 ]
%40 = phi i8* [ %42, %38 ], [ %35, %33 ]
%41 = zext i8 %39 to i32
%42 = getelementptr inbounds i8, i8* %40, i64 1
%43 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%44 = load i8, i8* %42
%45 = icmp eq i8 %44, 0
br i1 %45, label %46, label %38
46: ; preds = %38, %33
%47 = tail call i32 @putchar(i8 signext 10)
%48 = getelementptr inbounds i8*, i8** %16, i64 1
%49 = load i8*, i8** %48
%50 = icmp eq i8* %49, null
br i1 %50, label %51, label %14
51: ; preds = %46, %8
%52 = load i32, i32* @EXIT_SUCCESS
%53 = tail call i32 @exit(i32 %52)
unreachable
}