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

/* Variables and functions */
int /*<<< orphan*/ free_arg(char **);
int /*<<< orphan*/ logger(int, int /*<<< orphan*/, char *, int);
int run_script(char *, char **, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int);
char *strdup(char *);
int quota_ctl(unsigned int veid, int cmd) {
  int i, ret;
  char buf[64];
  char *arg[6];
  int quiet = 0;
  int errcode = 0;
  i = 0;
  arg[i++] = strdup("/usr/sbin/vzquota");
  switch (cmd) {
  case 9:
    arg[i++] = strdup("setlimit");
    snprintf(buf, sizeof(buf), "%d", veid);
    arg[i++] = strdup(buf);
    arg[i++] = strdup("-f");
    quiet = 1;
    break;
  case 1:
    arg[i++] = strdup("drop");
    snprintf(buf, sizeof(buf), "%d", veid);
    arg[i++] = strdup(buf);
    quiet = 1;
    break;
  case 2:
    arg[i++] = strdup("stat");
    snprintf(buf, sizeof(buf), "%d", veid);
    arg[i++] = strdup(buf);
    arg[i++] = strdup("-f");
    quiet = 1;
    break;
  case 3:
    arg[i++] = strdup("stat");
    snprintf(buf, sizeof(buf), "%d", veid);
    arg[i++] = strdup(buf);
    arg[i++] = strdup("-f");
    arg[i++] = strdup("-t");
    errcode = 67;
    quiet = 1;
    break;
  case 5:
    arg[i++] = strdup("show");
    snprintf(buf, sizeof(buf), "%d", veid);
    arg[i++] = strdup(buf);
    quiet = 1;
    break;
  default:
    logger(-1, 0, "quota_ctl: Unknown action %d", cmd);
    return 3;
  }
  arg[i] = NULL;
  if ((ret = run_script("/usr/sbin/vzquota", arg, NULL, quiet))) {
    if (errcode)
      ret = errcode;
  }
  free_arg(arg);
  return ret;
}


x86 assembly (clang, -O0):
<quota_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xea1(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x90(%rbp,%rax,8)
ff
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xa0(%rbp)
sub    $0x8,%eax
ja     1484 <quota_ctl+0x334>
mov    -0xa0(%rbp),%rax
lea    0xe3b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe61(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x40,%esi
lea    0xe69(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    0xe0d(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
movl   $0x1,-0x94(%rbp)
jmp    14a6 <quota_ctl+0x356>
lea    0xddd(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x40,%esi
lea    0xdd9(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
movl   $0x1,-0x94(%rbp)
jmp    14a6 <quota_ctl+0x356>
lea    0xd76(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x40,%esi
lea    0xd6d(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    0xd11(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
movl   $0x1,-0x94(%rbp)
jmp    14a6 <quota_ctl+0x356>
lea    0xce6(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x40,%esi
lea    0xcdd(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    0xc81(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    0xc6a(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
movl   $0x43,-0x98(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    14a6 <quota_ctl+0x356>
lea    0xc30(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x40,%esi
lea    0xc1f(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %rcx,-0x90(%rbp,%rax,8)
ff
movl   $0x1,-0x94(%rbp)
jmp    14a6 <quota_ctl+0x356>
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
xor    %esi,%esi
lea    0xbbf(%rip),%rdx
call   1050 <logger@plt>
movl   $0x3,-0x4(%rbp)
jmp    150c <quota_ctl+0x3bc>
movslq -0x10(%rbp),%rax
movq   $0x0,-0x90(%rbp,%rax,8)
lea    -0x90(%rbp),%rsi
mov    -0x94(%rbp),%ecx
lea    0xb5a(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <run_script@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     14fa <quota_ctl+0x3aa>
cmpl   $0x0,-0x98(%rbp)
je     14f5 <quota_ctl+0x3a5>
mov    -0x98(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    14fa <quota_ctl+0x3aa>
lea    -0x90(%rbp),%rdi
call   1060 <free_arg@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quota_ctl>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,(%rsp)
lea    -0x1(%rbx),%eax
cmp    $0x8,%eax
ja     120d <quota_ctl+0xbd>
lea    0xe81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeb3(%rip),%rdi
jmp    1233 <quota_ctl+0xe3>
lea    0xeac(%rip),%rdi
jmp    1276 <quota_ctl+0x126>
lea    0xea0(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,0x8(%rsp)
lea    0xeb6(%rip),%rdx
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1070 <strdup@plt>
mov    %rax,0x10(%rsp)
lea    0xe5f(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,0x18(%rsp)
lea    0xe5b(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,0x20(%rsp)
mov    $0x43,%ebx
mov    $0x1,%r14b
mov    $0x5,%eax
jmp    12c3 <quota_ctl+0x173>
lea    0xe40(%rip),%rdx
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    %ebx,%ecx
call   1050 <logger@plt>
mov    $0x3,%ebx
jmp    12f7 <quota_ctl+0x1a7>
lea    0xe1c(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,0x8(%rsp)
lea    0xe2a(%rip),%rdx
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1070 <strdup@plt>
mov    %rax,0x10(%rsp)
xor    %r14d,%r14d
mov    $0x3,%eax
jmp    12c1 <quota_ctl+0x171>
lea    0xdc0(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,0x8(%rsp)
lea    0xde7(%rip),%rdx
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1070 <strdup@plt>
mov    %rax,0x10(%rsp)
lea    0xd90(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,0x18(%rsp)
xor    %r14d,%r14d
mov    $0x4,%eax
xor    %ebx,%ebx
movq   $0x0,(%rsp,%rax,8)
lea    0xd52(%rip),%rdi
mov    %rsp,%rbp
mov    %rbp,%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <run_script@plt>
test   %eax,%eax
cmove  %eax,%ebx
test   %r14b,%r14b
cmove  %eax,%ebx
mov    %rbp,%rdi
call   1060 <free_arg@plt>
mov    %ebx,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/usr/sbin/vzquota\00"
@.str.1 = [9 x i8] c"setlimit\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"-f\00"
@.str.4 = [5 x i8] c"drop\00"
@.str.5 = [5 x i8] c"stat\00"
@.str.6 = [3 x i8] c"-t\00"
@.str.7 = [5 x i8] c"show\00"
@.str.8 = [29 x i8] c"quota_ctl: Unknown action %d\00"
define i32 @quota_ctl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [64 x i8]
%9 = alloca [6 x i8*]
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %6
%12 = call i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %15
store i8* %12, i8** %16
%17 = load i32, i32* %5
switch i32 %17, label %113 [
i32 9, label %18
i32 1, label %38
i32 2, label %53
i32 3, label %73
i32 5, label %98
]
18: ; preds = %2
%19 = call i8* @strdup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %22
store i8* %19, i8** %23
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%25 = load i32, i32* %4
%26 = call i32 @snprintf(i8* %24, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%28 = call i8* @strdup(i8* %27)
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %31
store i8* %28, i8** %32
%33 = call i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
%36 = sext i32 %34 to i64
%37 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %36
store i8* %33, i8** %37
store i32 1, i32* %10
br label %116
38: ; preds = %2
%39 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
%42 = sext i32 %40 to i64
%43 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %42
store i8* %39, i8** %43
%44 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%45 = load i32, i32* %4
%46 = call i32 @snprintf(i8* %44, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%48 = call i8* @strdup(i8* %47)
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
%51 = sext i32 %49 to i64
%52 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %51
store i8* %48, i8** %52
store i32 1, i32* %10
br label %116
53: ; preds = %2
%54 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
%57 = sext i32 %55 to i64
%58 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %57
store i8* %54, i8** %58
%59 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%60 = load i32, i32* %4
%61 = call i32 @snprintf(i8* %59, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%62 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%63 = call i8* @strdup(i8* %62)
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
%66 = sext i32 %64 to i64
%67 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %66
store i8* %63, i8** %67
%68 = call i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
%71 = sext i32 %69 to i64
%72 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %71
store i8* %68, i8** %72
store i32 1, i32* %10
br label %116
73: ; preds = %2
%74 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
store i32 %76, i32* %6
%77 = sext i32 %75 to i64
%78 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %77
store i8* %74, i8** %78
%79 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%80 = load i32, i32* %4
%81 = call i32 @snprintf(i8* %79, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %80)
%82 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%83 = call i8* @strdup(i8* %82)
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
store i32 %85, i32* %6
%86 = sext i32 %84 to i64
%87 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %86
store i8* %83, i8** %87
%88 = call i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%89 = load i32, i32* %6
%90 = add nsw i32 %89, 1
store i32 %90, i32* %6
%91 = sext i32 %89 to i64
%92 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %91
store i8* %88, i8** %92
%93 = call i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%94 = load i32, i32* %6
%95 = add nsw i32 %94, 1
store i32 %95, i32* %6
%96 = sext i32 %94 to i64
%97 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %96
store i8* %93, i8** %97
store i32 67, i32* %11
store i32 1, i32* %10
br label %116
98: ; preds = %2
%99 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%100 = load i32, i32* %6
%101 = add nsw i32 %100, 1
store i32 %101, i32* %6
%102 = sext i32 %100 to i64
%103 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %102
store i8* %99, i8** %103
%104 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%105 = load i32, i32* %4
%106 = call i32 @snprintf(i8* %104, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %105)
%107 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%108 = call i8* @strdup(i8* %107)
%109 = load i32, i32* %6
%110 = add nsw i32 %109, 1
store i32 %110, i32* %6
%111 = sext i32 %109 to i64
%112 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %111
store i8* %108, i8** %112
store i32 1, i32* %10
br label %116
113: ; preds = %2
%114 = load i32, i32* %5
%115 = call i32 @logger(i32 -1, i32 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %114)
store i32 3, i32* %3
br label %134
116: ; preds = %98, %73, %53, %38, %18
%117 = load i32, i32* %6
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 %118
store i8* null, i8** %119
%120 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 0
%121 = load i32, i32* %10
%122 = call i32 @run_script(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %120, i32* null, i32 %121)
store i32 %122, i32* %7
%123 = icmp ne i32 %122, 0
br i1 %123, label %124, label %130
124: ; preds = %116
%125 = load i32, i32* %11
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %129
127: ; preds = %124
%128 = load i32, i32* %11
store i32 %128, i32* %7
br label %129
129: ; preds = %127, %124
br label %130
130: ; preds = %129, %116
%131 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i64 0, i64 0
%132 = call i32 @free_arg(i8** %131)
%133 = load i32, i32* %7
store i32 %133, i32* %3
br label %134
134: ; preds = %130, %113
%135 = load i32, i32* %3
ret i32 %135
}

LLVM IR (-O2):
@.str = [18 x i8] c"/usr/sbin/vzquota\00"
@.str.1 = [9 x i8] c"setlimit\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"-f\00"
@.str.4 = [5 x i8] c"drop\00"
@.str.5 = [5 x i8] c"stat\00"
@.str.6 = [3 x i8] c"-t\00"
@.str.7 = [5 x i8] c"show\00"
@.str.8 = [29 x i8] c"quota_ctl: Unknown action %d\00"
define i32 @quota_ctl(i32 %0, i32 %1) {
%3 = alloca [64 x i8]
%4 = alloca [6 x i8*]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%6 = bitcast [6 x i8*]* %4 to i8*
%7 = tail call dereferenceable_or_null(18) i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 0
store i8* %7, i8** %8
switch i32 %1, label %47 [
i32 9, label %9
i32 1, label %17
i32 2, label %23
i32 3, label %31
i32 5, label %41
]
9: ; preds = %2
%10 = tail call dereferenceable_or_null(9) i8* @strdup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 1
store i8* %10, i8** %11
%12 = call i32 @snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%13 = call i8* @strdup(i8* %5)
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 2
store i8* %13, i8** %14
%15 = call dereferenceable_or_null(3) i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 3
store i8* %15, i8** %16
br label %49
17: ; preds = %2
%18 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 1
store i8* %18, i8** %19
%20 = call i32 @snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%21 = call i8* @strdup(i8* %5)
%22 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 2
store i8* %21, i8** %22
br label %49
23: ; preds = %2
%24 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%25 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 1
store i8* %24, i8** %25
%26 = call i32 @snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%27 = call i8* @strdup(i8* %5)
%28 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 2
store i8* %27, i8** %28
%29 = call dereferenceable_or_null(3) i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%30 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 3
store i8* %29, i8** %30
br label %49
31: ; preds = %2
%32 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%33 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 1
store i8* %32, i8** %33
%34 = call i32 @snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%35 = call i8* @strdup(i8* %5)
%36 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 2
store i8* %35, i8** %36
%37 = call dereferenceable_or_null(3) i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%38 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 3
store i8* %37, i8** %38
%39 = call dereferenceable_or_null(3) i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%40 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 4
store i8* %39, i8** %40
br label %49
41: ; preds = %2
%42 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%43 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 1
store i8* %42, i8** %43
%44 = call i32 @snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%45 = call i8* @strdup(i8* %5)
%46 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 2
store i8* %45, i8** %46
br label %49
47: ; preds = %2
%48 = tail call i32 @logger(i32 -1, i32 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %1)
br label %59
49: ; preds = %41, %31, %23, %17, %9
%50 = phi i64 [ 3, %41 ], [ 5, %31 ], [ 4, %23 ], [ 3, %17 ], [ 4, %9 ]
%51 = phi i1 [ false, %41 ], [ true, %31 ], [ false, %23 ], [ false, %17 ], [ false, %9 ]
%52 = phi i32 [ 0, %41 ], [ 67, %31 ], [ 0, %23 ], [ 0, %17 ], [ 0, %9 ]
%53 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 %50
store i8* null, i8** %53
%54 = call i32 @run_script(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %8, i32* null, i32 1)
%55 = icmp ne i32 %54, 0
%56 = and i1 %51, %55
%57 = select i1 %56, i32 %52, i32 %54
%58 = call i32 @free_arg(i8** %8)
br label %59
59: ; preds = %49, %47
%60 = phi i32 [ 3, %47 ], [ %57, %49 ]
ret i32 %60
}