#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);
void main() {
  int i, j, k;
  i = 2 / (-2);
  j = 2 % (-2);
  k = 2 % (-3);
  printf("i = %d\n", i);
  printf("j = %d\n", j);
  printf("k = %d\n", k);
  i = (-2) / 2;
  j = (-2) % 2;
  k = -2 % 3;
  printf("\ni = %d\n", i);
  printf("j = %d\n", j);
  printf("k = %d\n", k);
  j = 1, 2;
  k = 2 != 3;
  printf("\nj = %d\n", j);
  printf("k = %d\n", k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xfffffffe,-0xc(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeee(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffe,%esi
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"i = %d\0A\00"
@.str.1 = [8 x i8] c"j = %d\0A\00"
@.str.2 = [8 x i8] c"k = %d\0A\00"
@.str.3 = [9 x i8] c"\0Ai = %d\0A\00"
@.str.4 = [9 x i8] c"\0Aj = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -1, i32* %1
store i32 0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %8)
store i32 -1, i32* %1
store i32 0, i32* %2
store i32 -2, i32* %3
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %14)
store i32 1, i32* %2
store i32 1, i32* %3
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"i = %d\0A\00"
@.str.1 = [8 x i8] c"j = %d\0A\00"
@.str.2 = [8 x i8] c"k = %d\0A\00"
@.str.3 = [9 x i8] c"\0Ai = %d\0A\00"
@.str.4 = [9 x i8] c"\0Aj = %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 -1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 -2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}