xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int silnia(int);
int main(void) {
  int n = 5;
  printf("silnia z %d wynosi: %d\n", n, silnia(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <silnia@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <silnia@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"silnia z %d wynosi: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @silnia(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret i32 0
}
/* Variables and functions */
int f431(int *);
int f432(int *p) { return f431(p); }


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

x86 assembly (clang, -O2):
<f432>:
jmp    1030 <f431@plt>

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

LLVM IR (-O2):
define i32 @f432(i32* %0) {
%2 = tail call i32 @f431(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef size_t value;

/* Variables and functions */
size_t bnode_get_color(size_t value) { return ((value)&1); }


x86 assembly (clang, -O0):
<bnode_get_color>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnode_get_color>:
mov    %rdi,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @bnode_get_color(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @bnode_get_color(i64 %0) {
%2 = and i64 %0, 1
ret i64 %2
}
unsigned int _uiCommTestConnect(unsigned int uiCommType) { return (0x0304); }


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

x86 assembly (clang, -O2):
<_uiCommTestConnect>:
mov    $0x304,%eax
ret

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

LLVM IR (-O2):
define i32 @_uiCommTestConnect(i32 %0) {
ret i32 772
}
int nf_memcmp(unsigned char *ptr1, unsigned char ptr2, int len) {
  int i;
  int count = (len + 3) >> 2;
  for (i = 0; i < count; i++) {
    if (ptr1[i] != ptr2)
      return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<nf_memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x3,%eax
sar    $0x2,%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1166 <nf_memcmp+0x66>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     1153 <nf_memcmp+0x53>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <nf_memcmp+0x6d>
jmp    1158 <nf_memcmp+0x58>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1124 <nf_memcmp+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nf_memcmp>:
test   %edx,%edx
jle    111f <nf_memcmp+0x1f>
add    $0x3,%edx
shr    $0x2,%edx
xor    %eax,%eax
nopl   0x0(%rax)
cmp    %sil,(%rdi,%rax,1)
jne    1121 <nf_memcmp+0x21>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <nf_memcmp+0x10>
xor    %eax,%eax
ret

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

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


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

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

LLVM IR (-O0):
define i32 @xflush() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @xflush() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ myname;

/* Variables and functions */
int /*<<< orphan*/ get_program_name(char *, int);
int /*<<< orphan*/ my_system(char *, char *);
void disassemble_main() {
  char myname[1024];
  get_program_name(myname, sizeof(myname));
  my_system("gdb --batch -ex \"disassemble /m main\" %s", myname);
}


x86 assembly (clang, -O0):
<disassemble_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1040 <get_program_name@plt>
lea    -0x400(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <my_system@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disassemble_main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <get_program_name@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <my_system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"gdb --batch -ex \22disassemble /m main\22 %s\00"
define void @disassemble_main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_program_name(i8* %2, i32 1024)
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i32 @my_system(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"gdb --batch -ex \22disassemble /m main\22 %s\00"
define void @disassemble_main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_program_name(i8* %2, i32 1024)
%4 = call i32 @my_system(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int send_data(int, unsigned char *, int);
int usleep(int);
int send_instruction(int fd, unsigned char *data, unsigned char instruction) {
  data[1] = instruction;
  int err = send_data(fd, data, false);
  if (err == -1)
    return -1;
  err = usleep(40);
  if (err == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<send_instruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <send_data@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1165 <send_instruction+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <send_instruction+0x6f>
mov    $0x28,%edi
call   1040 <usleep@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1188 <send_instruction+0x68>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <send_instruction+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_instruction>:
push   %rax
mov    %dl,0x1(%rsi)
xor    %edx,%edx
call   1030 <send_data@plt>
cmp    $0xffffffff,%eax
je     1148 <send_instruction+0x28>
mov    $0x28,%edi
call   1040 <usleep@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @send_instruction(i32 %0, i8* %1, i8 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %2, i8* %4
%5 = tail call i32 @send_data(i32 %0, i8* %1, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i32 @usleep(i32 40)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ -1, %3 ], [ %10, %7 ]
ret i32 %12
}
void Convert16To8Row_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @Convert16To8Row_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  double a = 4;
  int i = 0;
  double *p1 = &a;
  char *p2;
  p2 = p1;
  p1++;
  while (1) {
    if (p2++ == p1) {
      break;
    }
    i++;
  }
  printf(" %d", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rcx
cmp    %rcx,%rax
jne    1170 <main+0x60>
jmp    117e <main+0x6e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114f <main+0x3f>
mov    -0x14(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_adds_pi8(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_adds_pi8@plt>

LLVM IR (-O0):
define i32 @test(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 = call i32 @_mm_adds_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char const *);
int /*<<< orphan*/ stdout;
void shellLog(void *pNotUsed, int iErrCode, const char *zMsg) {
  printf("LOG: (%d) %s\n", iErrCode, zMsg);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<shellLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shellLog>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"LOG: (%d) %s\0A\00"
@stdout = global i32 0
define void @shellLog(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"LOG: (%d) %s\0A\00"
@stdout = global i32 0
define void @shellLog(i8* nocapture readnone %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
void pnx833x_gpio_enable_irq(unsigned int pin) {
  do {
    ((*((volatile unsigned long *)((0xa0000000ul + 0x17E00000ul) + 0xFFE4))) |=
     (1 << (pin)));
  } while (0);
}


x86 assembly (clang, -O0):
<pnx833x_gpio_enable_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    $0xb7e0ffe4,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0xb7e0ffe4,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnx833x_gpio_enable_irq>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    $0xb7e0ffe4,%ecx
or     %rax,(%rcx)
ret

LLVM IR (-O0):
define void @pnx833x_gpio_enable_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
%7 = load volatile i64, i64* inttoptr (i64 3084976100 to i64*)
%8 = or i64 %7, %6
store volatile i64 %8, i64* inttoptr (i64 3084976100 to i64*)
br label %9
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @pnx833x_gpio_enable_irq(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = sext i32 %2 to i64
%4 = load volatile i64, i64* inttoptr (i64 3084976100 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 3084976100 to i64*)
ret void
}
void fn_test1(void) { printf("%s\n", __func__); }


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

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

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

LLVM IR (-O2):
@__func__.fn_test1 = [9 x i8] c"fn_test1\00"
define void @fn_test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.fn_test1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float sinf(float);
__attribute__((__weak__, __always___)) float softboundcets_sinf(float x) {
  return sinf(x);
}


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

x86 assembly (clang, -O2):
<softboundcets_sinf>:
jmp    1030 <sinf@plt>

LLVM IR (-O0):
define weak float @softboundcets_sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sinf(float %3)
ret float %4
}

LLVM IR (-O2):
define weak float @softboundcets_sinf(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
int test_imm_ECuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xEC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ECuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xec,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_ECuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 236
%7 = icmp ne i64 %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_ECuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15466496
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_datefunc3_year(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_datefunc3_year() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_datefunc3_year() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *mutt_basename(const char *f) {
  const char *p = strrchr(f, '/');
  if (p)
    return p + 1;
  else
    return f;
}


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

x86 assembly (clang, -O2):
<mutt_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* @mutt_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @mutt_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
}
/* Type definitions */
struct path {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_path(struct path *);
struct path *new_path_from_relpath(char *, char *);
char *path2str(struct path *, int /*<<< orphan*/);
char *canonicalize_relpath(char *relpath, char *base) {
  struct path *p = new_path_from_relpath(relpath, base);
  char *ret = path2str(p, 0);
  delete_path(p);
  return ret;
}


x86 assembly (clang, -O0):
<canonicalize_relpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <new_path_from_relpath@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <path2str@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <delete_path@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonicalize_relpath>:
push   %r14
push   %rbx
push   %rax
call   1040 <new_path_from_relpath@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <path2str@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <delete_path@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.path = type { i32 }
define i8* @canonicalize_relpath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.path*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call %struct.path* @new_path_from_relpath(i8* %7, i8* %8)
store %struct.path* %9, %struct.path** %5
%10 = load %struct.path*, %struct.path** %5
%11 = call i8* @path2str(%struct.path* %10, i32 0)
store i8* %11, i8** %6
%12 = load %struct.path*, %struct.path** %5
%13 = call i32 @delete_path(%struct.path* %12)
%14 = load i8*, i8** %6
ret i8* %14
}

LLVM IR (-O2):
%struct.path = type { i32 }
define i8* @canonicalize_relpath(i8* %0, i8* %1) {
%3 = tail call %struct.path* @new_path_from_relpath(i8* %0, i8* %1)
%4 = tail call i8* @path2str(%struct.path* %3, i32 0)
%5 = tail call i32 @delete_path(%struct.path* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ memccpy(char *, char const *, int /*<<< orphan*/, size_t);
char *memset(char *, int /*<<< orphan*/, size_t);
char *strncpy(char *dest, const char *src, size_t n) {
  dest = memset(dest, 0, n);
  memccpy(dest, src, 0, n);
  return dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1040 <memccpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %r15,%rcx
call   1040 <memccpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strncpy(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
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = call i8* @memset(i8* %7, i32 0, i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @memccpy(i8* %10, i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @strncpy(i8* returned %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %2, i1 false)
%4 = tail call i32 @memccpy(i8* %0, i8* %1, i32 0, i64 %2)
ret i8* %0
}
/* Variables and functions */
int test_csv_out(char *, char *);
bool test_csv_out2() { return test_csv_out("hello\"world", "hello\"world"); }


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

x86 assembly (clang, -O2):
<test_csv_out2>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
jmp    1030 <test_csv_out@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hello\22world\00"
define i32 @test_csv_out2() {
%1 = call i32 @test_csv_out(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello\22world\00"
define i32 @test_csv_out2() {
%1 = tail call i32 @test_csv_out(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
_Complex float test_cexpf(_Complex float x) { return __builtin_cexpf(x); }


x86 assembly (clang, -O0):
<test_cexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cexpf@plt>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cexpf>:
jmp    1030 <cexpf@plt>

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

LLVM IR (-O2):
define <2 x float> @test_cexpf(<2 x float> %0) {
%2 = tail call <2 x float> @cexpf(<2 x float> %0)
ret <2 x float> %2
}
void WriteLongLE(unsigned char **addrPtr, unsigned long data) {
  unsigned char *addr = *addrPtr;
  *addr++ = (unsigned char)data;
  *addr++ = (unsigned char)(data >> 8);
  *addr++ = (unsigned char)(data >> 16);
  *addr++ = (unsigned char)(data >> 24);
  *addrPtr = addr;
}


x86 assembly (clang, -O0):
<WriteLongLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLongLE>:
mov    (%rdi),%rax
mov    %esi,(%rax)
add    $0x4,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @WriteLongLE(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i8*
store i8** %0, i8*** %3
store i64 %1, i64* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
store i8 %9, i8* %10
%12 = load i64, i64* %4
%13 = lshr i64 %12, 8
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %5
store i8 %14, i8* %15
%17 = load i64, i64* %4
%18 = lshr i64 %17, 16
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
store i8 %19, i8* %20
%22 = load i64, i64* %4
%23 = lshr i64 %22, 24
%24 = trunc i64 %23 to i8
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %5
store i8 %24, i8* %25
%27 = load i8*, i8** %5
%28 = load i8**, i8*** %3
store i8* %27, i8** %28
ret void
}

LLVM IR (-O2):
define void @WriteLongLE(i8** nocapture %0, i64 %1) {
%3 = load i8*, i8** %0
%4 = trunc i64 %1 to i8
%5 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %4, i8* %3
%6 = lshr i64 %1, 8
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %1, 16
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %3, i64 3
store i8 %10, i8* %8
%12 = lshr i64 %1, 24
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds i8, i8* %3, i64 4
store i8 %13, i8* %11
store i8* %14, i8** %0
ret void
}
/* Variables and functions */
int foo(int);
int RemoveRedundantVariableCopyWithFuncCall() {
  int x = 10;
  int y = x;
  return foo(y);
}


x86 assembly (clang, -O0):
<RemoveRedundantVariableCopyWithFuncCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @RemoveRedundantVariableCopyWithFuncCall() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @foo(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @RemoveRedundantVariableCopyWithFuncCall() {
%1 = tail call i32 @foo(i32 10)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_fill_array_open_close(double *, long);
void fill_array_open_close(double array[], long size) {
  dsfmt_gv_fill_array_open_close(array, size);
}


x86 assembly (clang, -O0):
<fill_array_open_close>:
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 <dsfmt_gv_fill_array_open_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_array_open_close>:
jmp    1030 <dsfmt_gv_fill_array_open_close@plt>

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

LLVM IR (-O2):
define void @fill_array_open_close(double* %0, i64 %1) {
%3 = tail call i32 @dsfmt_gv_fill_array_open_close(double* %0, i64 %1)
ret void
}
int test_imm_E8uint16_mem(unsigned short *val) {
  return ((*val) & (-0xE8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E8uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -232
%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_E8uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -232
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void main() {
  int a[5] = {1, 2, 3, 4, 5};
  int *p = a;
  printf("* ( a + 1 ) = %d;\n", *(a + 1));
  printf("* ( p + 1 ) = %d;\n", *(p + 1));
  printf("3 [ a ] = %d;\n", 3 [a]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [19 x i8] c"* ( a + 1 ) = %d;\0A\00"
@.str.1 = [19 x i8] c"* ( p + 1 ) = %d;\0A\00"
@.str.2 = [15 x i8] c"3 [ a ] = %d;\0A\00"
define void @main() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"* ( a + 1 ) = %d;\0A\00"
@.str.1 = [19 x i8] c"* ( p + 1 ) = %d;\0A\00"
@.str.2 = [15 x i8] c"3 [ a ] = %d;\0A\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uintptr_t get_addr(int /*<<< orphan*/);
uintptr_t get_baddr(uint8_t id) { return get_addr(id); }


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

x86 assembly (clang, -O2):
<get_baddr>:
jmp    1030 <get_addr@plt>

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

LLVM IR (-O2):
define i64 @get_baddr(i32 %0) {
%2 = tail call i64 @get_addr(i32 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_null(void **p) {
  if ((*p) != NULL) {
    free(*p);
    *p = NULL;
  }
}


x86 assembly (clang, -O0):
<free_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <free_null+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_null>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <free_null+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @free_null(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
%10 = load i8**, i8*** %2
store i8* null, i8** %10
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @free_null(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tx(char);
void putchar(char c) {
  if (c == '\n')
    tx('\r');
  tx(c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <putchar+0x25>
mov    $0xd,%edi
call   1030 <tx@plt>
movsbl -0x1(%rbp),%edi
call   1030 <tx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <putchar+0x12>
mov    $0xd,%edi
call   1030 <tx@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <tx@plt>

LLVM IR (-O0):
define void @putchar(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, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @tx(i8 signext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @tx(i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @tx(i8 signext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @tx(i8 signext %0)
ret void
}
int main() {
  int x = 0;
  (x + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%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
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void _clear_bit(int nr, volatile unsigned long *addr) { (*addr) &= ~(1 << nr); }


x86 assembly (clang, -O0):
<_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clear_bit>:
mov    %edi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
cltq
and    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %4
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %8
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @_clear_bit(i32 %0, i64* %1) {
%3 = shl nuw i32 1, %0
%4 = xor i32 %3, -1
%5 = sext i32 %4 to i64
%6 = load volatile i64, i64* %1
%7 = and i64 %6, %5
store volatile i64 %7, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
int /*<<< orphan*/ stderr;
void assertFalse(int condition, unsigned long int number) {
  if (condition) {
    fprintf(stderr, "Should be false: %ld\n", number);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<assertFalse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1160 <assertFalse+0x40>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertFalse>:
test   %edi,%edi
jne    1125 <assertFalse+0x5>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Should be false: %ld\0A\00"
@EXIT_FAILURE = global i32 0
define void @assertFalse(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i64, i64* %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Should be false: %ld\0A\00"
@EXIT_FAILURE = global i32 0
define void @assertFalse(i32 %0, i64 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Type definitions */
typedef scalar_t__ suseconds_t;
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
suseconds_t endProfiling(struct timeval *start) {
  struct timeval end;
  suseconds_t elapsed;
  gettimeofday(&end, NULL);
  elapsed = end.tv_usec - start->tv_usec;
  return elapsed;
}


x86 assembly (clang, -O0):
<endProfiling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endProfiling>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
sub    (%rbx),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @endProfiling(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.timeval
%4 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
store i64 %11, i64* %4
%12 = load i64, i64* %4
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @endProfiling(%struct.timeval* nocapture %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sub nsw i64 %6, %8
ret i64 %9
}