#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 setenv_empty(char **, char **);
int setenv_nd_empty(char **, char **);
int setenv_not_empty(char **, char **);
int my_setenv(char **env, char **s) {
  if ((setenv_empty(env, s)) == 1)
    return (1);
  else if ((setenv_nd_empty(env, s)) == 1)
    return (1);
  if ((setenv_not_empty(env, s)) == 1)
    return (1);
  return (1);
}


x86 assembly (clang, -O0):
<my_setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <setenv_empty@plt>
cmp    $0x1,%eax
jne    1162 <my_setenv+0x32>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <my_setenv+0x82>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <setenv_nd_empty@plt>
cmp    $0x1,%eax
jne    1184 <my_setenv+0x54>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <my_setenv+0x82>
jmp    1189 <my_setenv+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <setenv_not_empty@plt>
cmp    $0x1,%eax
jne    11ab <my_setenv+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <my_setenv+0x82>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_setenv>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <setenv_empty@plt>
cmp    $0x1,%eax
je     115f <my_setenv+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <setenv_nd_empty@plt>
cmp    $0x1,%eax
je     115f <my_setenv+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <setenv_not_empty@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @my_setenv(i8** %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
store i8** %0, i8*** %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %4
%7 = load i8**, i8*** %5
%8 = call i32 @setenv_empty(i8** %6, i8** %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %25
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = load i8**, i8*** %5
%14 = call i32 @setenv_nd_empty(i8** %12, i8** %13)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %3
br label %25
17: ; preds = %11
br label %18
18: ; preds = %17
%19 = load i8**, i8*** %4
%20 = load i8**, i8*** %5
%21 = call i32 @setenv_not_empty(i8** %19, i8** %20)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 1, i32* %3
br label %25
24: ; preds = %18
store i32 1, i32* %3
br label %25
25: ; preds = %24, %23, %16, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @my_setenv(i8** %0, i8** %1) {
%3 = tail call i32 @setenv_empty(i8** %0, i8** %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @setenv_nd_empty(i8** %0, i8** %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @setenv_not_empty(i8** %0, i8** %1)
br label %10
10: ; preds = %8, %5, %2
ret i32 1
}