#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*/ assert(int);
short f0(short);
short f0_if(short);
short f0_wh(short);
short f1(short);
short f1_if(short);
short f1_wh(short);
int main() {
  int flag;
  short a;
  short res0, res1;
  if (flag)
    a = 1;
  else
    a = 1;
  res0 = f0(a);
  res1 = f1(a);
  assert(res0 == 100);
  assert(res1 == 200);
  res0 = f0(a);
  res1 = f1(a);
  assert(res0 == 100);
  assert(res1 == 200);
  res0 = f0_if(a);
  res1 = f1_if(a);
  assert(res0 == 200);
  assert(res1 == 100);
  res0 = f0_wh(a);
  res1 = f1_wh(a);
  assert(res0 == 100);
  assert(res1 == 200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1194 <main+0x24>
movw   $0x1,-0xa(%rbp)
jmp    119a <main+0x2a>
movw   $0x1,-0xa(%rbp)
movswl -0xa(%rbp),%edi
call   1030 <f0@plt>
mov    %ax,-0xc(%rbp)
movswl -0xa(%rbp),%edi
call   1080 <f1@plt>
mov    %ax,-0xe(%rbp)
movswl -0xc(%rbp),%eax
cmp    $0x64,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movswl -0xe(%rbp),%eax
cmp    $0xc8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movswl -0xa(%rbp),%edi
call   1030 <f0@plt>
mov    %ax,-0xc(%rbp)
movswl -0xa(%rbp),%edi
call   1080 <f1@plt>
mov    %ax,-0xe(%rbp)
movswl -0xc(%rbp),%eax
cmp    $0x64,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movswl -0xe(%rbp),%eax
cmp    $0xc8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movswl -0xa(%rbp),%edi
call   1040 <f0_if@plt>
mov    %ax,-0xc(%rbp)
movswl -0xa(%rbp),%edi
call   1090 <f1_if@plt>
mov    %ax,-0xe(%rbp)
movswl -0xc(%rbp),%eax
cmp    $0xc8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movswl -0xe(%rbp),%eax
cmp    $0x64,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movswl -0xa(%rbp),%edi
call   1060 <f0_wh@plt>
mov    %ax,-0xc(%rbp)
movswl -0xa(%rbp),%edi
call   1050 <f1_wh@plt>
mov    %ax,-0xe(%rbp)
movswl -0xc(%rbp),%eax
cmp    $0x64,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movswl -0xe(%rbp),%eax
cmp    $0xc8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
call   1030 <f0@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1080 <f1@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0x64,%bx
sete   %dil
call   1070 <assert@plt>
movzwl %bp,%eax
xor    %edi,%edi
cmp    $0xc8,%eax
sete   %dil
call   1070 <assert@plt>
mov    $0x1,%edi
call   1030 <f0@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1080 <f1@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0x64,%bx
sete   %dil
call   1070 <assert@plt>
movzwl %bp,%eax
xor    %edi,%edi
cmp    $0xc8,%eax
sete   %dil
call   1070 <assert@plt>
mov    $0x1,%edi
call   1040 <f0_if@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1090 <f1_if@plt>
mov    %eax,%ebp
movzwl %bx,%eax
xor    %edi,%edi
cmp    $0xc8,%eax
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmp    $0x64,%bp
sete   %dil
call   1070 <assert@plt>
mov    $0x1,%edi
call   1060 <f0_wh@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <f1_wh@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0x64,%bx
sete   %dil
call   1070 <assert@plt>
movzwl %bp,%eax
xor    %edi,%edi
cmp    $0xc8,%eax
sete   %dil
call   1070 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i32 0, i32* %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i16 1, i16* %3
br label %10
9: ; preds = %0
store i16 1, i16* %3
br label %10
10: ; preds = %9, %8
%11 = load i16, i16* %3
%12 = call signext i16 @f0(i16 signext %11)
store i16 %12, i16* %4
%13 = load i16, i16* %3
%14 = call signext i16 @f1(i16 signext %13)
store i16 %14, i16* %5
%15 = load i16, i16* %4
%16 = sext i16 %15 to i32
%17 = icmp eq i32 %16, 100
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i16, i16* %5
%21 = sext i16 %20 to i32
%22 = icmp eq i32 %21, 200
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i16, i16* %3
%26 = call signext i16 @f0(i16 signext %25)
store i16 %26, i16* %4
%27 = load i16, i16* %3
%28 = call signext i16 @f1(i16 signext %27)
store i16 %28, i16* %5
%29 = load i16, i16* %4
%30 = sext i16 %29 to i32
%31 = icmp eq i32 %30, 100
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load i16, i16* %5
%35 = sext i16 %34 to i32
%36 = icmp eq i32 %35, 200
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = load i16, i16* %3
%40 = call signext i16 @f0_if(i16 signext %39)
store i16 %40, i16* %4
%41 = load i16, i16* %3
%42 = call signext i16 @f1_if(i16 signext %41)
store i16 %42, i16* %5
%43 = load i16, i16* %4
%44 = sext i16 %43 to i32
%45 = icmp eq i32 %44, 200
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load i16, i16* %5
%49 = sext i16 %48 to i32
%50 = icmp eq i32 %49, 100
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = load i16, i16* %3
%54 = call signext i16 @f0_wh(i16 signext %53)
store i16 %54, i16* %4
%55 = load i16, i16* %3
%56 = call signext i16 @f1_wh(i16 signext %55)
store i16 %56, i16* %5
%57 = load i16, i16* %4
%58 = sext i16 %57 to i32
%59 = icmp eq i32 %58, 100
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = load i16, i16* %5
%63 = sext i16 %62 to i32
%64 = icmp eq i32 %63, 200
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i16 @f0(i16 signext 1)
%2 = tail call signext i16 @f1(i16 signext 1)
%3 = icmp eq i16 %1, 100
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i16 %2, 200
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call signext i16 @f0(i16 signext 1)
%10 = tail call signext i16 @f1(i16 signext 1)
%11 = icmp eq i16 %9, 100
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = icmp eq i16 %10, 200
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call signext i16 @f0_if(i16 signext 1)
%18 = tail call signext i16 @f1_if(i16 signext 1)
%19 = icmp eq i16 %17, 200
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = icmp eq i16 %18, 100
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call signext i16 @f0_wh(i16 signext 1)
%26 = tail call signext i16 @f1_wh(i16 signext 1)
%27 = icmp eq i16 %25, 100
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = icmp eq i16 %26, 200
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
ret i32 0
}