#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*/ printf(char *, int, int, int);
test_1() {
  int value, i, j;
  i = 32760;
  j = 1;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
  j = -1;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
  j = 2;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
  j = -2;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
  j = 3;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
  j = -3;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
  j = 4;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
  j = -4;
  value = i / (j);
  printf("%d / (%d) =  %d\n", i, j, value);
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7ff8,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
movl   $0xfffffffe,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
movl   $0xfffffffd,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
movl   $0x4,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xddc(%rip),%rdi
call   1030 <printf@plt>
movl   $0xfffffffc,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xdb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0x1,%edx
mov    $0x7ff8,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0xffffffff,%edx
mov    $0xffff8008,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0x2,%edx
mov    $0x3ffc,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0xfffffffe,%edx
mov    $0xffffc004,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0x3,%edx
mov    $0x2aa8,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0xfffffffd,%edx
mov    $0xffffd558,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0x4,%edx
mov    $0x1ffe,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ff8,%esi
mov    $0xfffffffc,%edx
mov    $0xffffe002,%ecx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d / (%d) = %d\0A\00"
define i32 @test_1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 32760, i32* %3
store i32 1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sdiv i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
store i32 -1, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sdiv i32 %12, %13
store i32 %14, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
store i32 2, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = sdiv i32 %19, %20
store i32 %21, i32* %2
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23, i32 %24)
store i32 -2, i32* %4
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = sdiv i32 %26, %27
store i32 %28, i32* %2
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = load i32, i32* %2
%32 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %29, i32 %30, i32 %31)
store i32 3, i32* %4
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = sdiv i32 %33, %34
store i32 %35, i32* %2
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = load i32, i32* %2
%39 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %36, i32 %37, i32 %38)
store i32 -3, i32* %4
%40 = load i32, i32* %3
%41 = load i32, i32* %4
%42 = sdiv i32 %40, %41
store i32 %42, i32* %2
%43 = load i32, i32* %3
%44 = load i32, i32* %4
%45 = load i32, i32* %2
%46 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %44, i32 %45)
store i32 4, i32* %4
%47 = load i32, i32* %3
%48 = load i32, i32* %4
%49 = sdiv i32 %47, %48
store i32 %49, i32* %2
%50 = load i32, i32* %3
%51 = load i32, i32* %4
%52 = load i32, i32* %2
%53 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %50, i32 %51, i32 %52)
store i32 -4, i32* %4
%54 = load i32, i32* %3
%55 = load i32, i32* %4
%56 = sdiv i32 %54, %55
store i32 %56, i32* %2
%57 = load i32, i32* %3
%58 = load i32, i32* %4
%59 = load i32, i32* %2
%60 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %57, i32 %58, i32 %59)
%61 = load i32, i32* %1
ret i32 %61
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d / (%d) = %d\0A\00"
define i32 @test_1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 1, i32 32760)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 -1, i32 -32760)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 2, i32 16380)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 -2, i32 -16380)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 3, i32 10920)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 -3, i32 -10920)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 4, i32 8190)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 32760, i32 -4, i32 -8190)
ret i32 undef
}