xunge/DecIR huggingface dataset:
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] - 51238316UL) - (unsigned char)191;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      state[0UL] |= (state[0UL] & (unsigned char)15) << 3UL;
      local1++;
    }
    output[0UL] = (state[0UL] ^ 707305405UL) ^
                  967835152UL * (454761159UL >> (unsigned char)253);
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30dd5ac,%rax
sub    $0xbf,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jge    115a <RandomFunc+0x5a>
movzbl -0x11(%rbp),%ecx
and    $0xf,%ecx
shl    $0x3,%ecx
movzbl -0x11(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1126 <RandomFunc+0x26>
movzbl -0x11(%rbp),%eax
xor    $0x2a289fbd,%rax
xor    %rcx,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = sub i64 %10, 51238316
%12 = sub i64 %11, 191
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %23, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp slt i32 %17, %21
br i1 %22, label %23, label %36
23: ; preds = %15
%24 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = and i32 %26, 15
%28 = shl i32 %27, 3
%29 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = or i32 %31, %28
%33 = trunc i32 %32 to i8
store i8 %33, i8* %29
%34 = load i8, i8* %6
%35 = add i8 %34, 1
store i8 %35, i8* %6
br label %15
36: ; preds = %15
%37 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%38 = load i8, i8* %37
%39 = zext i8 %38 to i64
%40 = xor i64 %39, 707305405
%41 = xor i64 %40, poison
%42 = trunc i64 %41 to i8
%43 = load i8*, i8** %4
%44 = getelementptr inbounds i8, i8* %43, i64 0
store i8 %42, i8* %44
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
float fmin(float x, float y) {
  if (x < y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <fmin+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <fmin+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fmin(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @fmin(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int isSimbolo(char c) {
  return (c == '(' || c == ')' || c == ',' || c == ';' || c == '{' ||
          c == '}' || c == '#');
}


x86 assembly (clang, -O0):
<isSimbolo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x28,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isSimbolo+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x29,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isSimbolo+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isSimbolo+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3b,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isSimbolo+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7b,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isSimbolo+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7d,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isSimbolo+0x83>
movsbl -0x1(%rbp),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSimbolo>:
mov    $0x1,%eax
cmp    $0x3b,%dil
ja     111f <isSimbolo+0x1f>
movzbl %dil,%ecx
movabs $0x800130000000000,%rdx
bt     %rcx,%rdx
jb     112b <isSimbolo+0x2b>
cmp    $0x7b,%dil
je     112b <isSimbolo+0x2b>
cmp    $0x7d,%dil
jne    112c <isSimbolo+0x2c>
ret
xor    %eax,%eax
cmp    $0x23,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isSimbolo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 40
br i1 %5, label %30, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 41
br i1 %9, label %30, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 44
br i1 %13, label %30, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 59
br i1 %17, label %30, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 123
br i1 %21, label %30, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 125
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 35
br label %30
30: ; preds = %26, %22, %18, %14, %10, %6, %1
%31 = phi i1 [ true, %22 ], [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @isSimbolo(i8 signext %0) {
switch i8 %0, label %2 [
i8 125, label %5
i8 123, label %5
i8 59, label %5
i8 44, label %5
i8 41, label %5
i8 40, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 35
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void pj_cleanup_lock() {}


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

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

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

LLVM IR (-O2):
define void @pj_cleanup_lock() {
ret void
}
/* Variables and functions */
unsigned short inw(unsigned int);
unsigned short INPORT16(unsigned idx) { return inw(idx); }


x86 assembly (clang, -O0):
<INPORT16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inw@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INPORT16>:
jmp    1030 <inw@plt>

LLVM IR (-O0):
define zeroext i16 @INPORT16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call zeroext i16 @inw(i32 %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @INPORT16(i32 %0) {
%2 = tail call zeroext i16 @inw(i32 %0)
ret i16 %2
}
m(v, w) { return v > w ? w : v; }


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <m+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <m+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @m(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @m(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int *malloc(int);
void PR7217() {
  int *buf = malloc(2);
  buf[1] = 'c';
}


x86 assembly (clang, -O0):
<PR7217>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x63,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR7217>:
mov    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @PR7217() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 2)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 99, i32* %4
ret void
}

LLVM IR (-O2):
define void @PR7217() {
%1 = tail call i32* @malloc(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void test9_2_sig_handler() {
  signal(SIGSEGV, SIG_DFL);
  write(1, "<sigsegv> ", sizeof("<sigsegv> ") - 1);
  raise(SIGSEGV);
}


x86 assembly (clang, -O0):
<test9_2_sig_handler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
mov    $0xa,%edx
call   1040 <write@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9_2_sig_handler>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
lea    0xeb1(%rip),%rsi
mov    $0x1,%edi
mov    $0xa,%edx
call   1040 <write@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGSEGV = global i32 0
@SIG_DFL = global i32 0
@.str = [11 x i8] c"<sigsegv> \00"
define void @test9_2_sig_handler() {
%1 = load i32, i32* @SIGSEGV
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = load i32, i32* @SIGSEGV
%6 = call i32 @raise(i32 %5)
ret void
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
@SIG_DFL = global i32 0
@.str = [11 x i8] c"<sigsegv> \00"
define void @test9_2_sig_handler() {
%1 = load i32, i32* @SIGSEGV
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = load i32, i32* @SIGSEGV
%6 = tail call i32 @raise(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int getDiskSize(int disk) {
  int diskSize = -1;
  if (disk < 0) {
    return -1;
  }
  if ((diskSize = lseek(disk, 0, SEEK_END)) == -1) {
    return -1;
  }
  return diskSize;
}


x86 assembly (clang, -O0):
<getDiskSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1138 <getDiskSize+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <getDiskSize+0x59>
mov    -0x8(%rbp),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1163 <getDiskSize+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <getDiskSize+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDiskSize>:
test   %edi,%edi
js     1124 <getDiskSize+0x14>
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <lseek@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @getDiskSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 -1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* @SEEK_END
%11 = call i32 @lseek(i32 %9, i32 0, i32 %10)
store i32 %11, i32* %4
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %16
14: ; preds = %8
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %13, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @getDiskSize(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @SEEK_END
%5 = tail call i32 @lseek(i32 %0, i32 0, i32 %4)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ -1, %1 ], [ %5, %3 ]
ret i32 %7
}
/* Variables and functions */
int snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, int const);
int funcLenInt(const int *piI) {
  int iLen = snprintf(NULL, 0, "%d", *piI);
  return iLen;
}


x86 assembly (clang, -O0):
<funcLenInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xed1(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcLenInt>:
mov    (%rdi),%ecx
lea    0xee7(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @funcLenInt(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @funcLenInt(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
void order(int *x, int *y) {
  if (*x > *y) {
    swap(x, y);
  }
}


x86 assembly (clang, -O0):
<order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    113f <order+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<order>:
mov    (%rdi),%eax
cmp    (%rsi),%eax
jle    111b <order+0xb>
jmp    1030 <swap@plt>
ret

LLVM IR (-O0):
define void @order(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = load i32*, i32** %4
%13 = call i32 @swap(i32* %11, i32* %12)
br label %14
14: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @order(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @swap(i32* %0, i32* %1)
br label %8
8: ; preds = %6, %2
ret void
}
int mode_Poi(double mu) { return (int)(mu + 1e-10); }


x86 assembly (clang, -O0):
<mode_Poi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_Poi>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @mode_Poi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e-10
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @mode_Poi(double %0) {
%2 = fadd double %0, 1.000000e-10
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mod2_say(void) { printf("mod2: Hello World\n"); }


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

x86 assembly (clang, -O2):
<mod2_say>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [18 x i8] c"mod2: Hello World\00"
define void @mod2_say() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
float f(__attribute__((vector_size(16))) float a, int b,
        __attribute__((vector_size(16))) float c) {
  __attribute__((vector_size(16))) float dd = c * a;
  a = (__attribute__((vector_size(16))) float){0, 0, 0, 0};
  c = (__attribute__((vector_size(16))) float){0, 0, 0, 0};
  {
    float d = ((float *)&a)[0];
    float d1 = ((float *)&c)[0];
    return d * d1;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movaps %xmm1,-0x30(%rbp)
movaps -0x30(%rbp),%xmm0
movaps -0x10(%rbp),%xmm1
mulps  %xmm1,%xmm0
movaps %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x50(%rbp)
movaps -0x50(%rbp),%xmm1
movaps %xmm1,-0x10(%rbp)
movaps %xmm0,-0x60(%rbp)
movaps -0x60(%rbp),%xmm0
movaps %xmm0,-0x30(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x64(%rbp),%xmm0
mulss  -0x68(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f(<4 x float> %0, i32 %1, <4 x float> %2) {
%4 = alloca <4 x float>
%5 = alloca i32
%6 = alloca <4 x float>
%7 = alloca <4 x float>
%8 = alloca <4 x float>
%9 = alloca <4 x float>
%10 = alloca float
%11 = alloca float
store <4 x float> %0, <4 x float>* %4
store i32 %1, i32* %5
store <4 x float> %2, <4 x float>* %6
%12 = load <4 x float>, <4 x float>* %6
%13 = load <4 x float>, <4 x float>* %4
%14 = fmul <4 x float> %12, %13
store <4 x float> %14, <4 x float>* %7
store <4 x float> zeroinitializer, <4 x float>* %8
%15 = load <4 x float>, <4 x float>* %8
store <4 x float> %15, <4 x float>* %4
store <4 x float> zeroinitializer, <4 x float>* %9
%16 = load <4 x float>, <4 x float>* %9
store <4 x float> %16, <4 x float>* %6
%17 = bitcast <4 x float>* %4 to float*
%18 = getelementptr inbounds float, float* %17, i64 0
%19 = load float, float* %18
store float %19, float* %10
%20 = bitcast <4 x float>* %6 to float*
%21 = getelementptr inbounds float, float* %20, i64 0
%22 = load float, float* %21
store float %22, float* %11
%23 = load float, float* %10
%24 = load float, float* %11
%25 = fmul float %23, %24
ret float %25
}

LLVM IR (-O2):
define float @f(<4 x float> %0, i32 %1, <4 x float> %2) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int *, int *, int *, int *);
void __cpuidex(int a[4], int b, int c) {
  a[0] = b;
  a[2] = c;
  cpuid(&a[0], &a[1], &a[2], &a[3]);
}


x86 assembly (clang, -O0):
<__cpuidex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
mov    -0x8(%rbp),%rdx
add    $0x8,%rdx
mov    -0x8(%rbp),%rcx
add    $0xc,%rcx
call   1030 <cpuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cpuidex>:
mov    %esi,(%rdi)
lea    0x8(%rdi),%rax
mov    %edx,0x8(%rdi)
lea    0x4(%rdi),%rsi
lea    0xc(%rdi),%rcx
mov    %rax,%rdx
jmp    1030 <cpuid@plt>

LLVM IR (-O0):
define void @__cpuidex(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %6
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 2
store i32 %10, i32* %12
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = call i32 @cpuid(i32* %14, i32* %16, i32* %18, i32* %20)
ret void
}

LLVM IR (-O2):
define void @__cpuidex(i32* %0, i32 %1, i32 %2) {
store i32 %1, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %2, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = getelementptr inbounds i32, i32* %0, i64 3
%7 = tail call i32 @cpuid(i32* %0, i32* %5, i32* %4, i32* %6)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
int read_literal(const char **cursor, const char *literal) {
  size_t cnt = strlen(literal);
  if (strncmp(*cursor, literal, cnt) == 0) {
    *cursor += cnt;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1175 <read_literal+0x55>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    117c <read_literal+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_literal>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    (%r14),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1156 <read_literal+0x36>
add    %r15,(%r14)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @read_literal(i8** nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = load i8*, i8** %0
%5 = tail call i64 @strncmp(i8* %4, i8* %1, i64 %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 %3
store i8* %9, i8** %0
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_send_message() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_call_send_message>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_call_send_message>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_message() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_message() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int rotr(int *a, int *b, int *c) {
  int temp;
  temp = *c;
  *c = *b;
  *b = *a;
  *a = temp;
  return 0;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdx),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret i32 0
}

LLVM IR (-O2):
define i32 @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %0
store i32 %6, i32* %1
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
struct U {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(struct U *, struct U *);
int main() {
  int a[3];
  int *p = a;
  p[1] = 0;
  if (foo((struct U *)(p + 1), (struct U *)p) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1163 <main+0x43>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
movl   $0x0,0x10(%rsp)
lea    0xc(%rsp),%rsi
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1147 <main+0x27>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.U = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 0, i32* %6
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = bitcast i32* %8 to %struct.U*
%10 = load i32*, i32** %3
%11 = bitcast i32* %10 to %struct.U*
%12 = call i32 @foo(%struct.U* %9, %struct.U* %11)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
%struct.U = type { i32 }
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
store i32 0, i32* %3
%4 = bitcast i32* %3 to %struct.U*
%5 = bitcast [3 x i32]* %1 to %struct.U*
%6 = call i32 @foo(%struct.U* %4, %struct.U* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32 0
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int folderP(char *Name) {
  DIR *Dir;
  struct dirent *Ent;
  if (!(Dir = opendir(Name)))
    return 0;
  closedir(Dir);
  return 1;
}


x86 assembly (clang, -O0):
<folderP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    114f <folderP+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115f <folderP+0x3f>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<folderP>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <folderP+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @folderP(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.dirent*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @opendir(i8* %6)
store i32* %7, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %13
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i32 @closedir(i32* %11)
store i32 1, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @folderP(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
long IOCTL(fd, req, a)
long *fd, *req, *a;
{ return ((long)ioctl(*fd, *req, *a)); }


x86 assembly (clang, -O0):
<IOCTL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1030 <ioctl@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IOCTL>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    (%rdx),%rdx
xor    %eax,%eax
call   1030 <ioctl@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @IOCTL(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = load i64*, i64** %6
%12 = load i64, i64* %11
%13 = call i32 (i64, i64, i64, ...) bitcast (i32 (...)* @ioctl to i32 (i64, i64, i64, ...)*)(i64 %8, i64 %10, i64 %12)
%14 = sext i32 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @IOCTL(i64* nocapture %0, i64* nocapture %1, i64* nocapture %2) {
%4 = load i64, i64* %0
%5 = load i64, i64* %1
%6 = load i64, i64* %2
%7 = tail call i32 (i64, i64, i64, ...) bitcast (i32 (...)* @ioctl to i32 (i64, i64, i64, ...)*)(i64 %4, i64 %5, i64 %6)
%8 = sext i32 %7 to i64
ret i64 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("!!!Hello World 1!!!");
  puts("!!!Hello World 2!!!");
  puts("!!!Hello World 3!!!");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"!!!Hello World 1!!!\00"
@.str.1 = [20 x i8] c"!!!Hello World 2!!!\00"
@.str.2 = [20 x i8] c"!!!Hello World 3!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [20 x i8] c"!!!Hello World 1!!!\00"
@.str.1 = [20 x i8] c"!!!Hello World 2!!!\00"
@.str.2 = [20 x i8] c"!!!Hello World 3!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int sort_utils_double_icmp(const void *const a, const void *const b) {
  const double *const x = (const double *const)a;
  const double *const y = (const double *const)b;
  return (*x < *y) - (*x > *y);
}


x86 assembly (clang, -O0):
<sort_utils_double_icmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movsd  (%rcx),%xmm0
mov    -0x20(%rbp),%rcx
ucomisd (%rcx),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_utils_double_icmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sort_utils_double_icmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
store double* %8, double** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fcmp olt double %12, %14
%16 = zext i1 %15 to i32
%17 = load double*, double** %5
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = fcmp ogt double %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @sort_utils_double_icmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt double %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
main() {
  int i;
  char a[6];
  a[0] = 'a';
  a[1] = 'b';
  a[2] = '\0';
  a[3] = 'd';
  a[4] = 'e';
  a[5] = '\0';
  printf("%s\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0xa(%rbp)
movb   $0x62,-0x9(%rbp)
movb   $0x0,-0x8(%rbp)
movb   $0x64,-0x7(%rbp)
movb   $0x65,-0x6(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x64006261,0x2(%rsp)
64
movw   $0x65,0x6(%rsp)
lea    0xed9(%rip),%rdi
lea    0x2(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 1
store i8 98, i8* %4
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
store i8 0, i8* %5
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 3
store i8 100, i8* %6
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 4
store i8 101, i8* %7
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 5
store i8 0, i8* %8
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
store i8 97, i8* %2
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 1
store i8 98, i8* %3
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
store i8 0, i8* %4
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 3
store i8 100, i8* %5
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 4
store i8 101, i8* %6
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 5
store i8 0, i8* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *url_serverport(char *, int *);
char *url_uri(char *url, int *plen) {
  if ((url = url_serverport(url, plen)) == 0) {
    return 0;
  }
  url += *plen;
  *plen = strlen(url);
  return url;
}


x86 assembly (clang, -O0):
<url_uri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <url_serverport@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1158 <url_uri+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1185 <url_uri+0x65>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_uri>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <url_serverport@plt>
test   %rax,%rax
je     1147 <url_uri+0x27>
mov    %rax,%rbx
movslq (%r14),%rax
add    %rax,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,(%r14)
jmp    1149 <url_uri+0x29>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @url_uri(i8* %0, i32* %1) {
%3 = tail call i8* @url_serverport(i8* %0, i32* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = tail call i32 @strlen(i8* %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %5
%11 = phi i8* [ %8, %5 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ testfunc(char);
int main() {
  char s[10] = "abcdefg";
  testfunc('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    $0xa,%edi
call   1030 <testfunc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <testfunc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [10 x i8] c"abcdefg\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = bitcast [10 x i8]* %2 to i8*
%4 = call i32 @testfunc(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @testfunc(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo_cl(int x) { printf("%d\n", x); }


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

x86 assembly (clang, -O2):
<foo_cl>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @foo_cl(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int test_imm_62int8_mem(signed char *val) {
  return ((*val) & (-0x62 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_62int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -98
%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_62int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -98
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float logf(float);
float logBase_fun_float(float a, float b) { return logf(b) / logf(a); }


x86 assembly (clang, -O0):
<logBase_fun_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logBase_fun_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm1,%xmm0
call   1030 <logf@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <logf@plt>
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @logBase_fun_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @logf(float %5)
%7 = load float, float* %3
%8 = call float @logf(float %7)
%9 = fdiv float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @logBase_fun_float(float %0, float %1) {
%3 = tail call float @logf(float %1)
%4 = tail call float @logf(float %0)
%5 = fdiv float %3, %4
ret float %5
}
AR0IR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[10000000]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl 0x1312d00(%rax),%eax
mov    -0x20(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1145 <AR0IR1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <AR0IR1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0IR1>:
movzwl 0x1312d00(%r8),%ecx
01
xor    %eax,%eax
cmp    (%r9),%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @AR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = sext i16 %18 to i32
%20 = load i16*, i16** %13
%21 = load i16, i16* %20
%22 = sext i16 %21 to i32
%23 = icmp sle i32 %19, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @AR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = load i16, i16* %5
%10 = icmp sle i16 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int gamma_dummy_start(void *state) {
  fputs("WARNING: Using dummy gamma method! Display will not be affected by "
        "this gamma method.\n",
        stderr);
  return 0;
}


x86 assembly (clang, -O0):
<gamma_dummy_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_dummy_start>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [87 x i8] c"WARNING: Using dummy gamma method! Display will not be affected by this gamma method.\0A\00"
@stderr = global i32 0
define i32 @gamma_dummy_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [87 x i8] c"WARNING: Using dummy gamma method! Display will not be affected by this gamma method.\0A\00"
@stderr = global i32 0
define i32 @gamma_dummy_start(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}