#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*/ multiply(int, int, int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
void test_multiply() {
  int num, denom;
  multiply(2, 3, 7, 5, &num, &denom);
  printf("2/3 * 7/5 = %d/%d\n", num, denom);
  multiply(14, 9, 3, 2, &num, &denom);
  printf("14/9 * 3/2 = %d/%d\n", num, denom);
  multiply(8, 6, 12, 20, &num, &denom);
  printf("8/6 * 12/20 = %d/%d\n", num, denom);
}


x86 assembly (clang, -O0):
<test_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0x5,%ecx
lea    -0x4(%rbp),%r8
lea    -0x8(%rbp),%r9
call   1030 <multiply@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0xe,%edi
mov    $0x9,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
lea    -0x4(%rbp),%r8
lea    -0x8(%rbp),%r9
call   1030 <multiply@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x8,%edi
mov    $0x6,%esi
mov    $0xc,%edx
mov    $0x14,%ecx
lea    -0x4(%rbp),%r8
lea    -0x8(%rbp),%r9
call   1030 <multiply@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_multiply>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0x5,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <multiply@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    $0xe,%edi
mov    $0x9,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <multiply@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    $0x8,%edi
mov    $0x6,%esi
mov    $0xc,%edx
mov    $0x14,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <multiply@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"2/3 * 7/5 = %d/%d\0A\00"
@.str.1 = [20 x i8] c"14/9 * 3/2 = %d/%d\0A\00"
@.str.2 = [21 x i8] c"8/6 * 12/20 = %d/%d\0A\00"
define void @test_multiply() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @multiply(i32 2, i32 3, i32 7, i32 5, i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @multiply(i32 14, i32 9, i32 3, i32 2, i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 @multiply(i32 8, i32 6, i32 12, i32 20, i32* %1, i32* %2)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"2/3 * 7/5 = %d/%d\0A\00"
@.str.1 = [20 x i8] c"14/9 * 3/2 = %d/%d\0A\00"
@.str.2 = [21 x i8] c"8/6 * 12/20 = %d/%d\0A\00"
define void @test_multiply() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @multiply(i32 2, i32 3, i32 7, i32 5, i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @multiply(i32 14, i32 9, i32 3, i32 2, i32* %1, i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
%13 = call i32 @multiply(i32 8, i32 6, i32 12, i32 20, i32* %1, i32* %2)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %15)
ret void
}