#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*/ do_a();
int /*<<< orphan*/ do_b();
int /*<<< orphan*/ do_c();
int /*<<< orphan*/ do_d();
int test_condition() {
  int a = 1;
  int b = 2;
  int c = 3;
  do_a();
  if (a > b && b > c)
    return 1;
  do_b();
  if (a < b || b < c)
    return 2;
  do_c();
  if ((a == b) && !(a == c || b >= c))
    return 3;
  do_d();
  return 4;
}


x86 assembly (clang, -O0):
<test_condition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    $0x0,%al
call   1050 <do_a@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1188 <test_condition+0x48>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1188 <test_condition+0x48>
movl   $0x1,-0x4(%rbp)
jmp    11f8 <test_condition+0xb8>
mov    $0x0,%al
call   1030 <do_b@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     11a7 <test_condition+0x67>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b3 <test_condition+0x73>
movl   $0x2,-0x4(%rbp)
jmp    11f8 <test_condition+0xb8>
mov    $0x0,%al
call   1060 <do_c@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11ea <test_condition+0xaa>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     11ea <test_condition+0xaa>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ea <test_condition+0xaa>
movl   $0x3,-0x4(%rbp)
jmp    11f8 <test_condition+0xb8>
mov    $0x0,%al
call   1040 <do_d@plt>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_condition>:
push   %rax
xor    %eax,%eax
call   1040 <do_a@plt>
xor    %eax,%eax
call   1030 <do_b@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_condition() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
%5 = call i32 (...) @do_a()
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %1
br label %40
14: ; preds = %9, %0
%15 = call i32 (...) @do_b()
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %23, label %19
19: ; preds = %14
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %19, %14
store i32 2, i32* %1
br label %40
24: ; preds = %19
%25 = call i32 (...) @do_c()
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %38
29: ; preds = %24
%30 = load i32, i32* %2
%31 = load i32, i32* %4
%32 = icmp eq i32 %30, %31
br i1 %32, label %38, label %33
33: ; preds = %29
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = icmp sge i32 %34, %35
br i1 %36, label %38, label %37
37: ; preds = %33
store i32 3, i32* %1
br label %40
38: ; preds = %33, %29, %24
%39 = call i32 (...) @do_d()
store i32 4, i32* %1
br label %40
40: ; preds = %38, %37, %23, %13
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
define i32 @test_condition() {
%1 = tail call i32 (...) @do_a()
%2 = tail call i32 (...) @do_b()
ret i32 2
}