xunge/DecIR huggingface dataset:
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR7A_set(void) { return U_WMRCORENONE_set("U_WMR7A"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR7A\00"
define i8* @U_WMR7A_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR7A\00"
define i8* @U_WMR7A_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ USB_EN_ISR_Disable();
void USB_EN_ISR_Stop(void) { USB_EN_ISR_Disable(); }


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

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

LLVM IR (-O0):
define void @USB_EN_ISR_Stop() {
%1 = call i32 (...) @USB_EN_ISR_Disable()
ret void
}

LLVM IR (-O2):
define void @USB_EN_ISR_Stop() {
%1 = tail call i32 (...) @USB_EN_ISR_Disable()
ret void
}
/* Variables and functions */
unsigned short __tzcnt16(unsigned short);
unsigned short test__tzcnt16(unsigned short __X) { return __tzcnt16(__X); }


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

x86 assembly (clang, -O2):
<test__tzcnt16>:
jmp    1030 <__tzcnt16@plt>

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

LLVM IR (-O2):
define zeroext i16 @test__tzcnt16(i16 zeroext %0) {
%2 = tail call zeroext i16 @__tzcnt16(i16 zeroext %0)
ret i16 %2
}
void RealTimeClockOff(void) {}


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

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

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

LLVM IR (-O2):
define void @RealTimeClockOff() {
ret void
}
void test1(void *P) {
  char *a = (char *)P;
  short *b = (short *)P;
  int *c = (int *)P;
  const volatile void *P2 = P;
  char *d = (char *)P2;
  short *e = (short *)P2;
  int *f = (int *)P2;
  const char *g = (const char *)P2;
  const short *h = (const short *)P2;
  const int *i = (const int *)P2;
  const volatile char *j = (const volatile char *)P2;
  const volatile short *k = (const volatile short *)P2;
  const volatile int *l = (const volatile int *)P2;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x70(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i16*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i16*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i16*
%15 = alloca i32*
store i8* %0, i8** %2
%16 = load i8*, i8** %2
store i8* %16, i8** %3
%17 = load i8*, i8** %2
%18 = bitcast i8* %17 to i16*
store i16* %18, i16** %4
%19 = load i8*, i8** %2
%20 = bitcast i8* %19 to i32*
store i32* %20, i32** %5
%21 = load i8*, i8** %2
store i8* %21, i8** %6
%22 = load i8*, i8** %6
store i8* %22, i8** %7
%23 = load i8*, i8** %6
%24 = bitcast i8* %23 to i16*
store i16* %24, i16** %8
%25 = load i8*, i8** %6
%26 = bitcast i8* %25 to i32*
store i32* %26, i32** %9
%27 = load i8*, i8** %6
store i8* %27, i8** %10
%28 = load i8*, i8** %6
%29 = bitcast i8* %28 to i16*
store i16* %29, i16** %11
%30 = load i8*, i8** %6
%31 = bitcast i8* %30 to i32*
store i32* %31, i32** %12
%32 = load i8*, i8** %6
store i8* %32, i8** %13
%33 = load i8*, i8** %6
%34 = bitcast i8* %33 to i16*
store i16* %34, i16** %14
%35 = load i8*, i8** %6
%36 = bitcast i8* %35 to i32*
store i32* %36, i32** %15
ret void
}

LLVM IR (-O2):
define void @test1(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int errno;
int write(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int __attribute__((unused)) write_byte(uint8_t b) {
  int rc = write(STDOUT_FILENO, &b, 1);
  if (rc < 0)
    return -errno;
  return rc;
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1152 <write_byte+0x42>
xor    %eax,%eax
mov    0x2e90(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <write_byte+0x48>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2ea4(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@errno = global i32 0
define i32 @write_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i32 @write(i32 %5, i32* %3, i32 1)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @errno
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@errno = global i32 0
define i32 @write_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @write(i32 %3, i32* %2, i32 1)
%5 = icmp slt i32 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
float MT_randfloat() { return (float)(randInt()) * (1.0 / 4294967295.0); }


x86 assembly (clang, -O0):
<MT_randfloat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <randInt@plt>
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_randfloat>:
push   %rax
xor    %eax,%eax
call   1030 <randInt@plt>
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed8(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @MT_randfloat() {
%1 = call i32 (...) @randInt()
%2 = sitofp i32 %1 to float
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3DF0000000100000
%5 = fptrunc double %4 to float
ret float %5
}

LLVM IR (-O2):
define float @MT_randfloat() {
%1 = tail call i32 (...) @randInt()
%2 = sitofp i32 %1 to float
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3DF0000000100000
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_dialog_hide_i(char const *);
int /*<<< orphan*/ roadmap_download_delete_free();
void roadmap_download_delete_done(const char *name, void *context) {
  roadmap_dialog_hide_i(name);
  roadmap_download_delete_free();
}


x86 assembly (clang, -O0):
<roadmap_download_delete_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <roadmap_dialog_hide_i@plt>
mov    $0x0,%al
call   1040 <roadmap_download_delete_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_download_delete_done>:
push   %rax
call   1030 <roadmap_dialog_hide_i@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <roadmap_download_delete_free@plt>

LLVM IR (-O0):
define void @roadmap_download_delete_done(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @roadmap_dialog_hide_i(i8* %5)
%7 = call i32 (...) @roadmap_download_delete_free()
ret void
}

LLVM IR (-O2):
define void @roadmap_download_delete_done(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @roadmap_dialog_hide_i(i8* %0)
%4 = tail call i32 (...) @roadmap_download_delete_free()
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  while (getchar() != '\n') {
    printf("it seem that you are not familiar with c cprogram\n");
    continue;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1153 <main+0x33>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1153 <main+0x33>
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"it seem that you are not familiar with c cprogram\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %2
8: ; preds = %2
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [50 x i8] c"it seem that you are not familiar with c cprogram\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int b = 4;
  int i;
  char array[100];
  int **p = (int **)(array + 7);
  *p = &b;
  int *q;
  for (i = 0; i < sizeof(array); ++i) {
    q = *((int **)(array + 7));
    if (q == &b)
      *q = 3;
  }
  test_assert(b == 3);
  return b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
lea    -0x70(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
lea    -0x8(%rbp),%rcx
mov    %rcx,(%rax)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x64,%rax
jae    1188 <main+0x78>
mov    -0x69(%rbp),%rax
mov    %rax,-0x80(%rbp)
lea    -0x8(%rbp),%rax
cmp    %rax,-0x80(%rbp)
jne    1175 <main+0x65>
mov    -0x80(%rbp),%rax
movl   $0x3,(%rax)
jmp    117a <main+0x6a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <main+0x37>
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ perror(char *);
int send(int, char *, int, int /*<<< orphan*/);
void *control_worker_thread(void *fd) {
  int sockfd = *(int *)fd;
  if (send(sockfd, "Hello, world!", 13, 0) == -1) {
    perror("send");
  }
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<control_worker_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xeb1(%rip),%rsi
mov    $0xd,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    1170 <control_worker_thread+0x40>
lea    0xea3(%rip),%rdi
call   1050 <perror@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<control_worker_thread>:
push   %rbx
mov    (%rdi),%ebx
lea    0xec6(%rip),%rsi
mov    %ebx,%edi
mov    $0xd,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
je     1158 <control_worker_thread+0x28>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xeaf(%rip),%rdi
call   1050 <perror@plt>
jmp    114d <control_worker_thread+0x1d>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [5 x i8] c"send\00"
define i8* @control_worker_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @send(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13, i32 0)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [5 x i8] c"send\00"
define noalias i8* @control_worker_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @send(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @close(i32 %3)
ret i8* null
}
/* Type definitions */
struct tstat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *procprt_ENDATE_a(struct tstat *curstat, int avgval, int nsecs) {
  static char buf[11];
  strcpy(buf, "  active  ");
  return buf;
}


x86 assembly (clang, -O0):
<procprt_ENDATE_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0x2f00(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2eed(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_ENDATE_a>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tstat = type { i32 }
@procprt_ENDATE_a.buf = internal global [11 x i8] zeroinitializer
@.str = [11 x i8] c" active \00"
define i8* @procprt_ENDATE_a(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @strcpy(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @procprt_ENDATE_a.buf, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @procprt_ENDATE_a.buf, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type { i32 }
@procprt_ENDATE_a.buf = internal global [11 x i8] zeroinitializer
@.str = [11 x i8] c" active \00"
define i8* @procprt_ENDATE_a(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @strcpy(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @procprt_ENDATE_a.buf, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @procprt_ENDATE_a.buf, i64 0, i64 0)
}
int theproblem_set_myid(void) {
  int retval;
  retval = 0;
  return (retval);
}


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

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

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

LLVM IR (-O2):
define i32 @theproblem_set_myid() {
ret i32 0
}
int map() { return 42; }


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

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

LLVM IR (-O0):
define i32 @map() {
ret i32 42
}

LLVM IR (-O2):
define i32 @map() {
ret i32 42
}
char swap(char *string, int indexA, int indexB) {
  char temp;
  temp = string[indexA];
  string[indexA] = string[indexB];
  string[indexB] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

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

LLVM IR (-O2):
define signext i8 @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret i8 undef
}
char *scopy(char *d, const char *s) {
  while (*s != '\0')
    *d++ = *s++;
  *d = '\0';
  return d;
}


x86 assembly (clang, -O0):
<scopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <scopy+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <scopy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scopy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <scopy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <scopy+0x10>
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
define i8* @scopy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %10, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8, i8* %11
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
store i8 %13, i8* %14
br label %5
16: ; preds = %5
%17 = load i8*, i8** %3
store i8 0, i8* %17
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @scopy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
int test_imm_28uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x28 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_28uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 40
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_elapsed_time();
void progress_init(void) { print_elapsed_time(); }


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

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

LLVM IR (-O0):
define void @progress_init() {
%1 = call i32 (...) @print_elapsed_time()
ret void
}

LLVM IR (-O2):
define void @progress_init() {
%1 = tail call i32 (...) @print_elapsed_time()
ret void
}
__attribute__((no)) void fn2(int x, ...) {
  asm volatile("" : "+r"(x) : : "memory");
  if (x)
    exit(0);
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <fn2+0x22>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
push   %rax
test   %edi,%edi
jne    1117 <fn2+0x7>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @fn2(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm sideeffect "", "=r,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @fn2(i32 %0, ...) {
%2 = tail call i32 asm sideeffect "", "=r,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @exit(i32 0)
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vlproj(int, double *, double *, double *);
void vproj(double v[3], double u[3], double vo[3]) { vlproj(3, v, u, vo); }


x86 assembly (clang, -O0):
<vproj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x3,%edi
call   1030 <vlproj@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vproj>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <vlproj@plt>

LLVM IR (-O0):
define void @vproj(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @vlproj(i32 3, double* %7, double* %8, double* %9)
ret void
}

LLVM IR (-O2):
define void @vproj(double* %0, double* %1, double* %2) {
%4 = tail call i32 @vlproj(i32 3, double* %0, double* %1, double* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long quot;
  long rem;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
ldiv_t ldiv(long int num, long int denom) {
  ldiv_t result;
  result.quot = num / denom;
  result.rem = num % denom;
  return result;
}


x86 assembly (clang, -O0):
<ldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Type definitions */
struct nlmsghdr {
  int nlmsg_len;
};
struct genlmsghdr {
  int dummy;
};

/* Variables and functions */
int GENL_HDRLEN;
int NLMSG_HDRLEN;
int genlmsg_len(const struct genlmsghdr *gnlh) {
  struct nlmsghdr *nlh =
      (struct nlmsghdr *)((unsigned char *)gnlh - NLMSG_HDRLEN);
  return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN);
}


x86 assembly (clang, -O0):
<genlmsg_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2edd(%rip),%rcx
movslq (%rcx),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2eb1(%rip),%rcx
sub    (%rcx),%eax
mov    0x2eb8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genlmsg_len>:
mov    0x2ee9(%rip),%rax
movslq (%rax),%rcx
sub    %rcx,%rdi
mov    (%rdi),%eax
mov    0x2eca(%rip),%rdx
mov    (%rdx),%edx
add    %ecx,%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
%struct.genlmsghdr = type { i32 }
%struct.nlmsghdr = type { i32 }
@NLMSG_HDRLEN = global i32 0
@GENL_HDRLEN = global i32 0
define i32 @genlmsg_len(%struct.genlmsghdr* %0) {
%2 = alloca %struct.genlmsghdr*
%3 = alloca %struct.nlmsghdr*
store %struct.genlmsghdr* %0, %struct.genlmsghdr** %2
%4 = load %struct.genlmsghdr*, %struct.genlmsghdr** %2
%5 = bitcast %struct.genlmsghdr* %4 to i8*
%6 = load i32, i32* @NLMSG_HDRLEN
%7 = sext i32 %6 to i64
%8 = sub i64 0, %7
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = bitcast i8* %9 to %struct.nlmsghdr*
store %struct.nlmsghdr* %10, %struct.nlmsghdr** %3
%11 = load %struct.nlmsghdr*, %struct.nlmsghdr** %3
%12 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i32, i32* @GENL_HDRLEN
%15 = sub nsw i32 %13, %14
%16 = load i32, i32* @NLMSG_HDRLEN
%17 = sub nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
%struct.genlmsghdr = type { i32 }
@NLMSG_HDRLEN = global i32 0
@GENL_HDRLEN = global i32 0
define i32 @genlmsg_len(%struct.genlmsghdr* nocapture %0) {
%2 = bitcast %struct.genlmsghdr* %0 to i8*
%3 = load i32, i32* @NLMSG_HDRLEN
%4 = sext i32 %3 to i64
%5 = sub nsw i64 0, %4
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i32, i32* @GENL_HDRLEN
%10 = add i32 %3, %9
%11 = sub i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ndarray {
  int dummy;
};
typedef int int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ *stdlib_ndarray_iget_ptr(struct ndarray const *,
                                            int /*<<< orphan*/ const);
int stdlib_ndarray_set_ptr_int8(int /*<<< orphan*/ *, int const);
int8_t stdlib_ndarray_iset_int8(const struct ndarray *arr, const int64_t idx,
                                const int8_t v) {
  uint8_t *ind = stdlib_ndarray_iget_ptr(arr, idx);
  if (ind == NULL) {
    return -1;
  }
  return stdlib_ndarray_set_ptr_int8(ind, v);
}


x86 assembly (clang, -O0):
<stdlib_ndarray_iset_int8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <stdlib_ndarray_iget_ptr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <stdlib_ndarray_iset_int8+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <stdlib_ndarray_iset_int8+0x48>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <stdlib_ndarray_set_ptr_int8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_ndarray_iset_int8>:
push   %rbx
mov    %edx,%ebx
call   1030 <stdlib_ndarray_iget_ptr@plt>
test   %rax,%rax
je     1138 <stdlib_ndarray_iset_int8+0x18>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <stdlib_ndarray_set_ptr_int8@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_iset_int8(%struct.ndarray* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.ndarray*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store %struct.ndarray* %0, %struct.ndarray** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load %struct.ndarray*, %struct.ndarray** %5
%10 = load i32, i32* %6
%11 = call i32* @stdlib_ndarray_iget_ptr(%struct.ndarray* %9, i32 %10)
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %19
15: ; preds = %3
%16 = load i32*, i32** %8
%17 = load i32, i32* %7
%18 = call i32 @stdlib_ndarray_set_ptr_int8(i32* %16, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_iset_int8(%struct.ndarray* %0, i32 %1, i32 %2) {
%4 = tail call i32* @stdlib_ndarray_iget_ptr(%struct.ndarray* %0, i32 %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @stdlib_ndarray_set_ptr_int8(i32* %4, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
int test_imm_9Eint64_lowword_mem(long long *val) {
  return ((*val) & (0x9E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Eint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 158
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t insertInto(int32_t M, int32_t N, int i, int j) {
  int32_t mask = ((1 << (j + 1 - i)) - 1) << i;
  return (N & ~mask) | (M << i);
}


x86 assembly (clang, -O0):
<insertInto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertInto>:
sub    %edx,%ecx
add    $0x1,%cl
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %esi,%eax
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @insertInto(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = shl i32 1, %13
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %7
%17 = shl i32 %15, %16
store i32 %17, i32* %9
%18 = load i32, i32* %6
%19 = load i32, i32* %9
%20 = xor i32 %19, -1
%21 = and i32 %18, %20
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = shl i32 %22, %23
%25 = or i32 %21, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @insertInto(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub i32 1, %2
%6 = add i32 %5, %3
%7 = shl nsw i32 -1, %6
%8 = xor i32 %7, -1
%9 = shl i32 %8, %2
%10 = xor i32 %9, -1
%11 = and i32 %10, %1
%12 = shl i32 %0, %2
%13 = or i32 %11, %12
ret i32 %13
}
void av_xtea_le_crypt() {}


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

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

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

LLVM IR (-O2):
define void @av_xtea_le_crypt() {
ret void
}
void av_packet_unpack_dictionary() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_unpack_dictionary() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ssd1306_write_command(int);
void ssd1306_display_invert_disable(void) { ssd1306_write_command(0xA6); }


x86 assembly (clang, -O0):
<ssd1306_display_invert_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa6,%edi
call   1030 <ssd1306_write_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssd1306_display_invert_disable>:
mov    $0xa6,%edi
jmp    1030 <ssd1306_write_command@plt>

LLVM IR (-O0):
define void @ssd1306_display_invert_disable() {
%1 = call i32 @ssd1306_write_command(i32 166)
ret void
}

LLVM IR (-O2):
define void @ssd1306_display_invert_disable() {
%1 = tail call i32 @ssd1306_write_command(i32 166)
ret void
}
int ffs(unsigned int i) {
  int rv = 1;
  if (!i)
    return 0;
  while (!(i & 1)) {
    i >>= 1;
    ++rv;
  }
  return rv;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <ffs+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1161 <ffs+0x61>
jmp    1129 <ffs+0x29>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <ffs+0x44>
jmp    115b <ffs+0x5b>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <ffs+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
unsigned char _marshall_get8(const void *pBuf) {
  return *(unsigned char *)(pBuf);
}


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

x86 assembly (clang, -O2):
<_marshall_get8>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @_marshall_get8(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
void gpio_set_value_cansleep(unsigned gpio, int value) { WARN_ON(1); }


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

x86 assembly (clang, -O2):
<gpio_set_value_cansleep>:
mov    $0x1,%edi
jmp    1030 <WARN_ON@plt>

LLVM IR (-O0):
define void @gpio_set_value_cansleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @WARN_ON(i32 1)
ret void
}

LLVM IR (-O2):
define void @gpio_set_value_cansleep(i32 %0, i32 %1) {
%3 = tail call i32 @WARN_ON(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rt_kprintf(char *);
int main(int argc, char *argv[]) {
  rt_kprintf("device testing\n");
  extern int device_test(void);
  device_test();
  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)
lea    0xec3(%rip),%rdi
call   1040 <rt_kprintf@plt>
call   1030 <device_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <rt_kprintf@plt>
call   1030 <device_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"device testing\0A\00"
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 = call i32 @rt_kprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @device_test()
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"device testing\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @rt_kprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @device_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
int /*<<< orphan*/ stderr;
void assertTrue(int condition, unsigned long int number) {
  if (!condition) {
    fprintf(stderr, "Should be true: %ld\n", number);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<assertTrue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1160 <assertTrue+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):
<assertTrue>:
test   %edi,%edi
je     1125 <assertTrue+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 = [21 x i8] c"Should be true: %ld\0A\00"
@EXIT_FAILURE = global i32 0
define void @assertTrue(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 %13, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i64, i64* %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 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 = [21 x i8] c"Should be true: %ld\0A\00"
@EXIT_FAILURE = global i32 0
define void @assertTrue(i32 %0, i64 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 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
}
int locate(int N, int *array, int target) {
  int i;
  for (i = 0; i < N; i++) {
    if (array[i] == target)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<locate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <locate+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1140 <locate+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <locate+0x5a>
jmp    1145 <locate+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <locate+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<locate>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111e <locate+0x1e>
mov    %edi,%edi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rsi,%rcx,4)
je     111f <locate+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    1110 <locate+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @locate(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
char *changesuffix(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ remove(char *);
void remove_file_with_extension(char *file, char *ext) {
  char *temp;
  temp = changesuffix(file, ext);
  remove(temp);
  free(temp);
}


x86 assembly (clang, -O0):
<remove_file_with_extension>:
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   1050 <changesuffix@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <remove@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_file_with_extension>:
push   %rbx
call   1050 <changesuffix@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <remove@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @remove_file_with_extension(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @changesuffix(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @remove(i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @remove_file_with_extension(i8* %0, i8* %1) {
%3 = tail call i8* @changesuffix(i8* %0, i8* %1)
%4 = tail call i32 @remove(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}