#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 EXIT_SUCCESS;
int /*<<< orphan*/ isalnum(int);
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  int i;
  char *p;
  int c;
  for (i = 1; i < argc; i++) {
    p = argv[i];
    if (i != 1)
      putchar(' ');
    while (*p) {
      c = (unsigned char)*p++;
      if (!isalnum(c))
        c = '_';
      putchar(c);
    }
  }
  putchar('\n');
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cf <main+0xaf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     116d <main+0x4d>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1172 <main+0x52>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     11bc <main+0x9c>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
jne    11ac <main+0x8c>
movl   $0x5f,-0x24(%rbp)
mov    -0x24(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1172 <main+0x52>
jmp    11c1 <main+0xa1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11a6 <main+0x86>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%r12d
mov    $0x5f,%r13d
jmp    1159 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r12
cmp    %r15,%r12
je     11a6 <main+0x86>
mov    (%r14,%r12,8),%rbx
cmp    $0x1,%r12
je     116d <main+0x4d>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    (%rbx),%al
test   %al,%al
je     1150 <main+0x30>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movzbl %al,%ebp
mov    %ebp,%edi
call   1040 <isalnum@plt>
test   %eax,%eax
cmove  %r13d,%ebp
movsbl %bpl,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1180 <main+0x60>
jmp    1150 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = 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*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %9
9: ; preds = %42, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %45
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
store i8* %18, i8** %7
%19 = load i32, i32* %6
%20 = icmp ne i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = call i32 @putchar(i8 signext 32)
br label %23
23: ; preds = %21, %13
br label %24
24: ; preds = %37, %23
%25 = load i8*, i8** %7
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %41
28: ; preds = %24
%29 = load i8*, i8** %7
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %7
%31 = load i8, i8* %29
%32 = zext i8 %31 to i32
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = call i32 @isalnum(i32 %33)
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %28
store i32 95, i32* %8
br label %37
37: ; preds = %36, %28
%38 = load i32, i32* %8
%39 = trunc i32 %38 to i8
%40 = call i32 @putchar(i8 signext %39)
br label %24
41: ; preds = %24
br label %42
42: ; preds = %41
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %9
45: ; preds = %9
%46 = call i32 @putchar(i8 signext 10)
%47 = load i32, i32* @EXIT_SUCCESS
ret i32 %47
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %30
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %27
%7 = phi i64 [ 1, %4 ], [ %28, %27 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i64 %7, 1
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 @putchar(i8 signext 32)
br label %13
13: ; preds = %11, %6
%14 = load i8, i8* %9
%15 = icmp eq i8 %14, 0
br i1 %15, label %27, label %16
16: ; preds = %13, %16
%17 = phi i8 [ %25, %16 ], [ %14, %13 ]
%18 = phi i8* [ %19, %16 ], [ %9, %13 ]
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = zext i8 %17 to i32
%21 = tail call i32 @isalnum(i32 %20)
%22 = icmp eq i32 %21, 0
%23 = select i1 %22, i8 95, i8 %17
%24 = tail call i32 @putchar(i8 signext %23)
%25 = load i8, i8* %19
%26 = icmp eq i8 %25, 0
br i1 %26, label %27, label %16
27: ; preds = %16, %13
%28 = add nuw nsw i64 %7, 1
%29 = icmp eq i64 %28, %5
br i1 %29, label %30, label %6
30: ; preds = %27, %2
%31 = tail call i32 @putchar(i8 signext 10)
%32 = load i32, i32* @EXIT_SUCCESS
ret i32 %32
}