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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int rmConfigValue(char *);
int doRmConfig(FILE *file, int argc, char **argv) {
  int status;
  if (argc == 1) {
    status = rmConfigValue(argv[0]);
    if (status == 1) {
      printf("Config value '%s' was removed\n", argv[0]);
    } else {
      printf("Error - failed to remove config value.\n");
    }
  } else {
    printf("Error - expected 1 argument, the name of the config parameter to "
           "be removed.\n");
    status = 0;
  }
  return status;
}


x86 assembly (clang, -O0):
<doRmConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1183 <doRmConfig+0x63>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <rmConfigValue@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1170 <doRmConfig+0x50>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    117e <doRmConfig+0x5e>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1198 <doRmConfig+0x78>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doRmConfig>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%esi
jne    1161 <doRmConfig+0x31>
mov    %rdx,%r14
mov    (%rdx),%rdi
call   1040 <rmConfigValue@plt>
cmp    $0x1,%eax
jne    1171 <doRmConfig+0x41>
mov    (%r14),%rsi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
jmp    117f <doRmConfig+0x4f>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
jmp    117f <doRmConfig+0x4f>
mov    %eax,%ebx
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Config value '%s' was removed\0A\00"
@.str.1 = [40 x i8] c"Error - failed to remove config value.\0A\00"
@.str.2 = [78 x i8] c"Error - expected 1 argument, the name of the config parameter to be removed.\0A\00"
define i32 @doRmConfig(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %25
10: ; preds = %3
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @rmConfigValue(i8* %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %22
17: ; preds = %10
%18 = load i8**, i8*** %6
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %24
22: ; preds = %10
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
br label %27
25: ; preds = %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %27
27: ; preds = %25, %24
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
@.str = [31 x i8] c"Config value '%s' was removed\0A\00"
@str = [77 x i8] c"Error - expected 1 argument, the name of the config parameter to be removed.\00"
@str.3 = [39 x i8] c"Error - failed to remove config value.\00"
define i32 @doRmConfig(i32* nocapture readnone %0, i32 %1, i8** nocapture %2) {
%4 = icmp eq i32 %1, 1
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = load i8*, i8** %2
%7 = tail call i32 @rmConfigValue(i8* %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %16
12: ; preds = %5
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.3, i64 0, i64 0))
br label %16
14: ; preds = %3
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %9, %12, %14
%17 = phi i32 [ 1, %9 ], [ %7, %12 ], [ 0, %14 ]
ret i32 %17
}