#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 divide(unsigned int, unsigned int);
int /*<<< orphan*/ divide2(unsigned int, unsigned int, unsigned int *,
                           unsigned int *);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          ...);
int main() {
  unsigned a, b, q, r;
  a = 255;
  b = 8;
  printf("1: %d / %d = %d \n", a, b, divide(a, b));
  divide2(a, b, &q, &r);
  printf("2: %d / %d = %d (%d) \n", a, b, q, r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <divide@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1050 <divide2@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xff,%edi
mov    $0x8,%esi
call   1030 <divide@plt>
lea    0xeb9(%rip),%rdi
mov    $0xff,%esi
mov    $0x8,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0xff,%edi
mov    $0x8,%esi
call   1050 <divide2@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
lea    0xe92(%rip),%rdi
mov    $0xff,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"1: %d / %d = %d \0A\00"
@.str.1 = [23 x i8] c"2: %d / %d = %d (%d) \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 255, i32* %2
store i32 8, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @divide(i32 %8, i32 %9)
%11 = call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @divide2(i32 %12, i32 %13, i32* %4, i32* %5)
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"1: %d / %d = %d \0A\00"
@.str.1 = [23 x i8] c"2: %d / %d = %d (%d) \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @divide(i32 255, i32 8)
%6 = tail call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 255, i32 8, i32 %5)
%7 = call i32 @divide2(i32 255, i32 8, i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 255, i32 8, i32 %8, i32 %9)
ret i32 0
}