xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ outportb(int, unsigned char);
void vga_setCursor(size_t x, size_t y) {
  unsigned short position = (y * 80) + x;
  outportb(0x3D4, 0x0F);
  outportb(0x3D5, (unsigned char)(position & 0xFF));
  outportb(0x3D4, 0x0E);
  outportb(0x3D5, (unsigned char)((position >> 8) & 0xFF));
}


x86 assembly (clang, -O0):
<vga_setCursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x50,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %ax,-0x12(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outportb@plt>
movzwl -0x12(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outportb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outportb@plt>
movzwl -0x12(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outportb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_setCursor>:
push   %rbx
mov    %rdi,%rbx
lea    (%rsi,%rsi,4),%eax
shl    $0x4,%eax
add    %eax,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outportb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <outportb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outportb@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @vga_setCursor(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 %6, 80
%8 = load i64, i64* %3
%9 = add i64 %7, %8
%10 = trunc i64 %9 to i16
store i16 %10, i16* %5
%11 = call i32 @outportb(i32 980, i8 zeroext 15)
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = call i32 @outportb(i32 981, i8 zeroext %15)
%17 = call i32 @outportb(i32 980, i8 zeroext 14)
%18 = load i16, i16* %5
%19 = zext i16 %18 to i32
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = call i32 @outportb(i32 981, i8 zeroext %22)
ret void
}

LLVM IR (-O2):
define void @vga_setCursor(i64 %0, i64 %1) {
%3 = mul i64 %1, 80
%4 = add i64 %3, %0
%5 = tail call i32 @outportb(i32 980, i8 zeroext 15)
%6 = trunc i64 %4 to i8
%7 = tail call i32 @outportb(i32 981, i8 zeroext %6)
%8 = tail call i32 @outportb(i32 980, i8 zeroext 14)
%9 = lshr i64 %4, 8
%10 = trunc i64 %9 to i8
%11 = tail call i32 @outportb(i32 981, i8 zeroext %10)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void atomic_add(volatile int32_t *v, int inc) { *v += inc; }


x86 assembly (clang, -O0):
<atomic_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add>:
add    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @atomic_add(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = add nsw i32 %7, %5
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @atomic_add(i32* %0, i32 %1) {
%3 = load volatile i32, i32* %0
%4 = add nsw i32 %3, %1
store volatile i32 %4, i32* %0
ret void
}
int idx2(int i, int j, int k, int *dim) {
  return ((i * dim[2] + j) * dim[3] + k);
}


x86 assembly (clang, -O0):
<idx2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x18(%rbp),%rcx
imul   0x8(%rcx),%eax
add    -0x8(%rbp),%eax
mov    -0x18(%rbp),%rcx
imul   0xc(%rcx),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idx2>:
imul   0x8(%rcx),%edi
lea    (%rdi,%rsi,1),%eax
imul   0xc(%rcx),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @idx2(i32 %0, i32 %1, i32 %2, i32* %3) {
%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* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %8
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = mul nsw i32 %9, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = load i32*, i32** %8
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = mul nsw i32 %15, %18
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @idx2(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = getelementptr inbounds i32, i32* %3, i64 2
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, %0
%8 = add nsw i32 %7, %1
%9 = getelementptr inbounds i32, i32* %3, i64 3
%10 = load i32, i32* %9
%11 = mul nsw i32 %8, %10
%12 = add nsw i32 %11, %2
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("gcc -std=c11 -Wall -fmax-errors=10 -Wextra -c libimage.c -o "
         "libimage.so\n");
  printf("gcc -std=c11 -Wall -fmax-errors=10 -Wextra -llibimage.so "
         "superimage.c -o superimage\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"gcc -std=c11 -Wall -fmax-errors=10 -Wextra -c libimage.c -o libimage.so\0A\00"
@.str.1 = [85 x i8] c"gcc -std=c11 -Wall -fmax-errors=10 -Wextra -llibimage.so superimage.c -o superimage\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [72 x i8] c"gcc -std=c11 -Wall -fmax-errors=10 -Wextra -c libimage.c -o libimage.so\00"
@str.2 = [84 x i8] c"gcc -std=c11 -Wall -fmax-errors=10 -Wextra -llibimage.so superimage.c -o superimage\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
char *remove_eof(char *str) {
  int i = 0;
  while (str[i] != '\0') {
    if (str[i] == '\n')
      str[i] = '\0';
    i++;
  }
  return str;
}


x86 assembly (clang, -O0):
<remove_eof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <remove_eof+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1145 <remove_eof+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <remove_eof+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_eof>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    1117 <remove_eof+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x0,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0xa,%dl
je     1110 <remove_eof+0x10>
test   %dl,%dl
jne    1113 <remove_eof+0x13>
ret

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

LLVM IR (-O2):
define i8* @remove_eof(i8* returned %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 10, label %6
]
6: ; preds = %2
store i8 0, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret i8* %0
}
int mystrlen(const char s[]) {
  int len = 0;
  while (s[len] != 0)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <mystrlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <mystrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void keyboard_reset(void) { outb(0x61, inb(0x61) | (1 << 7)); }


x86 assembly (clang, -O0):
<keyboard_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1040 <inb@plt>
mov    %eax,%esi
or     $0x80,%esi
mov    $0x61,%edi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_reset>:
push   %rax
mov    $0x61,%edi
call   1040 <inb@plt>
or     $0x80,%eax
mov    $0x61,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @keyboard_reset() {
%1 = call i32 @inb(i32 97)
%2 = or i32 %1, 128
%3 = call i32 @outb(i32 97, i32 %2)
ret void
}

LLVM IR (-O2):
define void @keyboard_reset() {
%1 = tail call i32 @inb(i32 97)
%2 = or i32 %1, 128
%3 = tail call i32 @outb(i32 97, i32 %2)
ret void
}
int nand_support_two_plane(void) { return 1 ? 1 : 0; }


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

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

LLVM IR (-O0):
define i32 @nand_support_two_plane() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nand_support_two_plane() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroy_wifi_ssid(char *ssid) { free(ssid); }


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

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

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

LLVM IR (-O2):
define void @destroy_wifi_ssid(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ str_startwith(char const *, char const *);
int strlen(char const *);
const char *str_lcut(const char *haystack, const char *word) {
  return (str_startwith(haystack, word) ? haystack + strlen(word) : haystack);
}


x86 assembly (clang, -O0):
<str_lcut>:
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   1030 <str_startwith@plt>
cmp    $0x0,%rax
je     116d <str_lcut+0x4d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1175 <str_lcut+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_lcut>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <str_startwith@plt>
test   %rax,%rax
je     1141 <str_lcut+0x21>
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_lcut(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 = load i8*, i8** %4
%7 = call i64 @str_startwith(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
br label %17
15: ; preds = %2
%16 = load i8*, i8** %3
br label %17
17: ; preds = %15, %9
%18 = phi i8* [ %14, %9 ], [ %16, %15 ]
ret i8* %18
}

LLVM IR (-O2):
define i8* @str_lcut(i8* %0, i8* %1) {
%3 = tail call i64 @str_startwith(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ %0, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B;
  scanf("%d %d", &A, &B);
  printf("A=%d\nB=%d\nA*B=%d\n", A, B, A * B);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [18 x i8] c"A=%d\0AB=%d\0AA*B=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [18 x i8] c"A=%d\0AB=%d\0AA*B=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_dump_exploded_nodes(int /*<<< orphan*/);
int /*<<< orphan*/ __analyzer_eval(int);
void __attribute__((no)) test_1_callee(void *p, void *q) {
  __analyzer_dump_exploded_nodes(0);
  __analyzer_eval(p == 0);
  __analyzer_eval(p != 0);
  __analyzer_eval(q == 0);
  __analyzer_eval(q != 0);
}


x86 assembly (clang, -O0):
<test_1_callee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <__analyzer_dump_exploded_nodes@plt>
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1_callee>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <__analyzer_dump_exploded_nodes@plt>
xor    %edi,%edi
xor    %ebp,%ebp
test   %rbx,%rbx
sete   %dil
setne  %bpl
call   1030 <__analyzer_eval@plt>
mov    %ebp,%edi
call   1030 <__analyzer_eval@plt>
xor    %edi,%edi
xor    %ebx,%ebx
test   %r14,%r14
sete   %dil
setne  %bl
call   1030 <__analyzer_eval@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_1_callee(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @__analyzer_dump_exploded_nodes(i32 0)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @__analyzer_eval(i32 %8)
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @__analyzer_eval(i32 %12)
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
%16 = zext i1 %15 to i32
%17 = call i32 @__analyzer_eval(i32 %16)
%18 = load i8*, i8** %4
%19 = icmp ne i8* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 @__analyzer_eval(i32 %20)
ret void
}

LLVM IR (-O2):
define void @test_1_callee(i8* readnone %0, i8* readnone %1) {
%3 = tail call i32 @__analyzer_dump_exploded_nodes(i32 0)
%4 = icmp eq i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @__analyzer_eval(i32 %5)
%7 = icmp ne i8* %0, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @__analyzer_eval(i32 %8)
%10 = icmp eq i8* %1, null
%11 = zext i1 %10 to i32
%12 = tail call i32 @__analyzer_eval(i32 %11)
%13 = icmp ne i8* %1, null
%14 = zext i1 %13 to i32
%15 = tail call i32 @__analyzer_eval(i32 %14)
ret void
}
void nseel_asm_log10(void) {
  __asm__("fldlg2\n"
          "fxch\n"
          "fyl2x\n");
}


x86 assembly (clang, -O0):
<nseel_asm_log10>:
push   %rbp
mov    %rsp,%rbp
fldlg2
fxch   %st(1)
fyl2x
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_log10>:
fldlg2
fxch   %st(1)
fyl2x
ret

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

LLVM IR (-O2):
define void @nseel_asm_log10() {
tail call void asm sideeffect "fldlg2\0Afxch\0Afyl2x\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void gtk_icon_theme_append_search_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_append_search_path() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int skip_eol(FILE *f) {
  int c;
  while ((c = getc(f)) != '\n' && c != EOF)
    ;
  c = getc(f);
  return c;
}


x86 assembly (clang, -O0):
<skip_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     114a <skip_eol+0x3a>
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115a <skip_eol+0x4a>
jmp    115f <skip_eol+0x4f>
jmp    111c <skip_eol+0xc>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_eol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1132 <skip_eol+0x22>
cmp    (%r14),%eax
jne    1120 <skip_eol+0x10>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <getc@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skip_eol(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %3
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = load i32*, i32** %2
%17 = call i32 @getc(i32* %16)
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skip_eol(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %2, label %8
8: ; preds = %2
%9 = tail call i32 @getc(i32* %0)
ret i32 %9
}
void handle_47(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_47(i32 %0) {
ret void
}
int last_one0(unsigned int u0) { return 26 - __builtin_ctz(u0); }


x86 assembly (clang, -O0):
<last_one0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsf    %eax,%ecx
mov    $0x1a,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_one0>:
bsf    %edi,%ecx
mov    $0x1a,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @last_one0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = sub nsw i32 26, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @last_one0(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = sub nsw i32 26, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  unsigned num = 'a';
  void *ptr = &num;
  if (((char *)ptr)[0])
    printf("Little Endian\n");
  if (!((char *)ptr)[0])
    printf("Big Endian\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x61,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <main+0x37>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1160 <main+0x50>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Little Endian\0A\00"
@.str.1 = [12 x i8] c"Big Endian\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 97, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %11
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Little Endian\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float fahr_to_cels(float fahr) { return (5.0 / 9.0) * (fahr - 32.0); }


x86 assembly (clang, -O0):
<fahr_to_cels>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_cels>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr_to_cels(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahr_to_cels(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int finalize(void *ctx) {
  FILE *fp = ctx;
  fclose(fp);
  return 0;
}


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

x86 assembly (clang, -O2):
<finalize>:
push   %rax
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @finalize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @finalize(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret i32 0
}
/* Type definitions */
struct jx_table {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void jx_export_html_footer(FILE *s, struct jx_table *h) {
  fprintf(s, "</table>\n");
}


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

x86 assembly (clang, -O2):
<jx_export_html_footer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
%struct.jx_table = type { i32 }
@.str = [10 x i8] c"</table>\0A\00"
define void @jx_export_html_footer(i32* %0, %struct.jx_table* %1) {
%3 = alloca i32*
%4 = alloca %struct.jx_table*
store i32* %0, i32** %3
store %struct.jx_table* %1, %struct.jx_table** %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.jx_table = type { i32 }
@.str = [10 x i8] c"</table>\0A\00"
define void @jx_export_html_footer(i32* nocapture %0, %struct.jx_table* nocapture readnone %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 9, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int);
void frontend_name(int frontend, char *frontend_name, int len,
                   char *adapter_name) {
  snprintf(frontend_name, len, "%s/frontend%d", adapter_name, frontend);
}


x86 assembly (clang, -O0):
<frontend_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    -0x4(%rbp),%r8d
lea    0xec4(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frontend_name>:
mov    %edi,%r8d
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"%s/frontend%d\00"
define void @frontend_name(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %0)
ret void
}
int sign_case_int(int num, int when_negative, int when_zero,
                  int when_positive) {
  return ((((num)) <= ((0)))
              ? ((((num)) < ((0))) ? ((when_negative)) : ((when_zero)))
              : ((when_positive)));
}


x86 assembly (clang, -O0):
<sign_case_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1140 <sign_case_int+0x40>
cmpl   $0x0,-0x4(%rbp)
jge    112f <sign_case_int+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <sign_case_int+0x35>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <sign_case_int+0x46>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_case_int>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sign_case_int(i32 %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* %6
br label %18
16: ; preds = %11
%17 = load i32, i32* %7
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
br label %22
20: ; preds = %4
%21 = load i32, i32* %8
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @sign_case_int(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, 1
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i32 %2, i32 %1
%8 = select i1 %5, i32 %7, i32 %3
ret i32 %8
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef scalar_t__ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ mq_timedreceive(scalar_t__, char *, size_t, unsigned int *,
                                   struct timespec *);
void test_mq_timedreceive_prototype(void) {
  mqd_t mqdes;
  struct timespec abstime;
  size_t msg_len;
  ssize_t size;
  char *msgp;
  unsigned msg_prio;
  mqdes = 0;
  msg_len = 0;
  msgp = NULL;
  size = mq_timedreceive(mqdes, msgp, msg_len, &msg_prio, &abstime);
  (void)size;
}


x86 assembly (clang, -O0):
<test_mq_timedreceive_prototype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <mq_timedreceive@plt>
mov    %eax,-0x1c(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mq_timedreceive_prototype>:
push   %rax
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <mq_timedreceive@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @test_mq_timedreceive_prototype() {
%1 = alloca i64
%2 = alloca %struct.timespec
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i64 0, i64* %1
store i64 0, i64* %3
store i8* null, i8** %5
%7 = load i64, i64* %1
%8 = load i8*, i8** %5
%9 = load i64, i64* %3
%10 = call i32 @mq_timedreceive(i64 %7, i8* %8, i64 %9, i32* %6, %struct.timespec* %2)
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @test_mq_timedreceive_prototype() {
%1 = alloca %struct.timespec
%2 = alloca i32
%3 = bitcast %struct.timespec* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @mq_timedreceive(i64 0, i8* null, i64 0, i32* %2, %struct.timespec* %1)
ret void
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
void handle_addr(struct nlmsghdr *header, ssize_t bytes, const char *name) {}


x86 assembly (clang, -O0):
<handle_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define void @handle_addr(%struct.nlmsghdr* %0, i32 %1, i8* %2) {
%4 = alloca %struct.nlmsghdr*
%5 = alloca i32
%6 = alloca i8*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define void @handle_addr(%struct.nlmsghdr* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
int match_num(char a) {
  int i = 0;
  char num[] = "1234567890.";
  for (i = 0; num[i] != '\0'; i++) {
    if (num[i] == a)
      return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<match_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee6(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1172 <match_num+0x72>
movslq -0xc(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    115f <match_num+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1179 <match_num+0x79>
jmp    1164 <match_num+0x64>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <match_num+0x2c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_num>:
add    $0xd2,%dil
mov    $0xffffffff,%eax
cmp    $0xb,%dil
ja     111d <match_num+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.match_num.num = [12 x i8] c"1234567890.\00"
define i32 @match_num(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca [12 x i8]
store i8 %0, i8* %3
store i32 0, i32* %4
%6 = bitcast [12 x i8]* %5 to i8*
store i32 0, i32* %4
br label %7
7: ; preds = %25, %1
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %28
14: ; preds = %7
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %14
store i32 0, i32* %2
br label %29
24: ; preds = %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %7
28: ; preds = %7
store i32 -1, i32* %2
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@switch.table.match_num = [12 x i32] [i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0]
define i32 @match_num(i8 signext %0) {
%2 = add i8 %0, -46
%3 = icmp ult i8 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.match_num, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ err_quit(char *);
int /*<<< orphan*/ *inet_ntop(int /*<<< orphan*/, void const *, char *, size_t);
const char *Inet_ntop(const void *addrptr, char *strptr, size_t len) {
  if (inet_ntop(AF_INET, addrptr, strptr, len) == NULL)
    err_quit("inet_ntop error");
  return strptr;
}


x86 assembly (clang, -O0):
<Inet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1164 <Inet_ntop+0x44>
lea    0xea1(%rip),%rdi
call   1040 <err_quit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inet_ntop>:
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rdx
call   1030 <inet_ntop@plt>
test   %rax,%rax
jne    114c <Inet_ntop+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <err_quit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@.str = [16 x i8] c"inet_ntop error\00"
define i8* @Inet_ntop(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 i32, i32* @AF_INET
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32* @inet_ntop(i32 %7, i8* %8, i8* %9, i64 %10)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @err_quit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@AF_INET = global i32 0
@.str = [16 x i8] c"inet_ntop error\00"
define i8* @Inet_ntop(i8* %0, i8* returned %1, i64 %2) {
%4 = load i32, i32* @AF_INET
%5 = tail call i32* @inet_ntop(i32 %4, i8* %0, i8* %1, i64 %2)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @err_quit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fcomp() {
  db(0xD8);
  db(0xD9);
}


x86 assembly (clang, -O0):
<fcomp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd8,%edi
call   1030 <db@plt>
mov    $0xd9,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcomp>:
push   %rax
mov    $0xd8,%edi
call   1030 <db@plt>
mov    $0xd9,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fcomp() {
%1 = call i32 @db(i32 216)
%2 = call i32 @db(i32 217)
ret void
}

LLVM IR (-O2):
define void @fcomp() {
%1 = tail call i32 @db(i32 216)
%2 = tail call i32 @db(i32 217)
ret void
}
/* Variables and functions */
void *gotcha_memset(void *s, int c, size_t n) {
  size_t i;
  unsigned char byte = (unsigned char)c;
  for (i = 0; i < n; i++) {
    ((unsigned char *)s)[i] = byte;
  }
  return s;
}


x86 assembly (clang, -O0):
<gotcha_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x21(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114a <gotcha_memset+0x4a>
mov    -0x21(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111d <gotcha_memset+0x1d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotcha_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <gotcha_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @gotcha_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
int umask(int mask) {}


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

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

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

LLVM IR (-O2):
define i32 @umask(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int inb(int);
int check_transmission() { return inb(0x3f8 + 5) & 0x20; }


x86 assembly (clang, -O0):
<check_transmission>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fd,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_transmission>:
push   %rax
mov    $0x3fd,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_transmission() {
%1 = call i32 @inb(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}

LLVM IR (-O2):
define i32 @check_transmission() {
%1 = tail call i32 @inb(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bswap_32(uint32_t x) {
  x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0x00FF00FF);
  x = (x >> 16) | (x << 16);
  return x;
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_32>:
bswap  %edi
ror    $0x10,%edi
mov    %edi,%eax
sar    $0x10,%eax
shl    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = load i32, i32* %2
%13 = shl i32 %12, 16
%14 = or i32 %11, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @bswap_32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
%7 = ashr i32 %6, 16
%8 = shl i32 %6, 16
%9 = or i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void panel_utils_get_blank_str(char *tempstr) { sprintf(tempstr, "----"); }


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

x86 assembly (clang, -O2):
<panel_utils_get_blank_str>:
movb   $0x0,0x4(%rdi)
movl   $0x2d2d2d2d,(%rdi)
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"----\00"
define void @panel_utils_get_blank_str(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
ret void
}
void j(char *q) { *q = 'a'; }


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<j>:
movb   $0x61,(%rdi)
ret

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

LLVM IR (-O2):
define void @j(i8* nocapture writeonly %0) {
store i8 97, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ CallBack1(int, int *);
int GetPrefsState(int *prefsStatePtr) {
  *prefsStatePtr = 1;
  return (int)CallBack1(163, prefsStatePtr);
}


x86 assembly (clang, -O0):
<GetPrefsState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rsi
mov    $0xa3,%edi
call   1030 <CallBack1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPrefsState>:
mov    %rdi,%rsi
movl   $0x1,(%rdi)
mov    $0xa3,%edi
jmp    1030 <CallBack1@plt>

LLVM IR (-O0):
define i32 @GetPrefsState(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 1, i32* %3
%4 = load i32*, i32** %2
%5 = call i64 @CallBack1(i32 163, i32* %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @GetPrefsState(i32* %0) {
store i32 1, i32* %0
%2 = tail call i64 @CallBack1(i32 163, i32* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void USB_HP_CAN_TX_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @USB_HP_CAN_TX_IRQHandler() {
ret void
}
/* Variables and functions */
int mul(int, int);
int fact(int n) {
  if (n == 0)
    return 1;
  else
    return mul(n, fact(n - 1));
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <fact+0x21>
movl   $0x1,-0x4(%rbp)
jmp    115f <fact+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fact@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <mul@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
test   %edi,%edi
je     1139 <fact+0x19>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <fact@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <mul@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fact(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @fact(i32 %6)
%8 = tail call i32 @mul(i32 %0, i32 %7)
br label %3
}