#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 */
unsigned int atoi(char *);
unsigned long atoll(char *);
unsigned int division(unsigned long, unsigned int, unsigned int *);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int main(int argc, char **argv) {
  unsigned long dvd;
  unsigned int div;
  unsigned int remainder = 0;
  dvd = atoll(argv[1]);
  div = atoi(argv[2]);
  unsigned int result;
  printf("%lu / %u = ", dvd, div);
  result = division(dvd, div, &remainder);
  printf("%u R %u\n", result, remainder);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoll@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x20(%rbp),%rdx
call   1040 <division@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
movl   $0x0,0x4(%rsp)
mov    0x8(%rsi),%rdi
call   1050 <atoll@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
lea    0xe93(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <division@plt>
mov    0x4(%rsp),%edx
lea    0xe7b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%lu / %u = \00"
@.str.1 = [9 x i8] c"%u R %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @atoll(i8* %12)
store i64 %13, i64* %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %7
%18 = load i64, i64* %6
%19 = trunc i64 %18 to i32
%20 = load i32, i32* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i64, i64* %6
%23 = load i32, i32* %7
%24 = call i32 @division(i64 %22, i32 %23, i32* %8)
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = load i32, i32* %8
%27 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lu / %u = \00"
@.str.1 = [9 x i8] c"%u R %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @atoll(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = trunc i64 %7 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = call i32 @division(i64 %7, i32 %10, i32* %3)
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}