#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 */
scalar_t__ unmount(char *, int /*<<< orphan*/);
int /*<<< orphan*/ warn(char *, char *);
int refuse_unmount(int argc, char **argv) {
  int ret;
  int i;
  for (ret = 1, i = 0; i < argc; i++) {
    if (unmount(argv[i], 0) < 0) {
      warn("can't unmount `%s'", argv[i]);
      ret = 0;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<refuse_unmount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1198 <refuse_unmount+0x78>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %esi,%esi
call   1040 <unmount@plt>
cmp    $0x0,%rax
jge    1185 <refuse_unmount+0x65>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe87(%rip),%rdi
call   1030 <warn@plt>
movl   $0x0,-0x14(%rbp)
jmp    118a <refuse_unmount+0x6a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113d <refuse_unmount+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refuse_unmount>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    117a <refuse_unmount+0x5a>
mov    %rsi,%rbx
mov    %edi,%r12d
mov    $0x1,%r15d
xor    %ebp,%ebp
lea    0xebf(%rip),%r14
jmp    1159 <refuse_unmount+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbp
cmp    %rbp,%r12
je     1180 <refuse_unmount+0x60>
mov    (%rbx,%rbp,8),%rdi
xor    %esi,%esi
call   1040 <unmount@plt>
test   %rax,%rax
jns    1150 <refuse_unmount+0x30>
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
call   1030 <warn@plt>
xor    %r15d,%r15d
jmp    1150 <refuse_unmount+0x30>
mov    $0x1,%r15d
mov    %r15d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"can't unmount `%s'\00"
define i32 @refuse_unmount(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = load i8**, i8*** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i64 @unmount(i8* %16, i32 0)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %11
%20 = load i8**, i8*** %4
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 @warn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %24)
store i32 0, i32* %5
br label %26
26: ; preds = %19, %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %7
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
@.str = [19 x i8] c"can't unmount `%s'\00"
define i32 @refuse_unmount(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %16
%7 = phi i64 [ 0, %4 ], [ %18, %16 ]
%8 = phi i32 [ 1, %4 ], [ %17, %16 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i64 @unmount(i8* %10, i32 0)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = load i8*, i8** %9
%15 = tail call i32 @warn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %6, %13
%17 = phi i32 [ 0, %13 ], [ %8, %6 ]
%18 = add nuw nsw i64 %7, 1
%19 = icmp eq i64 %18, %5
br i1 %19, label %20, label %6
20: ; preds = %16, %2
%21 = phi i32 [ 1, %2 ], [ %17, %16 ]
ret i32 %21
}