#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 */
typedef scalar_t__ uint32_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void time_high(struct timespec *th, struct timespec *t) {
  if ((uint32_t)t->tv_sec > (uint32_t)th->tv_sec) {
    th->tv_sec = t->tv_sec;
    th->tv_nsec = t->tv_nsec;
    return;
  }
  if ((uint32_t)t->tv_nsec > (uint32_t)th->tv_nsec)
    th->tv_nsec = t->tv_nsec;
  return;
}


x86 assembly (clang, -O0):
<time_high>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jle    1145 <time_high+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    116c <time_high+0x6c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%rax
jle    1167 <time_high+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    116c <time_high+0x6c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_high>:
mov    0x8(%rsi),%rax
cmp    0x8(%rdi),%rax
jle    1113 <time_high+0x13>
mov    %rax,0x8(%rdi)
mov    (%rsi),%rax
jmp    111b <time_high+0x1b>
mov    (%rsi),%rax
cmp    (%rdi),%rax
jle    111e <time_high+0x1e>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @time_high(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
br i1 %7, label %8, label %12
8: ; preds = %2
store i64 %4, i64* %5
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i64 %10, i64* %11
br label %19
12: ; preds = %2
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%16 = load i64, i64* %15
%17 = icmp sgt i64 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i64 %14, i64* %15
br label %19
19: ; preds = %12, %18, %8
ret void
}