xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dlg_exiterr(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *dlg_strclone(const char *cprompt) {
  char *prompt = (char *)malloc(strlen(cprompt) + 1);
  if ((prompt) == 0)
    dlg_exiterr("cannot allocate memory in "
                "dlg_strclone");
  strcpy(prompt, cprompt);
  return prompt;
}


x86 assembly (clang, -O0):
<dlg_strclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117c <dlg_strclone+0x3c>
lea    0xe89(%rip),%rdi
call   1040 <dlg_exiterr@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlg_strclone>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1169 <dlg_strclone+0x29>
lea    0xe9c(%rip),%rdi
call   1040 <dlg_exiterr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"cannot allocate memory in dlg_strclone\00"
define i8* @dlg_strclone(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @dlg_exiterr(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [39 x i8] c"cannot allocate memory in dlg_strclone\00"
define i8* @dlg_strclone(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @dlg_exiterr(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
const char *runcontext_capturevar(const char *restrict env_var,
                                  char *restrict *slot) {
  *slot = malloc(strlen(env_var) + 1);
  strcpy(*slot, env_var);
  return *slot;
}


x86 assembly (clang, -O0):
<runcontext_capturevar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runcontext_capturevar>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    (%r14),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @runcontext_capturevar(i8* noalias %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
%9 = load i8**, i8*** %4
store i8* %8, i8** %9
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = load i8*, i8** %3
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
ret i8* %15
}

LLVM IR (-O2):
define i8* @runcontext_capturevar(i8* noalias %0, i8** nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
store i8* %5, i8** %1
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = load i8*, i8** %1
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ prt_not_mcn(int);
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  int n = strtol(argv[1], NULL, 10);
  prt_not_mcn(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <prt_not_mcn@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%edi
call   1030 <prt_not_mcn@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strtol(i8* %9, i32* null, i32 10)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @prt_not_mcn(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strtol(i8* nocapture %4, i32* null, i32 10)
%6 = tail call i32 @prt_not_mcn(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RD;
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
void pollsvr_shutdown_client(int sock) { shutdown(sock, SHUT_RD); }


x86 assembly (clang, -O0):
<pollsvr_shutdown_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pollsvr_shutdown_client>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
@SHUT_RD = global i32 0
define void @pollsvr_shutdown_client(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SHUT_RD
%5 = call i32 @shutdown(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SHUT_RD = global i32 0
define void @pollsvr_shutdown_client(i32 %0) {
%2 = load i32, i32* @SHUT_RD
%3 = tail call i32 @shutdown(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(char);
char *strupr(char *s) {
  char *p = s;
  while (*p != '\0') {
    if (islower(*p)) {
      *p = toupper(*p);
    }
    p++;
  }
  return s;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117f <strupr+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     116e <strupr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1165 <strupr+0x45>
mov    %r14,%rbx
jmp    114c <strupr+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <strupr+0x45>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1140 <strupr+0x20>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1140 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @islower(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret i8* %0
}
/* Variables and functions */
float __nv_log1pf(float);
float log1pf(float __a) { return __nv_log1pf(__a); }


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

x86 assembly (clang, -O2):
<log1pf>:
jmp    1030 <__nv_log1pf@plt>

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

LLVM IR (-O2):
define float @log1pf(float %0) {
%2 = tail call float @__nv_log1pf(float %0)
ret float %2
}
/* Variables and functions */
scalar_t__ is_prime(int);
unsigned int prime_geq(int n) {
  for (int m = n + 1;; m++) {
    if (is_prime(m)) {
      return m;
    }
  }
}


x86 assembly (clang, -O0):
<prime_geq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     113f <prime_geq+0x2f>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1144 <prime_geq+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <prime_geq+0x14>

x86 assembly (clang, -O2):
<prime_geq>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <is_prime@plt>
test   %rax,%rax
je     1120 <prime_geq+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @prime_geq(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, 1
%5 = tail call i64 @is_prime(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ qux(int /*<<< orphan*/);
int /*<<< orphan*/ setjmp(int /*<<< orphan*/);
void baz(jmp_buf buf) {
  jmp_buf local_buf;
  printf("Inside baz\n");
  if (!setjmp(local_buf))
    qux(buf);
  else
    printf("Error: Shouldn't be here in baz\n");
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <setjmp@plt>
cmp    $0x0,%eax
jne    1165 <baz+0x35>
mov    -0x4(%rbp),%edi
call   1040 <qux@plt>
jmp    1171 <baz+0x41>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
call   1050 <setjmp@plt>
test   %eax,%eax
je     1156 <baz+0x26>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <qux@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Inside baz\0A\00"
@.str.1 = [33 x i8] c"Error: Shouldn't be here in baz\0A\00"
define void @baz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 @setjmp(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @qux(i32 %9)
br label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"Inside baz\00"
@str.2 = [32 x i8] c"Error: Shouldn't be here in baz\00"
define void @baz(i32 %0) {
%2 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = call i32 @setjmp(i32 undef)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @qux(i32 %0)
br label %9
7: ; preds = %1
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}
__attribute__((always_)) void check_trace_callback_type_mm_page_alloc_extfrag(
    void (*cb)(void *__data, struct page *page, int alloc_order,
               int fallback_order, int alloc_migratetype,
               int fallback_migratetype)) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @check_trace_callback_type_mm_page_alloc_extfrag(void (i8*, %struct.page*, i32, i32, i32, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
float fmod(float, float);
float Float_mod(float x, float y) { return fmod(x, y); }


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

x86 assembly (clang, -O2):
<Float_mod>:
jmp    1030 <fmod@plt>

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

LLVM IR (-O2):
define float @Float_mod(float %0, float %1) {
%3 = tail call float @fmod(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int snprintf(char *, int, char *, int);
int main(void) {
  char buf[10];
  int size = snprintf(buf, 10, "bonjour toto %f", 12.);
  printf("size : %d \n ", size);
  puts(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    $0xa,%esi
lea    0xeb1(%rip),%rdx
mov    $0xc,%ecx
call   1050 <snprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdx
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xc,%ecx
call   1050 <snprintf@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"bonjour toto %f\00"
@.str.1 = [13 x i8] c"size : %d \0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 12)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"bonjour toto %f\00"
@.str.1 = [13 x i8] c"size : %d \0A \00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleangpio(int, void *);
unsigned int *initgpio(int *, void *);
int /*<<< orphan*/ setop(unsigned int volatile *, int);
int main() {
  int fd = 0;
  void *pr;
  volatile unsigned int *p;
  p = initgpio(&fd, pr);
  setop(p, 4);
  cleangpio(fd, (void *)p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1040 <initgpio@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1050 <setop@plt>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <cleangpio@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <initgpio@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
call   1050 <setop@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1030 <cleangpio@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
%5 = load i8*, i8** %3
%6 = call i32* @initgpio(i32* %2, i8* %5)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = call i32 @setop(i32* %7, i32 4)
%9 = load i32, i32* %2
%10 = load i32*, i32** %4
%11 = bitcast i32* %10 to i8*
%12 = call i32 @cleangpio(i32 %9, i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32* @initgpio(i32* %1, i8* undef)
%4 = call i32 @setop(i32* %3, i32 4)
%5 = load i32, i32* %1
%6 = bitcast i32* %3 to i8*
%7 = call i32 @cleangpio(i32 %5, i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvCaptureToBufferEx(unsigned long ulBoardNum, void **hEvent,
                        unsigned long ulFlags, int nNumFrames, void *pBuffer,
                        void *pBufferDirect, int ulLineIncrement,
                        long long *pTimeStamp) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvCaptureToBufferEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureToBufferEx(i64 %0, i8** %1, i64 %2, i32 %3, i8* %4, i8* %5, i32 %6, i64* %7) {
%9 = alloca i64
%10 = alloca i8**
%11 = alloca i64
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i64*
store i64 %0, i64* %9
store i8** %1, i8*** %10
store i64 %2, i64* %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i32 %6, i32* %15
store i64* %7, i64** %16
%17 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureToBufferEx(i64 %0, i8** nocapture readnone %1, i64 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i32 %6, i64* nocapture readnone %7) {
%9 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double _days(double n) { return (n / (3600. * 24.)); }


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

x86 assembly (clang, -O2):
<_days>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_days(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 8.640000e+04
ret double %4
}

LLVM IR (-O2):
define double @_days(double %0) {
%2 = fdiv double %0, 8.640000e+04
ret double %2
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
extern void sleepms(int ms) {
  struct timespec ts;
  if (ms <= 0)
    return;
  ts.tv_sec = (time_t)(ms / 1000);
  ts.tv_nsec = (long)(ms % 1000 * 1000000);
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<sleepms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     112a <sleepms+0x1a>
jmp    115f <sleepms+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
cltq
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepms>:
test   %edi,%edi
jle    114d <sleepms+0x3d>
sub    $0x18,%rsp
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %rax,0x10(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @sleepms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %18
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %10, i64* %11
%12 = load i32, i32* %2
%13 = srem i32 %12, 1000
%14 = mul nsw i32 %13, 1000000
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %15, i64* %16
%17 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
br label %18
18: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @sleepms(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = icmp slt i32 %0, 1
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = udiv i32 %0, 1000
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = urem i32 %0, 1000
%10 = mul nuw nsw i32 %9, 1000000
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %11, i64* %12
%13 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
br label %14
14: ; preds = %1, %5
ret void
}
int test_11(unsigned char x, int y, int z) { return ((x << 3) & -111) != 0; }


x86 assembly (clang, -O0):
<test_11>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
and    $0xffffff91,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_11>:
xor    %eax,%eax
test   $0xf2,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @test_11(i8 zeroext %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 i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 3
%10 = and i32 %9, -111
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_11(i8 zeroext %0, i32 %1, i32 %2) {
%4 = and i8 %0, -14
%5 = icmp ne i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *mz_version(void) { return "10.0.2"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"10.0.2\00"
define i8* @mz_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct uci_context {
  int dummy;
};

/* Variables and functions */
char const *ucix_get_option(struct uci_context *, char *, char const *,
                            char const *);
const char *fwd_read_string(struct uci_context *uci, const char *s,
                            const char *o) {
  return ucix_get_option(uci, "firewall", s, o);
}


x86 assembly (clang, -O0):
<fwd_read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <ucix_get_option@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwd_read_string>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <ucix_get_option@plt>

LLVM IR (-O0):
%struct.uci_context = type { i32 }
@.str = [9 x i8] c"firewall\00"
define i8* @fwd_read_string(%struct.uci_context* %0, i8* %1, i8* %2) {
%4 = alloca %struct.uci_context*
%5 = alloca i8*
%6 = alloca i8*
store %struct.uci_context* %0, %struct.uci_context** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.uci_context*, %struct.uci_context** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @ucix_get_option(%struct.uci_context* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.uci_context = type { i32 }
@.str = [9 x i8] c"firewall\00"
define i8* @fwd_read_string(%struct.uci_context* %0, i8* %1, i8* %2) {
%4 = tail call i8* @ucix_get_option(%struct.uci_context* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i8* %4
}
int isspace(int c) { return c == ' ' || (unsigned)c - '\t' < 5; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1125 <isspace+0x25>
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
cmp    $0x5,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t cichlid_rotate_right_64(uint64_t x, int n) {
  return (x >> n) | (x << (64 - n));
}


x86 assembly (clang, -O0):
<cichlid_rotate_right_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cichlid_rotate_right_64>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cichlid_rotate_right_64(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @cichlid_rotate_right_64(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int strcmp(char *, char *);
int compfilenames(const void *s1, const void *s2) {
  char *r1 = *(char *const *)s1;
  char *r2 = *(char *const *)s2;
  return strcmp(r1, r2);
}


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

x86 assembly (clang, -O2):
<compfilenames>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compfilenames(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compfilenames(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
char str_uppercase(char c) {
  if (c >= 'a' && c <= 'z')
    return 'A' + (c - 'a');
  return c;
}


x86 assembly (clang, -O0):
<str_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <str_uppercase+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <str_uppercase+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113c <str_uppercase+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_uppercase>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @str_uppercase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 65, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @str_uppercase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
int trace_compare_generation(unsigned int a, unsigned int b) {
  if (a >= 0xc0000000 && b < 0x40000000)
    return 1;
  if (b > a)
    return 1;
  if (b < a)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<trace_compare_generation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xc0000000,-0x8(%rbp)
jb     1130 <trace_compare_generation+0x30>
cmpl   $0x40000000,-0xc(%rbp)
jae    1130 <trace_compare_generation+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1167 <trace_compare_generation+0x67>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1148 <trace_compare_generation+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1167 <trace_compare_generation+0x67>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1160 <trace_compare_generation+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <trace_compare_generation+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_compare_generation>:
cmp    %edi,%esi
sbb    %ecx,%ecx
cmp    $0x40000000,%esi
mov    $0x1,%edx
mov    %ecx,%eax
cmovb  %edx,%eax
cmp    $0xc0000000,%edi
cmovb  %ecx,%eax
cmp    %edi,%esi
cmova  %edx,%eax
ret

LLVM IR (-O0):
define i32 @trace_compare_generation(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 uge i32 %6, -1073741824
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp ult i32 %9, 1073741824
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %3
br label %23
12: ; preds = %8, %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp ugt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %3
br label %23
17: ; preds = %12
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = icmp ult i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 -1, i32* %3
br label %23
22: ; preds = %17
store i32 0, i32* %3
br label %23
23: ; preds = %22, %21, %16, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @trace_compare_generation(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, -1073741825
%4 = icmp ult i32 %1, 1073741824
%5 = and i1 %3, %4
%6 = icmp ugt i32 %1, %0
%7 = or i1 %6, %5
%8 = icmp ult i32 %1, %0
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ mz_ext_free(void *);
void mz_free(void *p) { mz_ext_free(p); }


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

x86 assembly (clang, -O2):
<mz_free>:
jmp    1030 <mz_ext_free@plt>

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

LLVM IR (-O2):
define void @mz_free(i8* %0) {
%2 = tail call i32 @mz_ext_free(i8* %0)
ret void
}
int __attribute__((no, const)) ret0(float value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ret0(float %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int, int);
int main() {
  int a = 50;
  double b = 100.12;
  printf("%.2lf * %d = %d", b, a, (int)(a * b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%esi
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
cvttsd2si %xmm1,%edx
lea    0xeb8(%rip),%rdi
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    $0x32,%esi
mov    $0x138e,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%.2lf * %d = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 50, i32* %2
store double 1.001200e+02, double* %3
%4 = load double, double* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %4, i32 %5, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%.2lf * %d = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 1.001200e+02, i32 50, i32 5006)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int _pthread_get_state(int /*<<< orphan*/ *, int);
int pthread_attr_getdetachstate(pthread_attr_t *a, int *flag) {
  *flag = _pthread_get_state(a, 0x04);
  return 0;
}


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

x86 assembly (clang, -O2):
<pthread_attr_getdetachstate>:
push   %rbx
mov    %rsi,%rbx
mov    $0x4,%esi
call   1030 <_pthread_get_state@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pthread_attr_getdetachstate(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 = call i32 @_pthread_get_state(i32* %5, i32 4)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_attr_getdetachstate(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @_pthread_get_state(i32* %0, i32 4)
store i32 %3, i32* %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ string_empty(char const *);
size_t vsscanf(char const *, char const *, int /*<<< orphan*/);
size_t string_vscanf(const char *string, const char *format, va_list vargs) {
  if (!string_empty(string)) {
    ssize_t result;
    if ((result = vsscanf(string, format, vargs)) < 0)
      result = 0;
    return result;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<string_vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <string_empty@plt>
cmp    $0x0,%eax
jne    1178 <string_vscanf+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <vsscanf@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jae    116b <string_vscanf+0x4b>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1180 <string_vscanf+0x60>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_vscanf>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <string_empty@plt>
test   %eax,%eax
je     113d <string_vscanf+0x1d>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <vsscanf@plt>

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

LLVM IR (-O2):
define i64 @string_vscanf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @string_empty(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i64 @vsscanf(i8* %0, i8* %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ PutGeneric256(int, int, unsigned char, unsigned char,
                                 unsigned char *);
void PutSprite(int x, int y, unsigned char *p) {
  PutGeneric256(x, y, *p, *(p + 1), p + 2);
}


x86 assembly (clang, -O0):
<PutSprite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    -0x10(%rbp),%r8
add    $0x2,%r8
movzbl %cl,%edx
movzbl %al,%ecx
call   1030 <PutGeneric256@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutSprite>:
movzbl (%rdx),%eax
movzbl 0x1(%rdx),%ecx
lea    0x2(%rdx),%r8
mov    %eax,%edx
jmp    1030 <PutGeneric256@plt>

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

LLVM IR (-O2):
define void @PutSprite(i32 %0, i32 %1, i8* %2) {
%4 = load i8, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %2, i64 2
%8 = tail call i32 @PutGeneric256(i32 %0, i32 %1, i8 zeroext %4, i8 zeroext %6, i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LogAbort();
void CatchSigAbort(int signo) { LogAbort(); }


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

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

LLVM IR (-O0):
define void @CatchSigAbort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @LogAbort()
ret void
}

LLVM IR (-O2):
define void @CatchSigAbort(i32 %0) {
%2 = tail call i32 (...) @LogAbort()
ret void
}
void versatile_clcd_remove_dma(struct clcd_fb *fb) {}


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

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

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

LLVM IR (-O2):
%struct.clcd_fb = type opaque
define void @versatile_clcd_remove_dma(%struct.clcd_fb* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IOSMCPPAYLOAD_memset(void *, int, int);
void *svcAlloc(int, int);
void *allocIobuf() {
  void *ptr = svcAlloc(0xCAFF, 0x828);
  IOSMCPPAYLOAD_memset(ptr, 0x00, 0x828);
  return ptr;
}


x86 assembly (clang, -O0):
<allocIobuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xcaff,%edi
mov    $0x828,%esi
call   1030 <svcAlloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x828,%edx
call   1040 <IOSMCPPAYLOAD_memset@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocIobuf>:
push   %rbx
mov    $0xcaff,%edi
mov    $0x828,%esi
call   1030 <svcAlloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x828,%edx
call   1040 <IOSMCPPAYLOAD_memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @allocIobuf() {
%1 = alloca i8*
%2 = call i8* @svcAlloc(i32 51967, i32 2088)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @IOSMCPPAYLOAD_memset(i8* %3, i32 0, i32 2088)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @allocIobuf() {
%1 = tail call i8* @svcAlloc(i32 51967, i32 2088)
%2 = tail call i32 @IOSMCPPAYLOAD_memset(i8* %1, i32 0, i32 2088)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_exception_1111();
void m68k_op_cpgen_32(void) {
  if (0) {

    ;
    return;
  }
  m68ki_exception_1111();
}


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

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

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

LLVM IR (-O2):
define void @m68k_op_cpgen_32() {
%1 = tail call i32 (...) @m68ki_exception_1111()
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *reverse2(struct list *, int /*<<< orphan*/);
struct list *reverse(struct list *a) {
  return reverse2(a, 0);
}


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

x86 assembly (clang, -O2):
<reverse>:
xor    %esi,%esi
jmp    1030 <reverse2@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @reverse(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = call %struct.list* @reverse2(%struct.list* %3, i32 0)
ret %struct.list* %4
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @reverse(%struct.list* %0) {
%2 = tail call %struct.list* @reverse2(%struct.list* %0, i32 0)
ret %struct.list* %2
}