#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*/ get_mime(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putmime(int /*<<< orphan*/);
int main(int argc, char **argv) {
  while (--argc) {
    printf("%s : ", argv[argc]);
    putmime(get_mime(argv[argc]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     118d <main+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <get_mime@plt>
mov    %eax,%edi
call   1040 <putmime@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%eax
add    $0xffffffff,%eax
je     1185 <main+0x55>
cltq
lea    (%rsi,%rax,8),%r12
mov    $0x1,%r15d
sub    %edi,%r15d
xor    %ebx,%ebx
lea    0xea9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r12,%rbx,8),%rdi
call   1050 <get_mime@plt>
mov    %eax,%edi
call   1040 <putmime@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r15d
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s : \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8**, i8*** %5
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @get_mime(i8* %21)
%23 = call i32 @putmime(i32 %22)
br label %6
24: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s : \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = sext i32 %3 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %15, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %9
%13 = tail call i32 @get_mime(i8* %12)
%14 = tail call i32 @putmime(i32 %13)
%15 = add nsw i64 %8, -1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %7, %2
ret i32 0
}