#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 /*<<< orphan*/ ft_div_mod(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a;
  int b;
  int div;
  int mod;
  a = 10;
  b = 3;
  ft_div_mod(a, b, &div, &mod);
  printf("a: %i, b: %i, div: %i, mod: %i\n", a, b, div, mod);
  if (a == b * div + mod)
    printf("CORRECT\n");
  else
    printf("FAKE AND GAY\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1040 <ft_div_mod@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jne    1193 <main+0x73>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a1 <main+0x81>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0xa,%edi
mov    $0x3,%esi
call   1050 <ft_div_mod@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
lea    0xea9(%rip),%rdi
mov    $0xa,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
lea    (%rax,%rax,2),%eax
add    (%rsp),%eax
cmp    $0xa,%eax
lea    0xeb1(%rip),%rax
lea    0xe9d(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"a: %i, b: %i, div: %i, mod: %i\0A\00"
@.str.1 = [9 x i8] c"CORRECT\0A\00"
@.str.2 = [14 x i8] c"FAKE AND GAY\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 10, i32* %2
store i32 3, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @ft_div_mod(i32 %6, i32 %7, i32* %4, i32* %5)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %5
%19 = add nsw i32 %17, %18
%20 = icmp eq i32 %14, %19
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"a: %i, b: %i, div: %i, mod: %i\0A\00"
@str = [13 x i8] c"FAKE AND GAY\00"
@str.3 = [8 x i8] c"CORRECT\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @ft_div_mod(i32 10, i32 3, i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 10, i32 3, i32 %6, i32 %7)
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 3
%11 = load i32, i32* %2
%12 = add nsw i32 %10, %11
%13 = icmp eq i32 %12, 10
%14 = select i1 %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0)
%15 = call i32 @puts(i8* dereferenceable(1) %14)
ret i32 0
}