#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 */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int16_t m = 802, x1 = 2927, y1 = 1362, ICONST = 1000;
  printf("%d\n", (int16_t)(((int16_t)((int16_t)(m * x1) / ICONST)) - y1));
  printf("%d\n", -(int16_t)(((int16_t)((int16_t)(m * x1) / ICONST)) - y1));
  printf("%d\n", (int16_t)(y1 - (int16_t)((int16_t)(m * x1) / ICONST)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x322,-0x8(%rbp)
movl   $0xb6f,-0xc(%rbp)
movl   $0x552,-0x10(%rbp)
movl   $0x3e8,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%esi
sub    -0x10(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
sub    -0x10(%rbp),%eax
xor    %esi,%esi
sub    %eax,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
sub    %eax,%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3d9,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffc27,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffc27,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%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 802, i32* %2
store i32 2927, i32* %3
store i32 1362, i32* %4
store i32 1000, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
%19 = load i32, i32* %4
%20 = sub nsw i32 %18, %19
%21 = sub nsw i32 0, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %4
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %5
%28 = sdiv i32 %26, %27
%29 = sub nsw i32 %23, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 985)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -985)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -985)
ret i32 0
}