#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_ultimate_div_mod(int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a;
  int b;
  int copya;
  int copyb;
  a = 10;
  copya = a;
  b = 3;
  copyb = b;
  ft_ultimate_div_mod(&a, &b);
  printf("a(before): %i, b(before): %i, a(after): %i, b(after): %i\n", copya,
         copyb, a, b);
  if (copya == copyb * a + b)
    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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <ft_ultimate_div_mod@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    1199 <main+0x79>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
lea    0xea3(%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
movl   $0xa,0x4(%rsp)
movl   $0x3,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <ft_ultimate_div_mod@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
lea    0xea4(%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    0xec6(%rip),%rax
lea    0xeb2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"a(before): %i, b(before): %i, a(after): %i, b(after): %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
%6 = load i32, i32* %2
store i32 %6, i32* %4
store i32 3, i32* %3
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = call i32 @ft_ultimate_div_mod(i32* %2, i32* %3)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %2
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %3
%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 = [58 x i8] c"a(before): %i, b(before): %i, a(after): %i, b(after): %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*
store i32 10, i32* %1
store i32 3, i32* %2
%5 = call i32 @ft_ultimate_div_mod(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 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
}