#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 main() {
  int a = 9, b = 4, c, d;
  c = a + b;
  printf("a+b=%d\n", c);
  c = a - b;
  printf("a-b=%d\n", c);
  c = a * b;
  printf("a*b=%d\n", c);
  c = a / b;
  printf("a/b=%d\n", c);
  c = a % b;
  printf("Remainder when a divided by b=%d\n", c);
  c = 2, d = 2;
  printf("%d\n", c++);
  printf("%d\n", ++c);
  printf("c=%d\n", c);
  c = (c > 0) ? 10 : -10;
  printf("c=%d\n", c);
  a = 12, b = 39;
  printf("a&b=%d\n", a & b);
  a = 12, b = 25;
  printf("a|b=%d\n", a | b);
  return 0;
  a = 12, b = 25;
  printf("a^b=%d\n", a ^ b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%edx
mov    $0xfffffff6,%eax
mov    $0xa,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
movl   $0xc,-0x8(%rbp)
movl   $0x27,-0xc(%rbp)
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
movl   $0xc,-0x8(%rbp)
movl   $0x19,-0xc(%rbp)
mov    -0x8(%rbp),%esi
or     -0xc(%rbp),%esi
lea    0xdff(%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),%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x24,%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x1d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"a+b=%d\0A\00"
@.str.1 = [8 x i8] c"a-b=%d\0A\00"
@.str.2 = [8 x i8] c"a*b=%d\0A\00"
@.str.3 = [8 x i8] c"a/b=%d\0A\00"
@.str.4 = [34 x i8] c"Remainder when a divided by b=%d\0A\00"
@.str.5 = [4 x i8] c"%d\0A\00"
@.str.6 = [6 x i8] c"c=%d\0A\00"
@.str.7 = [8 x i8] c"a&b=%d\0A\00"
@.str.8 = [8 x i8] c"a|b=%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 9, i32* %2
store i32 4, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = sdiv i32 %21, %22
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = srem i32 %26, %27
store i32 %28, i32* %4
%29 = load i32, i32* %4
%30 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %29)
store i32 2, i32* %4
store i32 2, i32* %5
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %31)
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %4
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %4
%40 = icmp sgt i32 %39, 0
%41 = zext i1 %40 to i64
%42 = select i1 %40, i32 10, i32 -10
store i32 %42, i32* %4
%43 = load i32, i32* %4
%44 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %43)
store i32 12, i32* %2
store i32 39, i32* %3
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = and i32 %45, %46
%48 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %47)
store i32 12, i32* %2
store i32 25, i32* %3
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = or i32 %49, %50
%52 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %51)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"a+b=%d\0A\00"
@.str.1 = [8 x i8] c"a-b=%d\0A\00"
@.str.2 = [8 x i8] c"a*b=%d\0A\00"
@.str.3 = [8 x i8] c"a/b=%d\0A\00"
@.str.4 = [34 x i8] c"Remainder when a divided by b=%d\0A\00"
@.str.5 = [4 x i8] c"%d\0A\00"
@.str.6 = [6 x i8] c"c=%d\0A\00"
@.str.7 = [8 x i8] c"a&b=%d\0A\00"
@.str.8 = [8 x i8] c"a|b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 36)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 4)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 4)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 10)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 4)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 29)
ret i32 0
}