xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XExtentsOfFontSet() {
  printf("XExtentsOfFontSet called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"XExtentsOfFontSet called\0A\00"
define i32 @XExtentsOfFontSet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"XExtentsOfFontSet called\00"
define i32 @XExtentsOfFontSet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_error_strings();
int main(void) { test_error_strings(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_error_strings()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_error_strings()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SHA1(void *, size_t, void *);
int /*<<< orphan*/ SHA_DIGEST_LENGTH;
char *malloc(int /*<<< orphan*/);
char *sha(char *s, size_t len) {
  char *md;
  md = malloc(SHA_DIGEST_LENGTH);
  SHA1((void *)s, len, (void *)md);
  return md;
}


x86 assembly (clang, -O0):
<sha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <SHA1@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <SHA1@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SHA_DIGEST_LENGTH = global i32 0
define i8* @sha(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i32, i32* @SHA_DIGEST_LENGTH
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = load i8*, i8** %5
%11 = call i32 @SHA1(i8* %8, i64 %9, i8* %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
@SHA_DIGEST_LENGTH = global i32 0
define i8* @sha(i8* %0, i64 %1) {
%3 = load i32, i32* @SHA_DIGEST_LENGTH
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @SHA1(i8* %0, i64 %1, i8* %4)
ret i8* %4
}
int DS(const void *a, const void *b) { return *(char *)b - *(char *)a; }


x86 assembly (clang, -O0):
<DS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS>:
movsbl (%rsi),%eax
movsbl (%rdi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @DS(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @DS(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void event_read(unsigned long index) {}


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

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

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

LLVM IR (-O2):
define void @event_read(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ *ptls_encode_quicint(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
uint8_t *quicly_encode_stop_sending_frame(uint8_t *dst, uint64_t stream_id,
                                          uint16_t app_error_code) {
  *dst++ = 5;
  dst = ptls_encode_quicint(dst, stream_id);
  dst = ptls_encode_quicint(dst, app_error_code);
  return dst;
}


x86 assembly (clang, -O0):
<quicly_encode_stop_sending_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicly_encode_stop_sending_frame>:
push   %rbx
mov    %edx,%ebx
movl   $0x5,(%rdi)
add    $0x4,%rdi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <ptls_encode_quicint@plt>

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

LLVM IR (-O2):
define i32* @quicly_encode_stop_sending_frame(i32* %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 5, i32* %0
%5 = tail call i32* @ptls_encode_quicint(i32* %4, i32 %1)
%6 = tail call i32* @ptls_encode_quicint(i32* %5, i32 %2)
ret i32* %6
}
/* Variables and functions */
unsigned int strlen(char *str) {
  int length = 0;
  while (*str++)
    ++length;
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void gdk_join_style_get_type() {}


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

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

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

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

/* Variables and functions */
size_t wcslcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, size_t);
size_t wcslen(int /*<<< orphan*/ const *);
size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t n) {
  if (n == 0)
    return wcslen(src);
  return wcslcpy(dest, src, n);
}


x86 assembly (clang, -O0):
<wcsxfrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1151 <wcsxfrm+0x31>
mov    -0x18(%rbp),%rdi
call   1030 <wcslen@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <wcsxfrm+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <wcslcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsxfrm>:
test   %rdx,%rdx
je     112a <wcsxfrm+0xa>
jmp    1040 <wcslcpy@plt>
mov    %rsi,%rdi
jmp    1030 <wcslen@plt>

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

LLVM IR (-O2):
define i64 @wcsxfrm(i32* %0, i32* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i64 @wcslen(i32* %1)
br label %9
7: ; preds = %3
%8 = tail call i64 @wcslcpy(i32* %0, i32* %1, i64 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i64 [ %6, %5 ], [ %8, %7 ]
ret i64 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ i2c_read(int, int, int, int *);
uint8_t mpl3115_sta(int fd) {
  uint8_t sta;
  i2c_read(fd, 0x60, 0x00, &sta);
  if ((sta & 0x08) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mpl3115_sta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x60,%esi
xor    %edx,%edx
lea    -0xc(%rbp),%rcx
call   1030 <i2c_read@plt>
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    1149 <mpl3115_sta+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1150 <mpl3115_sta+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpl3115_sta>:
push   %rax
lea    0x4(%rsp),%rcx
mov    $0x60,%esi
xor    %edx,%edx
call   1030 <i2c_read@plt>
xor    %eax,%eax
testb  $0x8,0x4(%rsp)
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mpl3115_sta(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @i2c_read(i32 %0, i32 96, i32 0, i32* %2)
%5 = load i32, i32* %2
%6 = lshr i32 %5, 3
%7 = and i32 %6, 1
%8 = xor i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show(char *xs, int n) {
  for (int i = 0; i != n; i++) {
    printf("%d", xs[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     115a <show+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <show+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1158 <show+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <show+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @show(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
void putchar(int pos, char c, char color) {
  asm volatile("movl $0x8, %%eax; int $0x80" : : "b"(pos), "c"(c), "d"(color));
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0xc(%rbp)
mov    %cl,-0xd(%rbp)
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0xd(%rbp),%cl
mov    -0xe(%rbp),%dl
mov    $0x8,%eax
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%ebx
mov    $0x8,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @putchar(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
ret void
}

LLVM IR (-O2):
define void @putchar(i32 %0, i8 signext %1, i8 signext %2) {
tail call void asm sideeffect "movl $$0x8, %eax; int $$0x80", "{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8 %1, i8 %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
void set_XPointerMovedEvent_window(void *_p, unsigned long _v) {
  ((XPointerMovedEvent *)_p)->window = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XPointerMovedEvent_window>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XPointerMovedEvent_window>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XPointerMovedEvent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XPointerMovedEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_point(int, unsigned int, unsigned int);
void print_line(unsigned int y, unsigned int color) {
  int i;
  for (i = 0; i < 480; i++)
    print_point(i, y, color);
}


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1e0,-0xc(%rbp)
jge    114e <print_line+0x3e>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <print_point@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <print_line+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <print_point@plt>
add    $0x1,%ebx
cmp    $0x1e0,%ebx
jne    1120 <print_line+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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


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

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

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

LLVM IR (-O2):
define void @this_cpu_enable_ftrace() {
ret void
}
int foo(char k, char N) {
  while (k < N) {
    int i = 0;
    int j = k;
    while (i < j) {
      i = i + 1;
      j = j - 1;
    }
    k = k + 1;
  }
  return k;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1160 <foo+0x60>
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <foo+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <foo+0x2e>
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    1110 <foo+0x10>
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cmp    %sil,%al
jge    1116 <foo+0x16>
mov    %eax,%ecx
not    %cl
add    %sil,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = icmp slt i8 %0, %1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = xor i8 %0, -1
%7 = add i8 %6, %1
%8 = zext i8 %7 to i32
%9 = add nsw i32 %3, %8
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %5, %2
%12 = phi i32 [ %3, %2 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "WAV"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"WAV\00"
define i32 @isSupported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"WAV\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
float computeRight(float theta, float alpha) { return theta - alpha; }


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

x86 assembly (clang, -O2):
<computeRight>:
subss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @computeRight(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sub(int n, int a) {
  if (n >= 0) {
    printf("%d ", n);
    sub(n - 5, a);
  }
  if (n <= a)
    printf("%d ", n);
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1155 <sub+0x35>
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x5,%edi
mov    -0xc(%rbp),%esi
call   1040 <sub@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1170 <sub+0x50>
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
test   %edi,%edi
js     1143 <sub+0x23>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x5(%rbx),%edi
mov    %ebp,%esi
call   1040 <sub@plt>
cmp    %ebp,%ebx
jg     1155 <sub+0x35>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @sub(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = add nsw i32 %0, -5
%7 = tail call i32 @sub(i32 %6, i32 %1)
br label %8
8: ; preds = %4, %2
%9 = icmp sgt i32 %0, %1
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %12
12: ; preds = %10, %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
void nc_clrtoeol() { clrtoeol(); }


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

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

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

LLVM IR (-O2):
define void @nc_clrtoeol() {
%1 = tail call i32 (...) @clrtoeol()
ret void
}
char *reverse_index(s, c)
char *s, c;
{ return (rindex(s, c)); }


x86 assembly (clang, -O0):
<reverse_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <rindex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_index>:
movsbl %sil,%esi
jmp    1030 <rindex@plt>

LLVM IR (-O0):
define i8* @reverse_index(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = trunc i32 %1 to i8
store i8* %0, i8** %3
store i8 %5, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = call i8* @rindex(i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @reverse_index(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = tail call i8* @rindex(i8* %0, i32 %4)
ret i8* %5
}
float __glsl_length(float x) { return x; }


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

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

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

LLVM IR (-O2):
define float @__glsl_length(float returned %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("foooo\n");
  int y = {1, 2};
  printf("%d\n", y);
  assert(y == 1);
  printf("%d\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"foooo\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [6 x i8] c"foooo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
int absv(x)
int x;
{ return (x < 0 ? -x : x); }


x86 assembly (clang, -O0):
<absv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <absv+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absv+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absv>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absv(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void binary_tags_info() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtsi32_sd(int /*<<< orphan*/, int);
__m128d test_mm_cvtsi32_sd(__m128d A, int B) { return _mm_cvtsi32_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cvtsi32_sd>:
jmp    1030 <_mm_cvtsi32_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtsi32_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cvtsi32_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int group;
};
typedef TYPE_1__ XkbStateRec;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ Success;
scalar_t__ XkbGetState(int /*<<< orphan*/ *, int /*<<< orphan*/, TYPE_1__ *);
int /*<<< orphan*/ XkbUseCoreKbd;
int /*<<< orphan*/ eprint(char *);
int get_active_gr(Display *dpy) {
  XkbStateRec state;
  if (XkbGetState(dpy, XkbUseCoreKbd, &state) != Success)
    eprint("skb: XkbGetState() failed\n");
  return state.group;
}


x86 assembly (clang, -O0):
<get_active_gr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <XkbGetState@plt>
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%rax
je     115e <get_active_gr+0x3e>
lea    0xea7(%rip),%rdi
call   1040 <eprint@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_active_gr>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <XkbGetState@plt>
mov    0x2ebf(%rip),%rcx
cmp    (%rcx),%rax
je     114a <get_active_gr+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <eprint@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@XkbUseCoreKbd = global i32 0
@Success = global i64 0
@.str = [27 x i8] c"skb: XkbGetState() failed\0A\00"
define i32 @get_active_gr(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_3__
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @XkbUseCoreKbd
%6 = call i64 @XkbGetState(i32* %4, i32 %5, %struct.TYPE_3__* %3)
%7 = load i64, i64* @Success
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @eprint(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@XkbUseCoreKbd = global i32 0
@Success = global i64 0
@.str = [27 x i8] c"skb: XkbGetState() failed\0A\00"
define i32 @get_active_gr(i32* %0) {
%2 = alloca %struct.TYPE_3__
%3 = bitcast %struct.TYPE_3__* %2 to i8*
%4 = load i32, i32* @XkbUseCoreKbd
%5 = call i64 @XkbGetState(i32* %0, i32 %4, %struct.TYPE_3__* %2)
%6 = load i64, i64* @Success
%7 = icmp eq i64 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @eprint(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}
int is_in_str(char c, const char *str) {
  while (*str)
    if (c == *(str++))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_in_str>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <is_in_str+0x4a>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1145 <is_in_str+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_in_str+0x51>
jmp    110e <is_in_str+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_str>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <is_in_str+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <is_in_str>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_str(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Type definitions */
struct drand48_data {
  int /*<<< orphan*/ __x;
};

/* Variables and functions */
int erand48_r(int /*<<< orphan*/, struct drand48_data *, double *);
int drand48_r(struct drand48_data *buffer, double *result) {
  return erand48_r(buffer->__x, buffer, result);
}


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

x86 assembly (clang, -O2):
<drand48_r>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    (%rdi),%edi
jmp    1030 <erand48_r@plt>

LLVM IR (-O0):
%struct.drand48_data = type { i32 }
define i32 @drand48_r(%struct.drand48_data* %0, double* %1) {
%3 = alloca %struct.drand48_data*
%4 = alloca double*
store %struct.drand48_data* %0, %struct.drand48_data** %3
store double* %1, double** %4
%5 = load %struct.drand48_data*, %struct.drand48_data** %3
%6 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.drand48_data*, %struct.drand48_data** %3
%9 = load double*, double** %4
%10 = call i32 @erand48_r(i32 %7, %struct.drand48_data* %8, double* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
define i32 @drand48_r(%struct.drand48_data* %0, double* %1) {
%3 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @erand48_r(i32 %4, %struct.drand48_data* %0, double* %1)
ret i32 %5
}
int cmpeq(int x, int y, int z) { return x == y; }


x86 assembly (clang, -O0):
<cmpeq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpeq>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @cmpeq(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmpeq(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int ptr_arr;

/* Variables and functions */
float **malloc(int);
int main() {
  float a = 3;
  float b = 2;
  float **ptr_arr = malloc(sizeof(float *) * 3);
  ptr_arr[0] = &a;
  ptr_arr[1] = &b;
  ptr_arr[2] = &b;
  b = 5;
  return *(ptr_arr[0]) + *(ptr_arr[1]) + *(ptr_arr[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    -0x8(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
lea    -0xc(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
lea    -0xc(%rbp),%rcx
mov    %rcx,0x10(%rax)
movss  0xe8e(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
addss  (%rax),%xmm0
cvttss2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float**
store i32 0, i32* %1
store float 3.000000e+00, float* %2
store float 2.000000e+00, float* %3
%5 = call float** @malloc(i32 24)
store float** %5, float*** %4
%6 = load float**, float*** %4
%7 = getelementptr inbounds float*, float** %6, i64 0
store float* %2, float** %7
%8 = load float**, float*** %4
%9 = getelementptr inbounds float*, float** %8, i64 1
store float* %3, float** %9
%10 = load float**, float*** %4
%11 = getelementptr inbounds float*, float** %10, i64 2
store float* %3, float** %11
store float 5.000000e+00, float* %3
%12 = load float**, float*** %4
%13 = getelementptr inbounds float*, float** %12, i64 0
%14 = load float*, float** %13
%15 = load float, float* %14
%16 = load float**, float*** %4
%17 = getelementptr inbounds float*, float** %16, i64 1
%18 = load float*, float** %17
%19 = load float, float* %18
%20 = fadd float %15, %19
%21 = load float**, float*** %4
%22 = getelementptr inbounds float*, float** %21, i64 2
%23 = load float*, float** %22
%24 = load float, float* %23
%25 = fadd float %20, %24
%26 = fptosi float %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float** @malloc(i32 24)
ret i32 13
}
void ap_list_timer(struct hostapd_iface *iface) {}


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

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

LLVM IR (-O0):
%struct.hostapd_iface = type opaque
define void @ap_list_timer(%struct.hostapd_iface* %0) {
%2 = alloca %struct.hostapd_iface*
store %struct.hostapd_iface* %0, %struct.hostapd_iface** %2
ret void
}

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @ap_list_timer(%struct.hostapd_iface* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned FIQ_disable(void) {
  unsigned _cpsr_val;
  _cpsr_val = __get_cpsr();
  __set_cpsr(_cpsr_val | 0x00000040);
  return _cpsr_val;
}


x86 assembly (clang, -O0):
<FIQ_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x40,%edi
call   1030 <__set_cpsr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIQ_disable>:
push   %rbx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebx
mov    %eax,%edi
or     $0x40,%edi
call   1030 <__set_cpsr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @FIQ_disable() {
%1 = alloca i32
%2 = call i32 (...) @__get_cpsr()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 64
%5 = call i32 @__set_cpsr(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @FIQ_disable() {
%1 = tail call i32 (...) @__get_cpsr()
%2 = or i32 %1, 64
%3 = tail call i32 @__set_cpsr(i32 %2)
ret i32 %1
}
int tamLista() { return 0; }


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

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

LLVM IR (-O0):
define i32 @tamLista() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tamLista() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fib(int n) {
  printf("Calculating fib %d!!!\n", n);
  if (n <= 1)
    return 1;
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jg     1150 <fib+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1173 <fib+0x53>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1040 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xed3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%ebp
cmp    $0x2,%ebx
jl     1170 <fib+0x50>
add    $0x2,%ebx
xor    %ebp,%ebp
lea    0xeb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1040 <fib@plt>
lea    -0x4(%rbx),%esi
add    %eax,%ebp
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1150 <fib+0x30>
add    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Calculating fib %d!!!\0A\00"
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i32 @fib(i32 %11)
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 2
%15 = call i32 @fib(i32 %14)
%16 = add nsw i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [23 x i8] c"Calculating fib %d!!!\0A\00"
define i32 @fib(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp slt i32 %0, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %0, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = add nsw i32 %5, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %5, -2
%10 = add nsw i32 %8, %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
%12 = icmp ult i32 %5, 4
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}