#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 execvp(char *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int setuid(int);
int /*<<< orphan*/ stderr;
main(int argc, char *argv[]) {
  int rc, cc;
  cc = setuid(96);
  rc = execvp("/usr/sbin/saslpasswd2", argv);
  if ((rc != 0) || (cc != 0)) {
    fprintf(stderr, "__ %s:  failed %d  %d\n", argv[0], rc, cc);
    return 1;
  }
  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)
mov    $0x60,%edi
call   1050 <setuid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <execvp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    117a <main+0x4a>
cmpl   $0x0,-0x18(%rbp)
je     11a9 <main+0x79>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe7e(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b0 <main+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    $0x60,%edi
call   1050 <setuid@plt>
mov    %eax,%ebp
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
call   1040 <execvp@plt>
xor    %ecx,%ecx
mov    %eax,%edx
or     %ebp,%edx
je     117b <main+0x4b>
mov    0x2e80(%rip),%rcx
mov    (%rcx),%edi
mov    (%rbx),%rdx
lea    0xeaa(%rip),%rsi
mov    %eax,%ecx
mov    %ebp,%r8d
call   1030 <fprintf@plt>
mov    $0x1,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/usr/sbin/saslpasswd2\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"__ %s: failed %d %d\0A\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 @setuid(i32 96)
store i32 %8, i32* %7
%9 = load i8**, i8*** %5
%10 = call i32 @execvp(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %2
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %13, %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %20, i32 %21, i32 %22)
store i32 1, i32* %3
br label %25
24: ; preds = %13
store i32 0, i32* %3
br label %25
25: ; preds = %24, %16
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [22 x i8] c"/usr/sbin/saslpasswd2\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"__ %s: failed %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setuid(i32 96)
%4 = tail call i32 @execvp(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %1)
%5 = icmp ne i32 %4, 0
%6 = icmp ne i32 %3, 0
%7 = select i1 %5, i1 true, i1 %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 %4, i32 %3)
br label %12
12: ; preds = %2, %8
%13 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %13
}