#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 make_tu(int, int);
scalar_t__ test__umodti3(int, int, int);
int main() {
  if (test__umodti3(0, 1, 0))
    return 1;
  if (test__umodti3(2, 1, 0))
    return 1;
  if (test__umodti3(make_tu(0x8000000000000000uLL, 0), 1, 0x0uLL))
    return 1;
  if (test__umodti3(make_tu(0x8000000000000000uLL, 0), 2, 0x0uLL))
    return 1;
  if (test__umodti3(make_tu(0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL), 2,
                    0x1uLL))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <test__umodti3@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    120e <main+0xee>
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <test__umodti3@plt>
cmp    $0x0,%rax
je     117a <main+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    120e <main+0xee>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <make_tu@plt>
mov    %eax,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <test__umodti3@plt>
cmp    $0x0,%rax
je     11a7 <main+0x87>
movl   $0x1,-0x4(%rbp)
jmp    120e <main+0xee>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <make_tu@plt>
mov    %eax,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <test__umodti3@plt>
cmp    $0x0,%rax
je     11d4 <main+0xb4>
movl   $0x1,-0x4(%rbp)
jmp    120e <main+0xee>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1040 <make_tu@plt>
mov    %eax,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <test__umodti3@plt>
cmp    $0x0,%rax
je     1207 <main+0xe7>
movl   $0x1,-0x4(%rbp)
jmp    120e <main+0xee>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <test__umodti3@plt>
test   %rax,%rax
jne    11bd <main+0x9d>
mov    $0x1,%ebx
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <test__umodti3@plt>
test   %rax,%rax
jne    11bd <main+0x9d>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <make_tu@plt>
mov    $0x1,%ebx
mov    %eax,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <test__umodti3@plt>
test   %rax,%rax
jne    11bd <main+0x9d>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <make_tu@plt>
mov    %eax,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <test__umodti3@plt>
test   %rax,%rax
jne    11bd <main+0x9d>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1040 <make_tu@plt>
mov    %eax,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <test__umodti3@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @test__umodti3(i32 0, i32 1, i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %25
5: ; preds = %0
%6 = call i64 @test__umodti3(i32 2, i32 1, i32 0)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %1
br label %25
9: ; preds = %5
%10 = call i32 @make_tu(i32 0, i32 0)
%11 = call i64 @test__umodti3(i32 %10, i32 1, i32 0)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %1
br label %25
14: ; preds = %9
%15 = call i32 @make_tu(i32 0, i32 0)
%16 = call i64 @test__umodti3(i32 %15, i32 2, i32 0)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %1
br label %25
19: ; preds = %14
%20 = call i32 @make_tu(i32 -1, i32 -1)
%21 = call i64 @test__umodti3(i32 %20, i32 2, i32 1)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %1
br label %25
24: ; preds = %19
store i32 0, i32* %1
br label %25
25: ; preds = %24, %23, %18, %13, %8, %4
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @test__umodti3(i32 0, i32 1, i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %19
3: ; preds = %0
%4 = tail call i64 @test__umodti3(i32 2, i32 1, i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = tail call i32 @make_tu(i32 0, i32 0)
%8 = tail call i64 @test__umodti3(i32 %7, i32 1, i32 0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = tail call i32 @make_tu(i32 0, i32 0)
%12 = tail call i64 @test__umodti3(i32 %11, i32 2, i32 0)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = tail call i32 @make_tu(i32 -1, i32 -1)
%16 = tail call i64 @test__umodti3(i32 %15, i32 2, i32 1)
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %14, %10, %6, %3, %0
%20 = phi i32 [ 1, %0 ], [ 1, %3 ], [ 1, %6 ], [ 1, %10 ], [ %18, %14 ]
ret i32 %20
}