#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long quot;
  long long rem;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
int atol(char *);
TYPE_1__ lldiv(long long, long long);
int /*<<< orphan*/ printf(char *, long long, long long);
int main(int argc, char **argv) {
  long long numerator = (argc > 1) ? atol(argv[1]) : 5088824049625;
  long long denominator = (argc > 2) ? atol(argv[2]) : 33554393;
  lldiv_t result = lldiv(numerator, denominator);
  printf("lldiv_t result = lldiv(%llu,%llu);\n", numerator, denominator);
  printf("result.quot: %llu, result.remainder: %llu\n", result.quot,
         result.rem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1168 <main+0x38>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atol@plt>
cltq
mov    %rax,-0x38(%rbp)
jmp    117b <main+0x4b>
movabs $0x4a0d58cbfd9,%rax
mov    %rax,-0x38(%rbp)
jmp    117b <main+0x4b>
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    11a2 <main+0x72>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atol@plt>
mov    %eax,-0x3c(%rbp)
jmp    11af <main+0x7f>
mov    $0x1ffffd9,%eax
mov    %eax,-0x3c(%rbp)
jmp    11af <main+0x7f>
mov    -0x3c(%rbp),%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <lldiv@plt>
mov    %rax,-0x30(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1ffffd9,%r12d
cmp    $0x2,%edi
jl     1167 <main+0x37>
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1050 <atol@plt>
movslq %eax,%r14
cmp    $0x2,%ebp
je     1171 <main+0x41>
mov    0x10(%r15),%rdi
call   1050 <atol@plt>
movslq %eax,%r12
jmp    1171 <main+0x41>
movabs $0x4a0d58cbfd9,%r14
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <lldiv@plt>
mov    %rax,%rbp
mov    %rdx,%rbx
lea    0xe77(%rip),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
@.str = [36 x i8] c"lldiv_t result = lldiv(%llu,%llu);\0A\00"
@.str.1 = [43 x i8] c"result.quot: %llu, result.remainder: %llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca %struct.TYPE_3__
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atol(i8* %14)
%16 = sext i32 %15 to i64
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %11
%19 = phi i64 [ %16, %11 ], [ 5088824049625, %17 ]
store i64 %19, i64* %6
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 2
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @atol(i8* %25)
br label %28
27: ; preds = %18
br label %28
28: ; preds = %27, %22
%29 = phi i32 [ %26, %22 ], [ 33554393, %27 ]
%30 = sext i32 %29 to i64
store i64 %30, i64* %7
%31 = load i64, i64* %6
%32 = load i64, i64* %7
%33 = call { i64, i64 } @lldiv(i64 %31, i64 %32)
%34 = bitcast %struct.TYPE_3__* %8 to { i64, i64 }*
%35 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %34, i32 0, i32 0
%36 = extractvalue { i64, i64 } %33, 0
store i64 %36, i64* %35
%37 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %34, i32 0, i32 1
%38 = extractvalue { i64, i64 } %33, 1
store i64 %38, i64* %37
%39 = load i64, i64* %6
%40 = load i64, i64* %7
%41 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %39, i64 %40)
%42 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%43 = load i64, i64* %42
%44 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 1
%45 = load i64, i64* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i64 %43, i64 %45)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"lldiv_t result = lldiv(%llu,%llu);\0A\00"
@.str.1 = [43 x i8] c"result.quot: %llu, result.remainder: %llu\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atol(i8* %6)
%8 = sext i32 %7 to i64
%9 = icmp eq i32 %0, 2
br i1 %9, label %15, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atol(i8* %12)
%14 = sext i32 %13 to i64
br label %15
15: ; preds = %2, %4, %10
%16 = phi i64 [ %8, %10 ], [ %8, %4 ], [ 5088824049625, %2 ]
%17 = phi i64 [ %14, %10 ], [ 33554393, %4 ], [ 33554393, %2 ]
%18 = tail call { i64, i64 } @lldiv(i64 %16, i64 %17)
%19 = extractvalue { i64, i64 } %18, 0
%20 = extractvalue { i64, i64 } %18, 1
%21 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %16, i64 %17)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i64 %19, i64 %20)
ret i32 0
}