xunge/DecIR huggingface dataset:
int cairo_code_draw_casAMLabel_get_width() { return 138; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casAMLabel_get_width() {
ret i32 138
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casAMLabel_get_width() {
ret i32 138
}
unsigned int add_ui(unsigned int a, unsigned int b) { return a + b; }


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

x86 assembly (clang, -O2):
<add_ui>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add_ui(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int f(int);
int main(void) { return f(5) != 5; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <f@plt>
cmp    $0x5,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <f@plt>
xor    %ecx,%ecx
cmp    $0x5,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 5)
%3 = icmp ne i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
%2 = icmp ne i32 %1, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
void char_exercise_stat(struct character_t *pChar, unsigned stat,
                        unsigned qty) {}


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

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

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

LLVM IR (-O2):
%struct.character_t = type opaque
define void @char_exercise_stat(%struct.character_t* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
int main() {
  printf("before pthread_exit\n");
  pthread_exit((void *)NULL);
  printf("after pthread_exit\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"before pthread_exit\0A\00"
@.str.1 = [20 x i8] c"after pthread_exit\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @pthread_exit(i8* null)
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"before pthread_exit\00"
@str.2 = [19 x i8] c"after pthread_exit\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @pthread_exit(i8* null)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int add_ascii(char *ptr) {
  int sum = 0;
  while (*ptr != '\0') {
    sum = sum + *ptr;
    ptr++;
  }
  return sum;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @i2d_X509_CERT_PAIR() {
ret void
}
/* Variables and functions */
float logf(float);
float intr_wrap_047(float p1) { return logf(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_047>:
jmp    1030 <logf@plt>

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

LLVM IR (-O2):
define float @intr_wrap_047(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *os_realloc_alt(void *old_ptr, size_t new_size) {
  void *new_ptr = (void *)malloc(new_size);
  if (old_ptr) {
    memcpy(new_ptr, old_ptr, new_size);
    free(old_ptr);
  }
  return new_ptr;
}


x86 assembly (clang, -O0):
<os_realloc_alt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1172 <os_realloc_alt+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_realloc_alt>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1161 <os_realloc_alt+0x31>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @os_realloc_alt(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 i64, i64* %4
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = call i32 @memcpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
br label %18
18: ; preds = %11, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @os_realloc_alt(i8* %0, i64 %1) {
%3 = tail call i64 @malloc(i64 %1)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%8 = tail call i32 @free(i8* %0)
br label %9
9: ; preds = %6, %2
ret i8* %4
}
void light_free() {}


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

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

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

LLVM IR (-O2):
define void @light_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void looser() { printf("Try harder!\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Try harder!\0A\00"
define void @looser() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Try harder!\00"
define void @looser() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void printTree(void) {}


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

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

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

LLVM IR (-O2):
define void @printTree() {
ret void
}
/* Type definitions */
struct _pthread_cleanup_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _pthread_cleanup_push(struct _pthread_cleanup_context *_context,
                           void (*_routine)(void *), void *_arg) {
  _unsupported();
}


x86 assembly (clang, -O0):
<_pthread_cleanup_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <_unsupported@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct._pthread_cleanup_context = type { i32 }
define void @_pthread_cleanup_push(%struct._pthread_cleanup_context* nocapture readnone %0, void (i8*)* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @_unsupported()
ret void
}
__attribute__((noipa)) void quux(char *p) {
  int i;
  for (i = 0; i < 100; i++)
    if (p[i] != 'x')
      __builtin_abort();
}


x86 assembly (clang, -O0):
<quux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    115a <quux+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x78,%eax
je     1147 <quux+0x37>
call   1030 <abort@plt>
jmp    114c <quux+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <quux+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quux>:
push   %rax
mov    $0x4,%eax
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x78,-0x4(%rdi,%rax,1)
jne    114e <quux+0x3e>
cmpb   $0x78,-0x3(%rdi,%rax,1)
jne    114e <quux+0x3e>
cmpb   $0x78,-0x2(%rdi,%rax,1)
jne    114e <quux+0x3e>
cmpb   $0x78,-0x1(%rdi,%rax,1)
jne    114e <quux+0x3e>
cmpb   $0x78,(%rdi,%rax,1)
jne    114e <quux+0x3e>
add    $0x5,%rax
cmp    $0x68,%rax
jne    1120 <quux+0x10>
pop    %rax
ret
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @quux(i8* nocapture %0) {
br label %25
2: ; preds = %25
%3 = add nuw nsw i64 %26, 1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 120
br i1 %6, label %7, label %30
7: ; preds = %2
%8 = add nuw nsw i64 %26, 2
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 120
br i1 %11, label %12, label %30
12: ; preds = %7
%13 = add nuw nsw i64 %26, 3
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 120
br i1 %16, label %17, label %30
17: ; preds = %12
%18 = add nuw nsw i64 %26, 4
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 120
br i1 %21, label %22, label %30
22: ; preds = %17
%23 = add nuw nsw i64 %26, 5
%24 = icmp eq i64 %23, 100
br i1 %24, label %31, label %25
25: ; preds = %22, %1
%26 = phi i64 [ 0, %1 ], [ %23, %22 ]
%27 = getelementptr inbounds i8, i8* %0, i64 %26
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 120
br i1 %29, label %2, label %30
30: ; preds = %17, %12, %7, %2, %25
tail call void @abort()
unreachable
31: ; preds = %22
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ t4a(int *);
void t4() {
  int a[] = {98};
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/function.c",
          29, 98, t4a(a));
  ;
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <t4a@plt>
mov    %eax,%ecx
lea    0xec1(%rip),%rdi
mov    $0x1d,%esi
mov    $0x62,%edx
call   1040 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
push   %rax
movl   $0x62,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <t4a@plt>
lea    0xec6(%rip),%rdi
mov    $0x1d,%esi
mov    $0x62,%edx
mov    %eax,%ecx
call   1040 <fexpect@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.t4.a = [1 x i32] [i32 98]
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/function.c\00"
define void @t4() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%4 = call i32 @t4a(i32* %3)
%5 = call i32 @fexpect(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 29, i32 98, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/function.c\00"
define void @t4() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 98, i32* %3
%4 = call i32 @t4a(i32* %3)
%5 = call i32 @fexpect(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 29, i32 98, i32 %4)
ret void
}
void no_op(void) {}


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

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

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

LLVM IR (-O2):
define void @no_op() {
ret void
}
const unsigned char *encoding_name(unsigned char *encoding) {
  if (!encoding)
    return (const unsigned char *)"ISO-8859-1";
  else
    return encoding;
}


x86 assembly (clang, -O0):
<encoding_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <encoding_name+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <encoding_name+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoding_name>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"ISO-8859-1\00"
define i8* @encoding_name(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int neg_mod(int n, int m) {
  assert(n >= 0 && n < m);
  return (n == 0 ? 0 : m - n);
}


x86 assembly (clang, -O0):
<neg_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1139 <neg_mod+0x29>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x4(%rbp)
jne    115a <neg_mod+0x4a>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <neg_mod+0x53>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_mod>:
push   %rbx
mov    %esi,%ebx
sub    %edi,%ebx
setg   %al
test   %edi,%edi
setns  %cl
cmove  %edi,%ebx
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @neg_mod(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = icmp sgt i32 %1, %0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp eq i32 %0, 0
%9 = sub nsw i32 %1, %0
%10 = select i1 %8, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_mullo_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test52(__m64 a, __m64 b) { return _mm_mullo_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test52>:
jmp    1030 <_mm_mullo_pi16@plt>

LLVM IR (-O0):
define i32 @test52(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_mullo_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test52(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mullo_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ hp1();
int /*<<< orphan*/ hp2();
int /*<<< orphan*/ hp3();
int /*<<< orphan*/ hp4();
void main(void) {
  hp1();
  hp2();
  hp3();
  hp4();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hp1@plt>
mov    $0x0,%al
call   1060 <hp2@plt>
mov    $0x0,%al
call   1030 <hp3@plt>
mov    $0x0,%al
call   1050 <hp4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <hp1@plt>
xor    %eax,%eax
call   1060 <hp2@plt>
xor    %eax,%eax
call   1030 <hp3@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <hp4@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @hp1()
%2 = call i32 (...) @hp2()
%3 = call i32 (...) @hp3()
%4 = call i32 (...) @hp4()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @hp1()
%2 = tail call i32 (...) @hp2()
%3 = tail call i32 (...) @hp3()
%4 = tail call i32 (...) @hp4()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;

/* Variables and functions */
int /*<<< orphan*/ arc4random_buf(void *, int /*<<< orphan*/);
int /*<<< orphan*/ arc4random_stir();
void arc4rand(void *ptr, u_int len, int reseed) {
  if (reseed) {
    arc4random_stir();
  }
  arc4random_buf(ptr, len);
}


x86 assembly (clang, -O0):
<arc4rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1143 <arc4rand+0x23>
mov    $0x0,%al
call   1030 <arc4random_stir@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <arc4random_buf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc4rand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %edx,%edx
je     1133 <arc4rand+0x13>
xor    %eax,%eax
call   1030 <arc4random_stir@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <arc4random_buf@plt>

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

LLVM IR (-O2):
define void @arc4rand(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (...) @arc4random_stir()
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @arc4random_buf(i8* %0, i32 %1)
ret void
}
char ***kth_paragraph(char ****document, int k) { return document[k - 1]; }


x86 assembly (clang, -O0):
<kth_paragraph>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kth_paragraph>:
movslq %esi,%rax
mov    -0x8(%rdi,%rax,8),%rax
ret

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

LLVM IR (-O2):
define i8*** @kth_paragraph(i8**** nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8***, i8**** %0, i64 %4
%6 = load i8***, i8**** %5
ret i8*** %6
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void *print_xs(void *unused) {
  while (1)
    fputc('x', stderr);
  return NULL;
}


x86 assembly (clang, -O0):
<print_xs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    $0x78,%edi
call   1030 <fputc@plt>
jmp    111c <print_xs+0xc>

x86 assembly (clang, -O2):
<print_xs>:
push   %rbx
mov    0x2ec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    $0x78,%edi
call   1030 <fputc@plt>
jmp    1120 <print_xs+0x10>

LLVM IR (-O0):
@stderr = global i32 0
define i8* @print_xs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i32, i32* @stderr
%5 = call i32 @fputc(i8 signext 120, i32 %4)
br label %3
}

LLVM IR (-O2):
@stderr = global i32 0
define noalias i8* @print_xs(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputc(i8 signext 120, i32 %3)
br label %2
}
extern char *binary_sym(void) { return "×"; }


x86 assembly (clang, -O0):
<binary_sym>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_sym>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\C3\97\00"
define i8* @binary_sym() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"\C3\97\00"
define i8* @binary_sym() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int m, n;
  while (scanf("%d%d", &m, &n) == 2)
    printf("%d\n", m * n - 1);
  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>
cmp    $0x2,%eax
jne    1167 <main+0x47>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
sub    $0x1,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1186 <main+0x66>
lea    0xebd(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
add    $0xffffffff,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %8
%11 = add nsw i32 %10, -1
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = icmp eq i32 %13, 2
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret i32 0
}
void arr_append(void **arr, void *data) {
  int i = 0;
  while (arr[i])
    ++i;
  arr[i] = data;
}


x86 assembly (clang, -O0):
<arr_append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <arr_append+0x34>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <arr_append+0x13>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_append>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <arr_append+0x10>
mov    %eax,%eax
mov    %rsi,(%rdi,%rax,8)
ret

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

LLVM IR (-O2):
define void @arr_append(i8** nocapture %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
store i8* %1, i8** %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void stubFuncVI(int32_t x) {}


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

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

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

LLVM IR (-O2):
define void @stubFuncVI(i32 %0) {
ret void
}
void modem_set_active_state(int state) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ BigEndianReadU64(int /*<<< orphan*/ const *);
double BigEndianReadF64(const uint8_t *bytes) {
  union {
    double f64;
    uint64_t u64;
  } u;
  u.u64 = BigEndianReadU64(bytes);
  return u.f64;
}


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

x86 assembly (clang, -O2):
<BigEndianReadF64>:
push   %rax
call   1030 <BigEndianReadU64@plt>
mov    %eax,%eax
movq   %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @BigEndianReadF64(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @BigEndianReadU64(i32* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to double*
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
define double @BigEndianReadF64(i32* %0) {
%2 = tail call i32 @BigEndianReadU64(i32* %0)
%3 = zext i32 %2 to i64
%4 = bitcast i64 %3 to double
ret double %4
}
void bin32_to_8(int a, unsigned char *b) {
  b[0] = (unsigned char)(a >> 24);
  b[1] = (unsigned char)(a >> 16);
  b[2] = (unsigned char)(a >> 8);
  b[3] = (unsigned char)a;
}


x86 assembly (clang, -O0):
<bin32_to_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin32_to_8>:
bswap  %edi
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @bin32_to_8(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int enable;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetScreenUpdateEnable(unsigned char enable) {
  SendChar((0XEE) & 0xFF);
  SendChar((0xB3) & 0xFF);
  SendChar((enable)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetScreenUpdateEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb3,%edi
call   1030 <SendChar@plt>
movzbl -0x1(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetScreenUpdateEnable>:
push   %rbx
mov    %edi,%ebx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb3,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetScreenUpdateEnable(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @SendChar(i32 238)
%4 = call i32 @SendChar(i32 179)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = call i32 @SendChar(i32 %7)
%9 = call i32 @SendChar(i32 255)
%10 = call i32 @SendChar(i32 252)
%11 = call i32 @SendChar(i32 255)
%12 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetScreenUpdateEnable(i8 zeroext %0) {
%2 = tail call i32 @SendChar(i32 238)
%3 = tail call i32 @SendChar(i32 179)
%4 = zext i8 %0 to i32
%5 = tail call i32 @SendChar(i32 %4)
%6 = tail call i32 @SendChar(i32 255)
%7 = tail call i32 @SendChar(i32 252)
%8 = tail call i32 @SendChar(i32 255)
%9 = tail call i32 @SendChar(i32 255)
ret void
}
double calcJDFromJulianCent(const double t) { return t * 36525.0 + 2451545.0; }


x86 assembly (clang, -O0):
<calcJDFromJulianCent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcJDFromJulianCent>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcJDFromJulianCent(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 3.652500e+04, double 0x4142B42C80000000)
ret double %4
}

LLVM IR (-O2):
define double @calcJDFromJulianCent(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.652500e+04, double 0x4142B42C80000000)
ret double %2
}
/* Variables and functions */
double fmod(double, int);
double generateMiddleSquare(void) {
  static double xn = 16752482;
  double value = xn;
  xn = xn * xn;
  xn = fmod((xn / 10000), 100000000);
  return value;
}


x86 assembly (clang, -O0):
<generateMiddleSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0x2f08(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0x2efb(%rip),%xmm0
mulsd  0x2ef3(%rip),%xmm0
movsd  %xmm0,0x2eeb(%rip)
movsd  0x2ee3(%rip),%xmm0
movsd  0xeb3(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x5f5e100,%edi
call   1030 <fmod@plt>
movsd  %xmm0,0x2ec5(%rip)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateMiddleSquare>:
push   %rax
movsd  0x2f0f(%rip),%xmm0
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x2efe(%rip)
divsd  0xece(%rip),%xmm0
mov    $0x5f5e100,%edi
call   1030 <fmod@plt>
movsd  %xmm0,0x2ee4(%rip)
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@generateMiddleSquare.xn = internal global double 0x416FF3EC40000000
define double @generateMiddleSquare() {
%1 = alloca double
%2 = load double, double* @generateMiddleSquare.xn
store double %2, double* %1
%3 = load double, double* @generateMiddleSquare.xn
%4 = load double, double* @generateMiddleSquare.xn
%5 = fmul double %3, %4
store double %5, double* @generateMiddleSquare.xn
%6 = load double, double* @generateMiddleSquare.xn
%7 = fdiv double %6, 1.000000e+04
%8 = call double @fmod(double %7, i32 100000000)
store double %8, double* @generateMiddleSquare.xn
%9 = load double, double* %1
ret double %9
}

LLVM IR (-O2):
@generateMiddleSquare.xn = internal unnamed_addr global double 0x416FF3EC40000000
define double @generateMiddleSquare() {
%1 = load double, double* @generateMiddleSquare.xn
%2 = fmul double %1, %1
store double %2, double* @generateMiddleSquare.xn
%3 = fdiv double %2, 1.000000e+04
%4 = tail call double @fmod(double %3, i32 100000000)
store double %4, double* @generateMiddleSquare.xn
ret double %1
}
void test_five(int x, int y, int z) {
#pragma omp target teams distribute parallel for collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      for (int i = 0; i < z; i++)
        ;
}


x86 assembly (clang, -O0):
<test_five>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117f <test_five+0x7f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <test_five+0x6c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <test_five+0x59>
jmp    114b <test_five+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <test_five+0x3a>
jmp    115e <test_five+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <test_five+0x27>
jmp    1171 <test_five+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_five+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_five(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
unsigned int tolower(int /*<<< orphan*/);
unsigned int strcasesum(const char *str) {
  unsigned int sum = 0;
  while (*str)
    sum = (sum << 4) + tolower(*(str++));
  return sum;
}


x86 assembly (clang, -O0):
<strcasesum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <strcasesum+0x4f>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strcasesum+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasesum>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114a <strcasesum+0x3a>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
shl    $0x4,%ebp
movsbl %al,%edi
call   1030 <tolower@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strcasesum+0x20>
jmp    114c <strcasesum+0x3c>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @strcasesum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 4
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = tail call i32 @tolower(i32 %10)
%12 = add i32 %11, %8
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
__attribute__((always_)) int pm_generic_runtime_suspend(struct device *dev) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @pm_generic_runtime_suspend(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ put8(struct buffer *, int);
void put16le(struct buffer *input, uint16_t val) {
  put8(input, val);
  put8(input, val >> 8);
}


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

x86 assembly (clang, -O2):
<put16le>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <put8@plt>
sar    $0x8,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put8@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @put16le(%struct.buffer* %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @put8(%struct.buffer* %5, i32 %6)
%8 = load %struct.buffer*, %struct.buffer** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = call i32 @put8(%struct.buffer* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @put16le(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @put8(%struct.buffer* %0, i32 %1)
%4 = ashr i32 %1, 8
%5 = tail call i32 @put8(%struct.buffer* %0, i32 %4)
ret void
}
int checkUSR() {}


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

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

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

LLVM IR (-O2):
define i32 @checkUSR() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  printf("%10.*f", 2, 12.0);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%10.*f\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, double 1.200000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%10.*f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, double 1.200000e+01)
ret i32 0
}
void ngstuff_init() { ; }


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

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

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

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