xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Maj(uint64_t x, uint64_t y, uint64_t z) {
  return (x & y) ^ (x & z) ^ (y & z);
}


x86 assembly (clang, -O0):
<Maj>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maj>:
mov    %edx,%eax
xor    %esi,%eax
and    %edi,%eax
and    %esi,%edx
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Maj(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* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = and i32 %10, %11
%13 = xor i32 %9, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = xor i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @Maj(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, %1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = xor i32 %5, %6
ret i32 %7
}
void sampleHandler() {}


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

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

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

LLVM IR (-O2):
define void @sampleHandler() {
ret void
}
void be_uint8_write(void *ptr, unsigned v) {
  unsigned char *ptr8 = (unsigned char *)ptr;
  ptr8[0] = v;
}


x86 assembly (clang, -O0):
<be_uint8_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_uint8_write>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @be_uint8_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
ret void
}

LLVM IR (-O2):
define void @be_uint8_write(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
ret void
}
float fdiv32(float x, float y) { return x / y; }


x86 assembly (clang, -O0):
<fdiv32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdiv32>:
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fdiv32(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popinteger4array_(char *x, unsigned int *n) { popNarray(x, (*n * 4)); }


x86 assembly (clang, -O0):
<popinteger4array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x2,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popinteger4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popinteger4array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @popNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @popinteger4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void sleep_long(int seconds) { sleep(seconds); }


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

x86 assembly (clang, -O2):
<sleep_long>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @sleep_long(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
double Melder_roundDown(double);
double Melder_round_tieUp(double x) { return Melder_roundDown(x + 0.5); }


x86 assembly (clang, -O0):
<Melder_round_tieUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <Melder_roundDown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Melder_round_tieUp>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <Melder_roundDown@plt>

LLVM IR (-O0):
define double @Melder_round_tieUp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @Melder_roundDown(double %4)
ret double %5
}

LLVM IR (-O2):
define double @Melder_round_tieUp(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @Melder_roundDown(double %2)
ret double %3
}
void init_idct(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @init_idct() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void buffer_free(void *buf) { free(buf); }


x86 assembly (clang, -O0):
<buffer_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):
<buffer_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @buffer_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 @buffer_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int heptagonal(int n) { return n * (5 * n - 3) / 2; }


x86 assembly (clang, -O0):
<heptagonal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x5,-0x4(%rbp),%ecx
sub    $0x3,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<heptagonal>:
lea    (%rdi,%rdi,4),%ecx
add    $0xfffffffd,%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @heptagonal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 5, %4
%6 = sub nsw i32 %5, 3
%7 = mul nsw i32 %3, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @heptagonal(i32 %0) {
%2 = mul nsw i32 %0, 5
%3 = add nsw i32 %2, -3
%4 = mul nsw i32 %3, %0
%5 = sdiv i32 %4, 2
ret i32 %5
}
int contains(const char c, const char *matrix, int len) {
  for (unsigned int x = 0; x < len; x++)
    if ((char)matrix[x] == c)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    115a <contains+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <contains+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1161 <contains+0x61>
jmp    114c <contains+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <contains+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
test   %edx,%edx
je     113b <contains+0x3b>
mov    $0x1,%eax
cmp    %dil,(%rsi)
je     113a <contains+0x3a>
mov    %edx,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rdx
cmp    %rax,%rcx
je     1132 <contains+0x32>
lea    0x1(%rdx),%rax
cmp    %dil,(%rsi,%rdx,1)
jne    1120 <contains+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @contains(i8 signext %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %25, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i8*, i8** %6
%15 = load i32, i32* %8
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %13
store i32 1, i32* %4
br label %29
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add i32 %26, 1
store i32 %27, i32* %8
br label %9
28: ; preds = %9
store i32 0, i32* %4
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @contains(i8 signext %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %20, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, %0
br i1 %8, label %20, label %9
9: ; preds = %5, %12
%10 = phi i64 [ %16, %12 ], [ 1, %5 ]
%11 = icmp eq i64 %10, %6
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, %0
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %17, label %9
17: ; preds = %9, %12
%18 = icmp ult i64 %10, %6
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %17, %5, %3
%21 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %19, %17 ]
ret i32 %21
}
void glTexEnvfv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexEnvfv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int /*<<< orphan*/);
void TOSH_MAKE_FLASH_SELECT_INPUT() { clear_io_bit(0x39, 0); }


x86 assembly (clang, -O0):
<TOSH_MAKE_FLASH_SELECT_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
xor    %esi,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_FLASH_SELECT_INPUT>:
mov    $0x39,%edi
xor    %esi,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_FLASH_SELECT_INPUT() {
%1 = call i32 @clear_io_bit(i32 57, i32 0)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_FLASH_SELECT_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 57, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vh_log(char *, int);
void vh_logTime() { vh_log("Log time to be implemented", 4); }


x86 assembly (clang, -O0):
<vh_logTime>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <vh_log@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vh_logTime>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <vh_log@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Log time to be implemented\00"
define void @vh_logTime() {
%1 = call i32 @vh_log(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Log time to be implemented\00"
define void @vh_logTime() {
%1 = tail call i32 @vh_log(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b(int /*<<< orphan*/);
int /*<<< orphan*/ write_maps(char *);
int main(int argc, char **argv) {
  if (argc > 1)
    write_maps(argv[1]);
  b(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114d <main+0x2d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <write_maps@plt>
xor    %edi,%edi
call   1030 <b@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1040 <write_maps@plt>
xor    %edi,%edi
call   1030 <b@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @write_maps(i8* %11)
br label %13
13: ; preds = %8, %2
%14 = call i32 @b(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @write_maps(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = tail call i32 @b(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outbuf(int, char *);
void outchr(char c) { outbuf(1, &c); }


x86 assembly (clang, -O0):
<outchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
lea    -0x1(%rbp),%rsi
call   1030 <outbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outchr>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
call   1030 <outbuf@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @outchr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @outbuf(i32 1, i8* %2)
ret void
}

LLVM IR (-O2):
define void @outchr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @outbuf(i32 1, i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ WeaponIsPlayerMine(int);
int WeaponIsMine(int nId) { return WeaponIsPlayerMine(nId) || (nId == 53); }


x86 assembly (clang, -O0):
<WeaponIsMine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <WeaponIsPlayerMine@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <WeaponIsMine+0x2f>
cmpl   $0x35,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WeaponIsMine>:
push   %rbx
mov    %edi,%ebx
call   1030 <WeaponIsPlayerMine@plt>
test   %rax,%rax
setne  %al
cmp    $0x35,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @WeaponIsMine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @WeaponIsPlayerMine(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 53
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @WeaponIsMine(i32 %0) {
%2 = tail call i64 @WeaponIsPlayerMine(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 53
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int list_comparator_int16_t(const void *a, const void *b) {
  return (*(int16_t *)a < *(int16_t *)b) - (*(int16_t *)a > *(int16_t *)b);
}


x86 assembly (clang, -O0):
<list_comparator_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_int16_t>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_int16_t(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp slt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp sgt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_int16_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int pin_config_group_set(const char *dev_name, const char *pin_group,
                         unsigned long config) {
  return 0;
}


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

x86 assembly (clang, -O2):
<pin_config_group_set>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pin_config_group_set(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @pin_config_group_set(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
void X509at_get_attr(void) {}


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

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

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

LLVM IR (-O2):
define void @X509at_get_attr() {
ret void
}
int main(void) {
  int foo;
  int bar;
  int foobar;
  int barfoobar;
  int barfoo;
}


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int __attribute__((regparm(1), no, used)) bar(int x) {
  if (x != 0)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112c <bar+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
jne    1115 <bar+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @bar to i8*)], section "llvm.metadata"
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @bar to i8*)], section "llvm.metadata"
define i32 @bar(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
int isblank(scalar_t__);
int iswblank(wint_t wc) { return ((wc < (wint_t)0x100 ? isblank(wc) : 0)); }


x86 assembly (clang, -O0):
<iswblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x100,-0x8(%rbp)
jge    113b <iswblank+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <isblank@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <iswblank+0x35>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <iswblank+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswblank>:
cmp    $0xff,%rdi
jg     111e <iswblank+0xe>
jmp    1030 <isblank@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswblank(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 256
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i32 @isblank(i64 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iswblank(i64 %0) {
%2 = icmp slt i64 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @isblank(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int maximumProduct(int *, int);
int /*<<< orphan*/ printf(char *, int);
void test(int *nums, int size) {
  int p = maximumProduct(nums, size);
  printf("max = %d\n", p);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <maximumProduct@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
call   1040 <maximumProduct@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"max = %d\0A\00"
define void @test(i32* %0, i32 %1) {
%3 = tail call i32 @maximumProduct(i32* %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void list_start() {
  printf("Filename       Original Compressed Ratio DateTime modified CRC-32   "
         "AttrBTPMGVX\n");
  printf("------------ ---------- ---------- ----- ----------------- -------- "
         "-----------\n");
}


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

x86 assembly (clang, -O2):
<list_start>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [81 x i8] c"Filename Original Compressed Ratio DateTime modified CRC-32 AttrBTPMGVX\0A\00"
@.str.1 = [81 x i8] c"------------ ---------- ---------- ----- ----------------- -------- -----------\0A\00"
define void @list_start() {
%1 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [80 x i8] c"Filename Original Compressed Ratio DateTime modified CRC-32 AttrBTPMGVX\00"
@str.2 = [80 x i8] c"------------ ---------- ---------- ----- ----------------- -------- -----------\00"
define void @list_start() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sqlExecProgProfile(char *, char *, char **, int, char **);
void sqlExecProgLocal(char *prog, char **progArgs, int userArgc,
                      char *userArgv[]) {
  sqlExecProgProfile("localDb", prog, progArgs, userArgc, userArgv);
}


x86 assembly (clang, -O0):
<sqlExecProgLocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xec3(%rip),%rdi
call   1030 <sqlExecProgProfile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlExecProgLocal>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xede(%rip),%rdi
jmp    1030 <sqlExecProgProfile@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"localDb\00"
define void @sqlExecProgLocal(i8* %0, i8** %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8**
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = load i8**, i8*** %8
%13 = call i32 @sqlExecProgProfile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9, i8** %10, i32 %11, i8** %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"localDb\00"
define void @sqlExecProgLocal(i8* %0, i8** %1, i32 %2, i8** %3) {
%5 = tail call i32 @sqlExecProgProfile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8** %1, i32 %2, i8** %3)
ret void
}
/* Variables and functions */
long __arch_atomic_swap(long *, long);
long int sas_atomic_swap(long int *p, long int replace) {
  return __arch_atomic_swap(p, replace);
}


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

x86 assembly (clang, -O2):
<sas_atomic_swap>:
jmp    1030 <__arch_atomic_swap@plt>

LLVM IR (-O0):
define i64 @sas_atomic_swap(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = call i64 @__arch_atomic_swap(i64* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @sas_atomic_swap(i64* %0, i64 %1) {
%3 = tail call i64 @__arch_atomic_swap(i64* %0, i64 %1)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ NID_pkcs9_emailAddress;
int set_cn(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
           int /*<<< orphan*/, char *, int /*<<< orphan*/);
int set_email3(X509 *crt, const char *name) {
  return set_cn(crt, NID_pkcs9_emailAddress, name, NID_pkcs9_emailAddress,
                "dummy@example.com", 0);
}


x86 assembly (clang, -O0):
<set_email3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
lea    0xebf(%rip),%r8
xor    %r9d,%r9d
call   1030 <set_cn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_email3>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
lea    0xedd(%rip),%r8
mov    %ecx,%esi
xor    %r9d,%r9d
jmp    1030 <set_cn@plt>

LLVM IR (-O0):
@NID_pkcs9_emailAddress = global i32 0
@.str = [18 x i8] c"dummy@example.com\00"
define i32 @set_email3(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @NID_pkcs9_emailAddress
%7 = load i8*, i8** %4
%8 = load i32, i32* @NID_pkcs9_emailAddress
%9 = call i32 @set_cn(i32* %5, i32 %6, i8* %7, i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %9
}

LLVM IR (-O2):
@NID_pkcs9_emailAddress = global i32 0
@.str = [18 x i8] c"dummy@example.com\00"
define i32 @set_email3(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_pkcs9_emailAddress
%4 = tail call i32 @set_cn(i32* %0, i32 %3, i8* %1, i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %4
}
void x_dialog_create_kegs_conf(const char *str) { return; }


x86 assembly (clang, -O0):
<x_dialog_create_kegs_conf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @x_dialog_create_kegs_conf(i8* nocapture %0) {
ret void
}
int find_swap_row(int *matrix, int rows, int cols, int row_num) {
  int j;
  for (j = row_num; j < rows; j++) {
    if (matrix[j * cols + row_num] != 0)
      return j;
  }
  return -1;
}


x86 assembly (clang, -O0):
<find_swap_row>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115c <find_swap_row+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1149 <find_swap_row+0x49>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <find_swap_row+0x63>
jmp    114e <find_swap_row+0x4e>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1117 <find_swap_row+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_swap_row>:
mov    $0xffffffff,%eax
cmp    %esi,%ecx
jge    112f <find_swap_row+0x2f>
movslq %ecx,%r8
movslq %edx,%r9
lea    0x1(%r9),%rdx
imul   %r8,%rdx
lea    (%rdi,%rdx,4),%rdi
shl    $0x2,%r9
nop
cmpl   $0x0,(%rdi)
jne    1130 <find_swap_row+0x30>
add    $0x1,%ecx
add    %r9,%rdi
cmp    %ecx,%esi
jne    1120 <find_swap_row+0x20>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @find_swap_row(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %9
store i32 %11, i32* %10
br label %12
12: ; preds = %30, %4
%13 = load i32, i32* %10
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %33
16: ; preds = %12
%17 = load i32*, i32** %6
%18 = load i32, i32* %10
%19 = load i32, i32* %8
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %9
%22 = add nsw i32 %20, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %17, i64 %23
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %16
%28 = load i32, i32* %10
store i32 %28, i32* %5
br label %34
29: ; preds = %16
br label %30
30: ; preds = %29
%31 = load i32, i32* %10
%32 = add nsw i32 %31, 1
store i32 %32, i32* %10
br label %12
33: ; preds = %12
store i32 -1, i32* %5
br label %34
34: ; preds = %33, %27
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @find_swap_row(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, %1
br i1 %5, label %6, label %22
6: ; preds = %4
%7 = sext i32 %3 to i64
%8 = sext i32 %2 to i64
br label %9
9: ; preds = %6, %16
%10 = phi i64 [ %7, %6 ], [ %17, %16 ]
%11 = mul nsw i64 %10, %8
%12 = add nsw i64 %11, %7
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %9
%17 = add nsw i64 %10, 1
%18 = trunc i64 %17 to i32
%19 = icmp eq i32 %18, %1
br i1 %19, label %22, label %9
20: ; preds = %9
%21 = trunc i64 %10 to i32
br label %22
22: ; preds = %16, %20, %4
%23 = phi i32 [ -1, %4 ], [ %21, %20 ], [ -1, %16 ]
ret i32 %23
}
/* Variables and functions */
char *strrchr(char *, char);
char *gnu_basename(char *path) {
  char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


x86 assembly (clang, -O0):
<gnu_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <gnu_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <gnu_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @gnu_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @gnu_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_RemoteIOClient_RemoteInput_InputMouseUp(void *);
int /*<<< orphan*/ printf(char *, int, int, int);
void UpnpRemoteIOClient_RemoteInput_InputMouseUp(void *upnptoken, int X, int Y,
                                                 int Button) {
  printf("Invoke: UpnpRemoteIOClient_RemoteInput_InputMouseUp(%d,%d,%d);\r\n",
         X, Y, Button);
  UpnpResponse_RemoteIOClient_RemoteInput_InputMouseUp(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_RemoteInput_InputMouseUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputMouseUp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteInput_InputMouseUp>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputMouseUp@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputMouseUp(%d,%d,%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputMouseUp(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i8*, i8** %5
%14 = call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputMouseUp(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputMouseUp(%d,%d,%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputMouseUp(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputMouseUp(i8* %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int _stat_r(struct _reent *r, const char *path, struct stat *buf) {
  assert(!"NYI");
}


x86 assembly (clang, -O0):
<_stat_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stat_r>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
%struct.stat = type { i32 }
@.str = [4 x i8] c"NYI\00"
define i32 @_stat_r(%struct._reent* %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca %struct._reent*
%6 = alloca i8*
%7 = alloca %struct.stat*
store %struct._reent* %0, %struct._reent** %5
store i8* %1, i8** %6
store %struct.stat* %2, %struct.stat** %7
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._reent = type { i32 }
%struct.stat = type { i32 }
define i32 @_stat_r(%struct._reent* nocapture readnone %0, i8* nocapture readnone %1, %struct.stat* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
unsigned short ptclbsum(const void *addr, int len) {
  return ~fold_short(partial_sum(addr, len));
}


x86 assembly (clang, -O0):
<ptclbsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <partial_sum@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <fold_short@plt>
xor    $0xffffffff,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptclbsum>:
push   %rax
xor    %eax,%eax
call   1030 <partial_sum@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <fold_short@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @ptclbsum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @partial_sum to i32 (i8*, i32, ...)*)(i8* %5, i32 %6)
%8 = call i32 (i32, ...) bitcast (i32 (...)* @fold_short to i32 (i32, ...)*)(i32 %7)
%9 = xor i32 %8, -1
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @ptclbsum(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @partial_sum to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @fold_short to i32 (i32, ...)*)(i32 %3)
%5 = trunc i32 %4 to i16
%6 = xor i16 %5, -1
ret i16 %6
}
int is_control(int ucs) {
  return ((ucs >= 0x00 && ucs <= 0x1f) || (ucs >= 0x7f && ucs <= 0x9f));
}


x86 assembly (clang, -O0):
<is_control>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <is_control+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1142 <is_control+0x42>
xor    %eax,%eax
cmpl   $0x7f,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     113c <is_control+0x3c>
cmpl   $0x9f,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_control>:
cmp    $0x20,%edi
setb   %al
add    $0xffffff81,%edi
cmp    $0x21,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_control(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 127
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 159
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_control(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = add i32 %0, -127
%4 = icmp ult i32 %3, 33
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int atoi(char const *);
int tosInt32_fromString(const char *string) { return atoi(string); }


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

x86 assembly (clang, -O2):
<tosInt32_fromString>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @tosInt32_fromString(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fsitod(int s, int d) {
  assem_debug("fsitod d%d,s%d", d, s);
  output_w32(0xeeb80bc0 | ((d & 7) << 12) | ((s & 14) >> 1) | ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_fsitod>:
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 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xeeb80bc0,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fsitod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
and    $0x7,%ebx
shl    $0xc,%ebx
mov    %ebp,%eax
shr    %eax
and    $0x7,%eax
shl    $0x5,%ebp
movzbl %bpl,%edi
or     %eax,%edi
or     %ebx,%edi
or     $0xeeb80bc0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fsitod d%d,s%d\00"
define void @emit_fsitod(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 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 7
%10 = shl i32 %9, 12
%11 = or i32 -289928256, %10
%12 = load i32, i32* %3
%13 = and i32 %12, 14
%14 = ashr i32 %13, 1
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 1
%18 = shl i32 %17, 5
%19 = or i32 %15, %18
%20 = call i32 @output_w32(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fsitod d%d,s%d\00"
define void @emit_fsitod(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 12
%5 = and i32 %4, 28672
%6 = lshr i32 %0, 1
%7 = and i32 %6, 7
%8 = shl i32 %0, 5
%9 = and i32 %8, 32
%10 = or i32 %7, %9
%11 = or i32 %10, %5
%12 = or i32 %11, -289928256
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
void __attribute__((no, noclone, optimize("-fno-tree-vectorize")))
init(unsigned *results, unsigned *pData) {
  unsigned int i;
  for (i = 0; i < 1000; ++i)
    pData[i] = i % 3;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jae    1144 <init+0x44>
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <init+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
movdqa 0xef8(%rip),%xmm1
mov    $0x4,%eax
movdqa 0xefa(%rip),%xmm8
movdqa 0xf02(%rip),%xmm2
movdqa 0xf0a(%rip),%xmm3
pxor   %xmm4,%xmm4
movdqa 0xf0e(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqa %xmm1,%xmm6
paddw  %xmm8,%xmm6
movdqa %xmm1,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x1,%xmm7
pmullw %xmm3,%xmm7
movdqa %xmm1,%xmm0
psubw  %xmm7,%xmm0
movdqa %xmm6,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x1,%xmm7
pmullw %xmm3,%xmm7
psubw  %xmm7,%xmm6
punpcklwd %xmm4,%xmm0
punpcklwd %xmm4,%xmm6
movdqu %xmm0,-0x10(%rsi,%rax,4)
movdqu %xmm6,(%rsi,%rax,4)
paddw  %xmm5,%xmm1
add    $0x8,%rax
cmp    $0x3ec,%rax
jne    1140 <init+0x40>
ret

LLVM IR (-O0):
define void @init(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 = %16, %2
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 1000
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %5
%11 = urem i32 %10, 3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %5
%18 = add i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @init(i32* nocapture readnone %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %15, %3 ]
%5 = phi <4 x i16> [ <i16 0, i16 1, i16 2, i16 3>, %2 ], [ %16, %3 ]
%6 = add <4 x i16> %5, <i16 4, i16 4, i16 4, i16 4>
%7 = urem <4 x i16> %5, <i16 3, i16 3, i16 3, i16 3>
%8 = urem <4 x i16> %6, <i16 3, i16 3, i16 3, i16 3>
%9 = zext <4 x i16> %7 to <4 x i32>
%10 = zext <4 x i16> %8 to <4 x i32>
%11 = getelementptr inbounds i32, i32* %1, i64 %4
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %12
%13 = getelementptr inbounds i32, i32* %11, i64 4
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> %10, <4 x i32>* %14
%15 = add nuw i64 %4, 8
%16 = add <4 x i16> %5, <i16 8, i16 8, i16 8, i16 8>
%17 = icmp eq i64 %15, 1000
br i1 %17, label %18, label %3
18: ; preds = %3
ret void
}
unsigned int _get_schedparam(unsigned int id) {
  unsigned int cmd;
  cmd = ((0x12000000) | (((0x0) & 0x00000003) << 16) |
         (((id)&0x000000FF) << 8) | (((0x64) & 0x000000FF) << 0));
  return (*(volatile unsigned int *)(cmd));
}


x86 assembly (clang, -O0):
<_get_schedparam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
or     $0x12000000,%eax
or     $0x64,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_schedparam>:
shl    $0x8,%edi
movzwl %di,%eax
mov    0x12000064(%rax),%eax
ret

LLVM IR (-O0):
define i32 @_get_schedparam(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = or i32 301989888, %6
%8 = or i32 %7, 100
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_get_schedparam(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 65280
%4 = or i32 %3, 301989988
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}