#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*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc <= 1 || !strcmp(argv[1], "stdout")) {
    fputs("abc\ndef\n", stdout);
    fputs("uvw\nxyz\n", stdout);
  } else if (!strcmp(argv[1], "mixed")) {
    fputs("abc\ndef\n", stderr);
    fputs("uvw\nxyz\n", stdout);
  } else if (!strcmp(argv[1], "stderr")) {
    fputs("abc\ndef\n", stderr);
    fputs("uvw\nxyz\n", stderr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    115d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    118c <main+0x6c>
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
lea    0xe9a(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
lea    0xe8e(%rip),%rdi
call   1030 <fputs@plt>
jmp    1229 <main+0x109>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d8 <main+0xb8>
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
lea    0xe4e(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%esi
lea    0xe42(%rip),%rdi
call   1030 <fputs@plt>
jmp    1224 <main+0x104>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe38(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    121f <main+0xff>
mov    0x2de4(%rip),%rax
mov    (%rax),%esi
lea    0xe02(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%esi
lea    0xdf6(%rip),%rdi
call   1030 <fputs@plt>
jmp    1224 <main+0x104>
jmp    1229 <main+0x109>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%rbx
cmp    $0x2,%edi
jl     1179 <main+0x59>
mov    0x8(%rsi),%r14
lea    0xec5(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1179 <main+0x59>
lea    0xecb(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11a2 <main+0x82>
lea    0xebe(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1198 <main+0x78>
mov    0x2e6c(%rip),%rax
mov    %rax,%rbx
jmp    117c <main+0x5c>
mov    %rbx,%rax
mov    (%rax),%esi
lea    0xe82(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xe7d(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e37(%rip),%rax
jmp    117c <main+0x5c>

LLVM IR (-O0):
@.str = [7 x i8] c"stdout\00"
@.str.1 = [9 x i8] c"abc\0Adef\0A\00"
@stdout = global i32 0
@.str.2 = [9 x i8] c"uvw\0Axyz\0A\00"
@.str.3 = [6 x i8] c"mixed\00"
@stderr = global i32 0
@.str.4 = [7 x i8] c"stderr\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %8, %2
%15 = load i32, i32* @stdout
%16 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %43
19: ; preds = %8
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stdout
%29 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %28)
br label %42
30: ; preds = %19
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %41, label %36
36: ; preds = %30
%37 = load i32, i32* @stderr
%38 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = load i32, i32* @stderr
%40 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %36, %30
br label %42
42: ; preds = %41, %25
br label %43
43: ; preds = %42, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"stdout\00"
@.str.1 = [9 x i8] c"abc\0Adef\0A\00"
@stdout = global i32 0
@.str.2 = [9 x i8] c"uvw\0Axyz\0A\00"
@.str.3 = [6 x i8] c"mixed\00"
@stderr = global i32 0
@.str.4 = [7 x i8] c"stderr\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12, %9, %2, %4
%16 = phi i32* [ @stdout, %4 ], [ @stdout, %2 ], [ @stderr, %9 ], [ @stderr, %12 ]
%17 = phi i32* [ @stdout, %4 ], [ @stdout, %2 ], [ @stdout, %9 ], [ @stderr, %12 ]
%18 = load i32, i32* %16
%19 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %17
%21 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %15, %12
ret i32 0
}