xunge/DecIR huggingface dataset:
void setLDriveBase(int valueL) {}


x86 assembly (clang, -O0):
<setLDriveBase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLDriveBase>:
ret

LLVM IR (-O0):
define void @setLDriveBase(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @setLDriveBase(i32 %0) {
ret void
}
long double rad(long double degi) {
  return 3.14159265358979323846264338327950288419716939937510582097 *
         (degi / 180.);
}


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fdivrp %st,%st(1)
fldl   0xeed(%rip)
fmulp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad>:
fldt   0x8(%rsp)
fdivs  0xef6(%rip)
fmull  0xef8(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @rad(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fdiv x86_fp80 %3, 0xK4006B400000000000000
%5 = fmul x86_fp80 0xK4000C90FDAA22168C000, %4
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @rad(x86_fp80 %0) {
%2 = fdiv x86_fp80 %0, 0xK4006B400000000000000
%3 = fmul x86_fp80 %2, 0xK4000C90FDAA22168C000
ret x86_fp80 %3
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ xsprite(int);
void basXSprite() {
  int n;
  n = popNumber();
  pushNumber(xsprite(n));
}


x86 assembly (clang, -O0):
<basXSprite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <xsprite@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basXSprite>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <xsprite@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basXSprite() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @xsprite(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basXSprite() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @xsprite(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kill(int, int);
int /*<<< orphan*/ printf(char *, int, int);
void send_sig(int pid, int sig) {
  printf("sending sig %d to %d\n", sig, pid);
  kill(pid, sig);
}


x86 assembly (clang, -O0):
<send_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_sig>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <kill@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"sending sig %d to %d\0A\00"
define void @send_sig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @kill(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"sending sig %d to %d\0A\00"
define void @send_sig(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = tail call i32 @kill(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gsm_dso2string(char *, char *);
void gsm_convertNumber(char *res, char *dso, int toa) {
  if (toa == 0x91) {
    res[0] = '+';
    gsm_dso2string(res + 1, dso);
  } else {
    gsm_dso2string(res, dso);
  }
}


x86 assembly (clang, -O0):
<gsm_convertNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x91,-0x14(%rbp)
jne    114d <gsm_convertNumber+0x3d>
mov    -0x8(%rbp),%rax
movb   $0x2b,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gsm_dso2string@plt>
jmp    115a <gsm_convertNumber+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gsm_dso2string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_convertNumber>:
cmp    $0x91,%edx
jne    111f <gsm_convertNumber+0xf>
movb   $0x2b,(%rdi)
add    $0x1,%rdi
jmp    1030 <gsm_dso2string@plt>

LLVM IR (-O0):
define void @gsm_convertNumber(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 145
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 43, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8*, i8** %5
%15 = call i32 @gsm_dso2string(i8* %13, i8* %14)
br label %20
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @gsm_dso2string(i8* %17, i8* %18)
br label %20
20: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @gsm_convertNumber(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 145
br i1 %4, label %5, label %8
5: ; preds = %3
store i8 43, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i32 @gsm_dso2string(i8* %6, i8* %1)
br label %10
8: ; preds = %3
%9 = tail call i32 @gsm_dso2string(i8* %0, i8* %1)
br label %10
10: ; preds = %8, %5
ret void
}
unsigned xrop3_7_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk1 = T | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_7_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_7_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_7_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_7_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long const, int);
bool print_callback(const unsigned long i, const void *v) {
  printf("%lu: %d\n", i, (int)v);
  return true;
}


x86 assembly (clang, -O0):
<print_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_callback>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%lu: %d\0A\00"
define i32 @print_callback(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %7)
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"%lu: %d\0A\00"
define i32 @print_callback(i64 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %4)
ret i32 1
}
void av_codec_get_chroma_intra_matrix() {}


x86 assembly (clang, -O0):
<av_codec_get_chroma_intra_matrix>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_codec_get_chroma_intra_matrix>:
ret

LLVM IR (-O0):
define void @av_codec_get_chroma_intra_matrix() {
ret void
}

LLVM IR (-O2):
define void @av_codec_get_chroma_intra_matrix() {
ret void
}
int test_imm_8Bint8_reg(signed char val) {
  return ((val) & (0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x8b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Bint8_reg>:
test   $0x8b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Bint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 139
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_8Bint8_reg(i8 signext %0) {
%2 = and i8 %0, -117
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank1(int);
void m48setParams8XX1(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank1((val & 0x3F) << 13);
}


x86 assembly (clang, -O0):
<m48setParams8XX1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0x3f,%edi
shl    $0xd,%edi
call   1030 <prg8setBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m48setParams8XX1>:
mov    %esi,%edi
and    $0x3f,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank1@plt>

LLVM IR (-O0):
define void @m48setParams8XX1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 63
%8 = shl i32 %7, 13
%9 = call i32 @prg8setBank1(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m48setParams8XX1(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = and i32 %3, 516096
%5 = tail call i32 @prg8setBank1(i32 %4)
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int wcwidth(int const);
int width(const wchar_t *wcs) {
  int w, cw;
  for (w = 0; *wcs != L'\0'; wcs++)
    if ((cw = wcwidth(*wcs)) > 0)
      w += cw;
  return (w);
}


x86 assembly (clang, -O0):
<width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1166 <width+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <wcwidth@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jle    1150 <width+0x40>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <width+0x45>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <width+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<width>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1149 <width+0x39>
add    $0x4,%rbx
xor    %r14d,%r14d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
call   1030 <wcwidth@plt>
test   %eax,%eax
cmovs  %r14d,%eax
add    %eax,%ebp
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1130 <width+0x20>
jmp    114b <width+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @width(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %19, %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = call i32 @wcwidth(i32 %11)
store i32 %12, i32* %4
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %9
br label %19
19: ; preds = %18
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i32 1
store i32* %21, i32** %2
br label %5
22: ; preds = %5
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @width(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32* [ %12, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = tail call i32 @wcwidth(i32 %5)
%9 = icmp sgt i32 %8, 0
%10 = select i1 %9, i32 %8, i32 0
%11 = add nuw nsw i32 %10, %7
%12 = getelementptr inbounds i32, i32* %6, i64 1
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
int test_imm_D0uint8_mem(unsigned char *val) {
  return ((*val) & (-0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff30,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D0uint8_mem>:
testb  $0x30,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D0uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -208
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 48
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_fixed_colors();
int /*<<< orphan*/ test_fixed_colors_order();
int main(void) {
  test_fixed_colors();
  test_fixed_colors_order();
  assert(printf("OK\n"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_fixed_colors@plt>
mov    $0x0,%al
call   1060 <test_fixed_colors_order@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_fixed_colors@plt>
xor    %eax,%eax
call   1060 <test_fixed_colors_order@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_fixed_colors()
%3 = call i32 (...) @test_fixed_colors_order()
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @assert(i32 %4)
ret i32 0
}

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


x86 assembly (clang, -O0):
<clear_perf_counter_pending>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_perf_counter_pending>:
ret

LLVM IR (-O0):
define void @clear_perf_counter_pending() {
ret void
}

LLVM IR (-O2):
define void @clear_perf_counter_pending() {
ret void
}
/* Variables and functions */
double cos(double);
double cosh(double);
double t(double x) {
  x = -x;
  x = cos(x);
  x = -x;
  x = cosh(x);
  return x;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cosh@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
push   %rax
call   1040 <cos@plt>
xorps  0xed3(%rip),%xmm0
pop    %rax
jmp    1030 <cosh@plt>

LLVM IR (-O0):
define double @t(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
store double %4, double* %2
%5 = load double, double* %2
%6 = call double @cos(double %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = fneg double %7
store double %8, double* %2
%9 = load double, double* %2
%10 = call double @cosh(double %9)
store double %10, double* %2
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @t(double %0) {
%2 = tail call double @cos(double %0)
%3 = fneg double %2
%4 = tail call double @cosh(double %3)
ret double %4
}
/* Variables and functions */
void *imgnew(char const *);
void *imgload(const char *p, void *ignore) { return imgnew(p); }


x86 assembly (clang, -O0):
<imgload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <imgnew@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgload>:
jmp    1030 <imgnew@plt>

LLVM IR (-O0):
define i8* @imgload(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i8* @imgnew(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @imgload(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i8* @imgnew(i8* %0)
ret i8* %3
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int gdialogPresent() {
  static int lGdialoglPresent = -1;
  if (lGdialoglPresent < 0) {
    lGdialoglPresent = detectPresence("gdialog");
  }
  return lGdialoglPresent && graphicMode();
}


x86 assembly (clang, -O0):
<gdialogPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <gdialogPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <gdialogPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdialogPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <gdialogPresent+0x23>
test   %eax,%eax
je     1159 <gdialogPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <gdialogPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@gdialogPresent.lGdialoglPresent = internal global i32 -1
@.str = [8 x i8] c"gdialog\00"
define i32 @gdialogPresent() {
%1 = load i32, i32* @gdialogPresent.lGdialoglPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @gdialogPresent.lGdialoglPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @gdialogPresent.lGdialoglPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@gdialogPresent.lGdialoglPresent = internal unnamed_addr global i32 -1
@.str = [8 x i8] c"gdialog\00"
define i32 @gdialogPresent() {
%1 = load i32, i32* @gdialogPresent.lGdialoglPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @gdialogPresent.lGdialoglPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printArray4(int **);
int main(void) {
  int a[3][4] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
  printArray4(a);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <printArray4@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <printArray4@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12]]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [4 x i32]]
store i32 0, i32* %1
%3 = bitcast [3 x [4 x i32]]* %2 to i8*
%4 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %2, i64 0, i64 0
%5 = bitcast [4 x i32]* %4 to i32**
%6 = call i32 @printArray4(i32** %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12]]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [3 x [4 x i32]]
%2 = bitcast [3 x [4 x i32]]* %1 to i8*
%3 = bitcast [3 x [4 x i32]]* %1 to i32**
%4 = call i32 @printArray4(i32** %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_svn() { printf("\n"); }


x86 assembly (clang, -O0):
<dummy_svn>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_svn>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @dummy_svn() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @dummy_svn() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string_trim_left(char **);
int /*<<< orphan*/ string_trim_right(char **);
void string_trim(char **text) {
  string_trim_left(text);
  string_trim_right(text);
}


x86 assembly (clang, -O0):
<string_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <string_trim_left@plt>
mov    -0x8(%rbp),%rdi
call   1040 <string_trim_right@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <string_trim_left@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <string_trim_right@plt>

LLVM IR (-O0):
define void @string_trim(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 @string_trim_left(i8** %3)
%5 = load i8**, i8*** %2
%6 = call i32 @string_trim_right(i8** %5)
ret void
}

LLVM IR (-O2):
define void @string_trim(i8** %0) {
%2 = tail call i32 @string_trim_left(i8** %0)
%3 = tail call i32 @string_trim_right(i8** %0)
ret void
}
/* Variables and functions */
int getch();
int ask_char() {
  return getch();
  return -1;
}


x86 assembly (clang, -O0):
<ask_char>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_char>:
xor    %eax,%eax
jmp    1030 <getch@plt>

LLVM IR (-O0):
define i32 @ask_char() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @ask_char() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
int rpm_cell_offset(int value) {
  if (value > 6500)
    return 6500 / 400;
  if (value < 0)
    return 0;
  if (value < 400)
    return 0;
  int cell = ((float)value / 6500) * (6500 / 400);
  return cell;
}


x86 assembly (clang, -O0):
<rpm_cell_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1964,-0x8(%rbp)
jle    1120 <rpm_cell_offset+0x20>
movl   $0x10,-0x4(%rbp)
jmp    1179 <rpm_cell_offset+0x79>
cmpl   $0x0,-0x8(%rbp)
jge    1136 <rpm_cell_offset+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1179 <rpm_cell_offset+0x79>
cmpl   $0x190,-0x8(%rbp)
jge    114f <rpm_cell_offset+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1179 <rpm_cell_offset+0x79>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xea8(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe98(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpm_cell_offset>:
mov    $0x10,%eax
cmp    $0x1964,%edi
jg     112f <rpm_cell_offset+0x2f>
xor    %eax,%eax
cmp    $0x190,%edi
jl     112f <rpm_cell_offset+0x2f>
cvtsi2ss %edi,%xmm0
divss  0xedd(%rip),%xmm0
mulss  0xed9(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @rpm_cell_offset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 6500
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 16, i32* %2
br label %23
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %2
br label %23
12: ; preds = %8
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 400
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 0, i32* %2
br label %23
16: ; preds = %12
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to float
%19 = fdiv float %18, 6.500000e+03
%20 = fmul float %19, 1.600000e+01
%21 = fptosi float %20 to i32
store i32 %21, i32* %4
%22 = load i32, i32* %4
store i32 %22, i32* %2
br label %23
23: ; preds = %16, %15, %11, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @rpm_cell_offset(i32 %0) {
%2 = icmp sgt i32 %0, 6500
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 400
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = sitofp i32 %0 to float
%7 = fdiv float %6, 6.500000e+03
%8 = fmul float %7, 1.600000e+01
%9 = fptosi float %8 to i32
br label %10
10: ; preds = %3, %1, %5
%11 = phi i32 [ %9, %5 ], [ 16, %1 ], [ 0, %3 ]
ret i32 %11
}
char *langRomTypeSccPlus() { return "SCC+"; }


x86 assembly (clang, -O0):
<langRomTypeSccPlus>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeSccPlus>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"SCC+\00"
define i8* @langRomTypeSccPlus() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"SCC+\00"
define i8* @langRomTypeSccPlus() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ check_double();
int /*<<< orphan*/ check_float();
int /*<<< orphan*/ check_long_double();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  check_float();
  check_double();
  check_long_double();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_float@plt>
mov    $0x0,%al
call   1050 <check_double@plt>
mov    $0x0,%al
call   1040 <check_long_double@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_float@plt>
xor    %eax,%eax
call   1050 <check_double@plt>
xor    %eax,%eax
call   1040 <check_long_double@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_float()
%3 = call i32 (...) @check_double()
%4 = call i32 (...) @check_long_double()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_float()
%2 = tail call i32 (...) @check_double()
%3 = tail call i32 (...) @check_long_double()
%4 = tail call i32 @exit(i32 0)
unreachable
}
main() {
  int i = 0;
  while (i < 5)
    ;
  printf(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1135 <main+0x25>
jmp    1126 <main+0x16>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 (i8*, ...) @printf(i8* %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ __fputc(int, void *);
void arch_write_char(void *num_chars_printed_ptr, int c) {
  int *num_chars_printed = (int *)num_chars_printed_ptr;
  (*num_chars_printed)++;
  __fputc(c, ((void *)0));
}


x86 assembly (clang, -O0):
<arch_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <__fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_write_char>:
addl   $0x1,(%rdi)
mov    %esi,%edi
xor    %esi,%esi
jmp    1030 <__fputc@plt>

LLVM IR (-O0):
define void @arch_write_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = call i32 @__fputc(i32 %11, i8* null)
ret void
}

LLVM IR (-O2):
define void @arch_write_char(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = tail call i32 @__fputc(i32 %1, i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_CR();
int /*<<< orphan*/ console_LF();
int /*<<< orphan*/ console_update();
void CONSOLE_NewLine() {
  console_CR();
  console_LF();
  console_update();
}


x86 assembly (clang, -O0):
<CONSOLE_NewLine>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <console_CR@plt>
mov    $0x0,%al
call   1050 <console_LF@plt>
mov    $0x0,%al
call   1030 <console_update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CONSOLE_NewLine>:
push   %rax
xor    %eax,%eax
call   1040 <console_CR@plt>
xor    %eax,%eax
call   1050 <console_LF@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <console_update@plt>

LLVM IR (-O0):
define void @CONSOLE_NewLine() {
%1 = call i32 (...) @console_CR()
%2 = call i32 (...) @console_LF()
%3 = call i32 (...) @console_update()
ret void
}

LLVM IR (-O2):
define void @CONSOLE_NewLine() {
%1 = tail call i32 (...) @console_CR()
%2 = tail call i32 (...) @console_LF()
%3 = tail call i32 (...) @console_update()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mali_clear_and_set_masks_for_gpu_irq();
int /*<<< orphan*/ Mali_clear_and_set_masks_for_job_irq();
int /*<<< orphan*/ Mali_clear_and_set_masks_for_mmu_irq();
void Mali_clear_irqs_and_set_all_masks(void) {
  Mali_clear_and_set_masks_for_gpu_irq();
  Mali_clear_and_set_masks_for_mmu_irq();
  Mali_clear_and_set_masks_for_job_irq();
}


x86 assembly (clang, -O0):
<Mali_clear_irqs_and_set_all_masks>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Mali_clear_and_set_masks_for_gpu_irq@plt>
mov    $0x0,%al
call   1050 <Mali_clear_and_set_masks_for_mmu_irq@plt>
mov    $0x0,%al
call   1030 <Mali_clear_and_set_masks_for_job_irq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_clear_irqs_and_set_all_masks>:
push   %rax
xor    %eax,%eax
call   1040 <Mali_clear_and_set_masks_for_gpu_irq@plt>
xor    %eax,%eax
call   1050 <Mali_clear_and_set_masks_for_mmu_irq@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Mali_clear_and_set_masks_for_job_irq@plt>

LLVM IR (-O0):
define void @Mali_clear_irqs_and_set_all_masks() {
%1 = call i32 (...) @Mali_clear_and_set_masks_for_gpu_irq()
%2 = call i32 (...) @Mali_clear_and_set_masks_for_mmu_irq()
%3 = call i32 (...) @Mali_clear_and_set_masks_for_job_irq()
ret void
}

LLVM IR (-O2):
define void @Mali_clear_irqs_and_set_all_masks() {
%1 = tail call i32 (...) @Mali_clear_and_set_masks_for_gpu_irq()
%2 = tail call i32 (...) @Mali_clear_and_set_masks_for_mmu_irq()
%3 = tail call i32 (...) @Mali_clear_and_set_masks_for_job_irq()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pad_pkcs7(unsigned char *, size_t *, int);
int /*<<< orphan*/ printf(char *);
size_t strlen(unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char input[] = "YELLOW SUBMARINE";
  size_t len = 0;
  len = strlen(input);
  pad_pkcs7(input, &len, 20);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeae(%rip),%al
mov    %al,-0x20(%rbp)
movq   $0x0,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x14,%edx
call   1050 <pad_pkcs7@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x14,%edx
call   1050 <pad_pkcs7@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.input = [17 x i8] c"YELLOW SUBMARINE\00"
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [17 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [17 x i8]* %6 to i8*
store i64 0, i64* %7
%9 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 0
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %7
%11 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 0
%12 = call i32 @pad_pkcs7(i8* %11, i64* %7, i32 20)
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.input = [17 x i8] c"YELLOW SUBMARINE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [17 x i8]
%4 = alloca i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%6 = bitcast i64* %4 to i8*
%7 = call i64 @strlen(i8* %5)
store i64 %7, i64* %4
%8 = call i32 @pad_pkcs7(i8* %5, i64* %4, i32 20)
%9 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hnj_free(void *p) { free(p); }


x86 assembly (clang, -O0):
<hnj_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hnj_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @hnj_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @hnj_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    die("Out of memory (unable to allocate %z bytes)", size);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Out of memory (unable to allocate %z bytes)\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [44 x i8] c"Out of memory (unable to allocate %z bytes)\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void PrintIntegerArray(int array[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<PrintIntegerArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <PrintIntegerArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <PrintIntegerArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintIntegerArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <PrintIntegerArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <PrintIntegerArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @PrintIntegerArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @PrintIntegerArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int IntAbs(int x) {
  if (x >= 0)
    return (x);
  else
    return (-x);
}


x86 assembly (clang, -O0):
<IntAbs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <IntAbs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <IntAbs+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntAbs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @IntAbs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @IntAbs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int test_imm_F5uint16_mem(unsigned short *val) {
  return ((*val) & (-0xF5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F5uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff0b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F5uint16_mem>:
movzwl (%rdi),%eax
test   $0xff0b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F5uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -245
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_F5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -245
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ create_epoch();
int /*<<< orphan*/ dbg_init();
int /*<<< orphan*/ prepare_glob();
void libevil_init(void) {
  dbg_init();
  create_epoch();
  prepare_glob();
  return;
}


x86 assembly (clang, -O0):
<libevil_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <dbg_init@plt>
mov    $0x0,%al
call   1030 <create_epoch@plt>
mov    $0x0,%al
call   1040 <prepare_glob@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<libevil_init>:
push   %rax
xor    %eax,%eax
call   1050 <dbg_init@plt>
xor    %eax,%eax
call   1030 <create_epoch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <prepare_glob@plt>

LLVM IR (-O0):
define void @libevil_init() {
%1 = call i32 (...) @dbg_init()
%2 = call i32 (...) @create_epoch()
%3 = call i32 (...) @prepare_glob()
ret void
}

LLVM IR (-O2):
define void @libevil_init() {
%1 = tail call i32 (...) @dbg_init()
%2 = tail call i32 (...) @create_epoch()
%3 = tail call i32 (...) @prepare_glob()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge_sort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printIntArray(int *, int);
int main(int argc, char **argv) {
  int array[] = {4, 5, 2, 6, 34, 897, 2};
  merge_sort(array, 0, 6);
  printIntArray(array, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <merge_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1040 <printIntArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <merge_sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printIntArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [7 x i32] [i32 4, i32 5, i32 2, i32 6, i32 34, i32 897, i32 2]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [7 x i32]* %6 to i8*
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%9 = call i32 @merge_sort(i32* %8, i32 0, i32 6)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%11 = call i32 @printIntArray(i32* %10, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i32] [i32 4, i32 5, i32 2, i32 6, i32 34, i32 897, i32 2]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = call i32 @merge_sort(i32* %5, i32 0, i32 6)
%7 = call i32 @printIntArray(i32* %5, i32 7)
ret i32 0
}