#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 */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ ion_run_to_readname(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
int rn_check_main(int argc, char *argv[]) {
  int32_t i;
  for (i = 1; i < argc; i++) {
    char id[32] = "\0";
    ion_run_to_readname(id, argv[i], strlen(argv[i]));
    fprintf(stderr, "%s -> %s\n", argv[i], id);
  }
  return 0;
}


x86 assembly (clang, -O0):
<rn_check_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11dd <rn_check_main+0x9d>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    %eax,%edx
call   1060 <ion_run_to_readname@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    -0x40(%rbp),%rcx
lea    0xe36(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <rn_check_main+0x16>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rn_check_main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jl     11a6 <rn_check_main+0x76>
mov    %rsi,%r12
mov    %edi,%r13d
mov    $0x1,%ebp
mov    %rsp,%r14
lea    0xea8(%rip),%r15
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    (%r12,%rbp,8),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <ion_run_to_readname@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    (%r12,%rbp,8),%rdx
mov    %r15,%rsi
mov    %r14,%rcx
call   1040 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1160 <rn_check_main+0x30>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s -> %s\0A\00"
define i32 @rn_check_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca [32 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
br label %7
7: ; preds = %34, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %37
11: ; preds = %7
%12 = bitcast [32 x i8]* %6 to i8*
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%14 = load i8**, i8*** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %4
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @strlen(i8* %23)
%25 = call i32 @ion_run_to_readname(i8* %13, i8* %18, i32 %24)
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %4
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%33 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %31, i8* %32)
br label %34
34: ; preds = %11
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %7
37: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s -> %s\0A\00"
define i32 @rn_check_main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i8]
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %19
5: ; preds = %2
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 1, %5 ], [ %17, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @ion_run_to_readname(i8* %6, i8* %11, i32 %12)
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %10
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %6)
%17 = add nuw nsw i64 %9, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %19, label %8
19: ; preds = %8, %2
ret i32 0
}