#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*/ snprintf(char *, int, char *, int);
int system(char *);
int /*<<< orphan*/ usb_mount();
int usb_umount() {
  int i, j;
  int rval;
  char path[128];
  char buf[128];
  for (j = 1; j < 16; j++) {
    snprintf(path, 128, "/bin/umount /tmp/mnt/usb%d", j);
    rval = system(path);
  }
  usb_mount();
  return 0;
}


x86 assembly (clang, -O0):
<usb_umount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x1,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1184 <usb_umount+0x54>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x80,%esi
lea    0xe9e(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <usb_umount+0x12>
mov    $0x0,%al
call   1050 <usb_mount@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_umount>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0xebf(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x2,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x3,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x4,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x5,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x6,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x7,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x8,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0x9,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0xa,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0xb,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0xc,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0xd,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0xe,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1050 <usb_mount@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"/bin/umount /tmp/mnt/usb%d\00"
define i32 @usb_umount() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
store i32 1, i32* %2
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 16
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @snprintf(i8* %10, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%14 = call i32 @system(i8* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = call i32 (...) @usb_mount()
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"/bin/umount /tmp/mnt/usb%d\00"
define i32 @usb_umount() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
%5 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = call i32 @system(i8* %2)
%7 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = call i32 @system(i8* %2)
%9 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
%10 = call i32 @system(i8* %2)
%11 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 5)
%12 = call i32 @system(i8* %2)
%13 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 6)
%14 = call i32 @system(i8* %2)
%15 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 7)
%16 = call i32 @system(i8* %2)
%17 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 8)
%18 = call i32 @system(i8* %2)
%19 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 9)
%20 = call i32 @system(i8* %2)
%21 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 10)
%22 = call i32 @system(i8* %2)
%23 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 11)
%24 = call i32 @system(i8* %2)
%25 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 12)
%26 = call i32 @system(i8* %2)
%27 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 13)
%28 = call i32 @system(i8* %2)
%29 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 14)
%30 = call i32 @system(i8* %2)
%31 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 15)
%32 = call i32 @system(i8* %2)
%33 = call i32 (...) @usb_mount()
ret i32 0
}