#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 */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int isBiggerThan(struct timeval timeA, struct timeval timeB) {
  int ret = 0;
  if (timeA.tv_sec > timeB.tv_sec) {
    ret = 1;
  } else if (timeA.tv_sec == timeB.tv_sec) {
    if (timeA.tv_usec >= timeB.tv_usec)
      ret = 1;
    else
      ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<isBiggerThan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1135 <isBiggerThan+0x35>
movl   $0x1,-0x24(%rbp)
jmp    116e <isBiggerThan+0x6e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1169 <isBiggerThan+0x69>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     115d <isBiggerThan+0x5d>
movl   $0x1,-0x24(%rbp)
jmp    1164 <isBiggerThan+0x64>
movl   $0x0,-0x24(%rbp)
jmp    1169 <isBiggerThan+0x69>
jmp    116e <isBiggerThan+0x6e>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBiggerThan>:
mov    $0x1,%eax
cmp    %rdx,%rdi
jg     1119 <isBiggerThan+0x19>
xor    %eax,%eax
cmp    %rdx,%rdi
jne    1119 <isBiggerThan+0x19>
xor    %eax,%eax
cmp    %rcx,%rsi
setge  %al
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @isBiggerThan(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca i32
%8 = bitcast %struct.timeval* %5 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = bitcast %struct.timeval* %6 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
store i64 %2, i64* %12
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
store i64 %3, i64* %13
store i32 0, i32* %7
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%17 = load i64, i64* %16
%18 = icmp sgt i64 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %4
store i32 1, i32* %7
br label %36
20: ; preds = %4
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%22 = load i64, i64* %21
%23 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%24 = load i64, i64* %23
%25 = icmp eq i64 %22, %24
br i1 %25, label %26, label %35
26: ; preds = %20
%27 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%28 = load i64, i64* %27
%29 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%30 = load i64, i64* %29
%31 = icmp sge i64 %28, %30
br i1 %31, label %32, label %33
32: ; preds = %26
store i32 1, i32* %7
br label %34
33: ; preds = %26
store i32 0, i32* %7
br label %34
34: ; preds = %33, %32
br label %35
35: ; preds = %34, %20
br label %36
36: ; preds = %35, %19
%37 = load i32, i32* %7
ret i32 %37
}

LLVM IR (-O2):
define i32 @isBiggerThan(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp sgt i64 %0, %2
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = icmp eq i64 %0, %2
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = icmp sge i64 %1, %3
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %8, %4, %6
%12 = phi i32 [ 0, %6 ], [ 1, %4 ], [ %10, %8 ]
ret i32 %12
}