#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 /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ get_dev_id(char *);
int /*<<< orphan*/ test(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  dev_t slash_id;
  int i;
  slash_id = get_dev_id("/");
  for (i = 1; i < argc; i++)
    test(argv[i], slash_id);
  return 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    0xec3(%rip),%rdi
call   1030 <get_dev_id@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117a <main+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
call   1040 <test@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114c <main+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%r14d
lea    0xecb(%rip),%rdi
call   1030 <get_dev_id@plt>
cmp    $0x2,%r14d
jl     1165 <main+0x45>
mov    %eax,%r12d
mov    %r14d,%ebx
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbp,8),%rdi
mov    %r12d,%esi
call   1040 <test@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1150 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @get_dev_id(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 1, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @test(i8* %10, i32 %3)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret i32 0
}