xunge/DecIR huggingface dataset:
OP(fd, d1) {
  illegal_1();
  op_d1();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <illegal_1@plt>
mov    $0x0,%al
call   1030 <op_d1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d1()
ret i32 undef
}
/* Variables and functions */
long long osfreq();
long long cpucycles_sparc32cpuinfo_persecond(void) { return osfreq(); }


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

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

LLVM IR (-O0):
define i64 @cpucycles_sparc32cpuinfo_persecond() {
%1 = call i64 (...) @osfreq()
ret i64 %1
}

LLVM IR (-O2):
define i64 @cpucycles_sparc32cpuinfo_persecond() {
%1 = tail call i64 (...) @osfreq()
ret i64 %1
}
void gtk_tool_item_get_use_drag_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_get_use_drag_window() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ btree_firstkey(int, int /*<<< orphan*/);
int /*<<< orphan*/ btree_keyval(int, int /*<<< orphan*/, char *);
int g_first_fileobject(int file_id, char *label) {
  if (!btree_firstkey(file_id, 0))
    return -1;
  btree_keyval(file_id, 0, label);
  label[32] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<g_first_fileobject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <btree_firstkey@plt>
cmp    $0x0,%eax
jne    114e <g_first_fileobject+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <g_first_fileobject+0x4b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <btree_keyval@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0x20(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_first_fileobject>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r14d,%r14d
xor    %esi,%esi
call   1030 <btree_firstkey@plt>
test   %eax,%eax
je     1149 <g_first_fileobject+0x29>
mov    %ebp,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <btree_keyval@plt>
movb   $0x0,0x20(%rbx)
jmp    114f <g_first_fileobject+0x2f>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @g_first_fileobject(i32 %0, i8* %1) {
%3 = tail call i32 @btree_firstkey(i32 %0, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @btree_keyval(i32 %0, i32 0, i8* %1)
%7 = getelementptr inbounds i8, i8* %1, i64 32
store i8 0, i8* %7
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_CIPHER_CTX_copy(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_CIPHER_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *EVP_CIPHER_CTX_new();
void test_ctx_replace(EVP_CIPHER_CTX **pctx) {
  EVP_CIPHER_CTX *ctx_copy;
  ctx_copy = EVP_CIPHER_CTX_new();
  EVP_CIPHER_CTX_copy(ctx_copy, *pctx);
  EVP_CIPHER_CTX_free(*pctx);
  *pctx = ctx_copy;
}


x86 assembly (clang, -O0):
<test_ctx_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <EVP_CIPHER_CTX_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
call   1040 <EVP_CIPHER_CTX_copy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <EVP_CIPHER_CTX_free@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ctx_replace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <EVP_CIPHER_CTX_new@plt>
mov    %rax,%r14
mov    (%rbx),%rsi
mov    %rax,%rdi
call   1040 <EVP_CIPHER_CTX_copy@plt>
mov    (%rbx),%rdi
call   1030 <EVP_CIPHER_CTX_free@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @test_ctx_replace(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = call i32* (...) @EVP_CIPHER_CTX_new()
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = call i32 @EVP_CIPHER_CTX_copy(i32* %5, i32* %7)
%9 = load i32**, i32*** %2
%10 = load i32*, i32** %9
%11 = call i32 @EVP_CIPHER_CTX_free(i32* %10)
%12 = load i32*, i32** %3
%13 = load i32**, i32*** %2
store i32* %12, i32** %13
ret void
}

LLVM IR (-O2):
define void @test_ctx_replace(i32** nocapture %0) {
%2 = tail call i32* (...) @EVP_CIPHER_CTX_new()
%3 = load i32*, i32** %0
%4 = tail call i32 @EVP_CIPHER_CTX_copy(i32* %2, i32* %3)
%5 = load i32*, i32** %0
%6 = tail call i32 @EVP_CIPHER_CTX_free(i32* %5)
store i32* %2, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deallocate_frame(int /*<<< orphan*/);
int /*<<< orphan*/ get_physical_address(void *);
int /*<<< orphan*/ unmap_page(void *);
void deallocate_vframe(void *vframe) {
  deallocate_frame(get_physical_address(vframe));
  unmap_page(vframe);
}


x86 assembly (clang, -O0):
<deallocate_vframe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_physical_address@plt>
mov    %eax,%edi
call   1040 <deallocate_frame@plt>
mov    -0x8(%rbp),%rdi
call   1030 <unmap_page@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deallocate_vframe>:
push   %rbx
mov    %rdi,%rbx
call   1050 <get_physical_address@plt>
mov    %eax,%edi
call   1040 <deallocate_frame@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unmap_page@plt>

LLVM IR (-O0):
define void @deallocate_vframe(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_physical_address(i8* %3)
%5 = call i32 @deallocate_frame(i32 %4)
%6 = load i8*, i8** %2
%7 = call i32 @unmap_page(i8* %6)
ret void
}

LLVM IR (-O2):
define void @deallocate_vframe(i8* %0) {
%2 = tail call i32 @get_physical_address(i8* %0)
%3 = tail call i32 @deallocate_frame(i32 %2)
%4 = tail call i32 @unmap_page(i8* %0)
ret void
}
void gtk_spin_button_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_spin_button_get_type() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long int GetClockTimeInNanoSec() {
  struct timeval t2;
  gettimeofday(&t2, NULL);
  return t2.tv_sec * 1000000 + t2.tv_usec;
  if (t2.tv_sec > t2.tv_usec)
    return (t2.tv_sec / 1000) - (t2.tv_usec / 1000);
  else
    return (t2.tv_usec / 1000) - (t2.tv_sec / 1000);
}


x86 assembly (clang, -O0):
<GetClockTimeInNanoSec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetClockTimeInNanoSec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rsp),%rax
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @GetClockTimeInNanoSec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @GetClockTimeInNanoSec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
double my_random_double();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ srandom(int);
main(int argc, char *argv[]) {
  int i;
  float f;
  double t0, t1, d;
  int iters = 1000;
  int seed = 17;
  srandom(seed);
  for (i = 0; i < iters; i++) {
    d = my_random_double();
    printf("%f\n", d);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x34(%rbp)
movl   $0x11,-0x38(%rbp)
mov    -0x38(%rbp),%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    119a <main+0x6a>
mov    $0x0,%al
call   1050 <my_random_double@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x11,%edi
call   1030 <srandom@plt>
mov    $0x3e8,%ebp
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <my_random_double@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %11
store i32 17, i32* %12
%13 = load i32, i32* %12
%14 = call i32 @srandom(i32 %13)
store i32 0, i32* %6
br label %15
15: ; preds = %23, %2
%16 = load i32, i32* %6
%17 = load i32, i32* %11
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = call double (...) @my_random_double()
store double %20, double* %10
%21 = load double, double* %10
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %21)
br label %23
23: ; preds = %19
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %15
26: ; preds = %15
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srandom(i32 17)
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call double (...) @my_random_double()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 0
}
void test23_Blink4_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test23_Blink4_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, *aa = &a;
  scanf("%d", aa);
  printf("%d...%d", *aa / 10, *aa % 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rdx
imul   $0x66666667,%rdx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"%d...%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 10
%6 = srem i32 %4, 10
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
void strcat_strlen_Good() {
  char str[8];
  strcpy(str, "abc");
  strcat(str, "defg");
  int a[8];
  a[strlen(str)] = 0;
}


x86 assembly (clang, -O0):
<strcat_strlen_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_strlen_Good>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [5 x i8] c"defg\00"
define void @strcat_strlen_Good() {
%1 = alloca [8 x i8]
%2 = alloca [8 x i32]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%8 = call i64 @strlen(i8* %7)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %8
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [5 x i8] c"defg\00"
define void @strcat_strlen_Good() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
void test() {
  char buffer1[7] = "Hello!";
  char buffer2[7];
  memcpy(buffer2, buffer1, 7);
  assert(buffer2[5] == '!');
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x7(%rbp),%rsi
mov    $0x7,%edx
call   1040 <memcpy@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x21,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x18,%rsp
movl   $0x216f6c,0xb(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0x11(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x7,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
cmpb   $0x21,0x16(%rsp)
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test.buffer1 = [7 x i8] c"Hello!\00"
define void @test() {
%1 = alloca [7 x i8]
%2 = alloca [7 x i8]
%3 = bitcast [7 x i8]* %1 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 7)
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 33
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
@__const.test.buffer1 = [7 x i8] c"Hello!\00"
define void @test() {
%1 = alloca [7 x i8]
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %3, i32 7)
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 33
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}
/* Variables and functions */
int findMinNumTransform(unsigned int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, unsigned int *);
int main(void) {
  unsigned int target;
  while (scanf("%u", &target) > 0) {
    printf("%u\n", findMinNumTransform(target));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
jle    1174 <main+0x44>
mov    -0x8(%rbp),%edi
call   1050 <findMinNumTransform@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jle    1193 <main+0x63>
lea    0xead(%rip),%r14
lea    0xea3(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
call   1050 <findMinNumTransform@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jg     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @findMinNumTransform(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello  github\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello github\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"hello github\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
getout() { exit(0); }


x86 assembly (clang, -O0):
<getout>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<getout>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @getout() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @getout() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sdsmeanors(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sdsmeanors(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_sdsmeanors@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sdsmeanors@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sdsmeanors(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sdsmeanors(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_str(const void *v1, const void *v2) {
  return strcmp(*(char **)v1, *(char **)v2);
}


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

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

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

LLVM IR (-O2):
define i32 @compare_str(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
}
/* Variables and functions */
int intelDetectSMP();
int detectSMP(void) {
  static int isSMP = -1;
  if (isSMP != -1)
    return isSMP;
  return isSMP = intelDetectSMP();
}


x86 assembly (clang, -O0):
<detectSMP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0xffffffff,0x2f09(%rip)
je     1133 <detectSMP+0x23>
mov    0x2efd(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <detectSMP+0x33>
mov    $0x0,%al
call   1030 <intelDetectSMP@plt>
mov    %eax,0x2ee8(%rip)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detectSMP>:
push   %rax
mov    0x2f11(%rip),%eax
cmp    $0xffffffff,%eax
je     111e <detectSMP+0xe>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <intelDetectSMP@plt>
mov    %eax,0x2efd(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@detectSMP.isSMP = internal global i32 -1
define i32 @detectSMP() {
%1 = alloca i32
%2 = load i32, i32* @detectSMP.isSMP
%3 = icmp ne i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @detectSMP.isSMP
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 (...) @intelDetectSMP()
store i32 %7, i32* @detectSMP.isSMP
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@detectSMP.isSMP = internal unnamed_addr global i32 -1
define i32 @detectSMP() {
%1 = load i32, i32* @detectSMP.isSMP
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @intelDetectSMP()
store i32 %4, i32* @detectSMP.isSMP
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
void foo088(int p) {}


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

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

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

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

/* Variables and functions */
scalar_t__ mprotect(int /*<<< orphan*/, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ mprotectFailed();
void Page_DenyAccess(void *address, size_t size) {
  if (mprotect((caddr_t)address, size, 0) < 0)
    mprotectFailed();
}


x86 assembly (clang, -O0):
<Page_DenyAccess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <mprotect@plt>
cmp    $0x0,%rax
jge    1152 <Page_DenyAccess+0x32>
mov    $0x0,%al
call   1030 <mprotectFailed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Page_DenyAccess>:
push   %rax
xor    %edx,%edx
call   1040 <mprotect@plt>
test   %rax,%rax
js     112f <Page_DenyAccess+0xf>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <mprotectFailed@plt>

LLVM IR (-O0):
define void @Page_DenyAccess(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
%7 = load i64, i64* %4
%8 = call i64 @mprotect(i32 %6, i64 %7, i32 0)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @mprotectFailed()
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @Page_DenyAccess(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i64 @mprotect(i32 %4, i64 %1, i32 0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @mprotectFailed()
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          ("Usage: %s [ options ] [ <interval> [ <count> ] ] [ <datafile> ]\n"),
          progname);
  fprintf(
      stderr,
      ("Options are:\n"
       "[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\n"
       "[ -P { <cpu> | ALL } ] [ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]\n"
       "[ -- <sar_options...> ]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ] [ <datafile> ]\0A\00"
@.str.1 = [153 x i8] c"Options are:\0A[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\0A[ -P { <cpu> | ALL } ] [ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]\0A[ -- <sar_options...> ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ] [ <datafile> ]\0A\00"
@.str.1 = [153 x i8] c"Options are:\0A[ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ]\0A[ -P { <cpu> | ALL } ] [ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]\0A[ -- <sar_options...> ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strerror(int);
char *s_strerror(int errnum) {
  switch (errnum) {
  default:
    return strerror(errnum);
  }
}


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

x86 assembly (clang, -O2):
<s_strerror>:
jmp    1030 <strerror@plt>

LLVM IR (-O0):
define i8* @s_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
%5 = load i32, i32* %2
%6 = call i8* @strerror(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @s_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
double linear_activate(const double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @linear_activate(double returned %0) {
ret double %0
}
const char *skip_colon(const char *in) {
  if (in[0] == ':')
    return in + 1;
  return in;
}


x86 assembly (clang, -O0):
<skip_colon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1129 <skip_colon+0x29>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <skip_colon+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_colon>:
xor    %eax,%eax
cmpb   $0x3a,(%rdi)
sete   %al
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @skip_colon(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 58
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
char *string_upcase(char *string) {
  char *str = string;
  while (*str != '\0') {
    if (*str >= 'a' && *str <= 'z') {
      *str = *str - 'a' + 'A';
    }
    str++;
  }
  return string;
}


x86 assembly (clang, -O0):
<string_upcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <string_upcase+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1155 <string_upcase+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1155 <string_upcase+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <string_upcase+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_upcase>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <string_upcase+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <string_upcase+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <string_upcase+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <string_upcase+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <string_upcase+0x10>
ret

LLVM IR (-O0):
define i8* @string_upcase(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 = %28, %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 %31
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %28
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %28
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 97
%25 = add nsw i32 %24, 65
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %3
store i8 %26, i8* %27
br label %28
28: ; preds = %20, %15, %10
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
br label %5
31: ; preds = %5
%32 = load i8*, i8** %2
ret i8* %32
}

LLVM IR (-O2):
define i8* @string_upcase(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Type definitions */
typedef int uint_fast32_t;
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t LittleEndianReadU32(const uint8_t *bytes) {
  return (uint32_t)((uint_fast32_t)bytes[0] | (uint_fast32_t)bytes[1] << 8 |
                    (uint_fast32_t)bytes[2] << 16 |
                    (uint_fast32_t)bytes[3] << 24);
}


x86 assembly (clang, -O0):
<LittleEndianReadU32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LittleEndianReadU32>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @LittleEndianReadU32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void DPOUpdate(void *id, struct NoteFinder *nf) {}


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

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

LLVM IR (-O0):
%struct.NoteFinder = type opaque
define void @DPOUpdate(i8* %0, %struct.NoteFinder* %1) {
%3 = alloca i8*
%4 = alloca %struct.NoteFinder*
store i8* %0, i8** %3
store %struct.NoteFinder* %1, %struct.NoteFinder** %4
ret void
}

LLVM IR (-O2):
%struct.NoteFinder = type opaque
define void @DPOUpdate(i8* nocapture %0, %struct.NoteFinder* nocapture %1) {
ret void
}
int fn2() { return 7; }


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

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

LLVM IR (-O0):
define i32 @fn2() {
ret i32 7
}

LLVM IR (-O2):
define i32 @fn2() {
ret i32 7
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int32_t log2pow5(const int32_t e) {
  assert(e >= 0);
  assert(e <= 3528);
  return (int32_t)((((uint32_t)e) * 1217359) >> 19);
}


x86 assembly (clang, -O0):
<log2pow5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xdc8,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
imul   $0x12934f,-0x4(%rbp),%eax
sar    $0x13,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2pow5>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0xdc9,%ebx
setl   %dil
call   1030 <assert@plt>
imul   $0x12934f,%ebx,%eax
sar    $0x13,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @log2pow5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 3528
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 1217359
%13 = ashr i32 %12, 19
ret i32 %13
}

LLVM IR (-O2):
define i32 @log2pow5(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 3529
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = mul nsw i32 %0, 1217359
%9 = ashr i32 %8, 19
ret i32 %9
}
int f15(int x, int y) {
  if (y >= -1 && y <= 24)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jl     1131 <f15+0x31>
cmpl   $0x18,-0xc(%rbp)
jg     1131 <f15+0x31>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1138 <f15+0x38>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f15>:
lea    0x1(%rsi),%ecx
mov    $0x22,%eax
cmp    $0x19,%ecx
ja     1116 <f15+0x16>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f15(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* %5
%7 = icmp sge i32 %6, -1
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 24
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 0, %13
%15 = srem i32 %12, %14
store i32 %15, i32* %3
br label %17
16: ; preds = %8, %2
store i32 34, i32* %3
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @f15(i32 %0, i32 %1) {
%3 = add i32 %1, 1
%4 = icmp ult i32 %3, 26
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = sub nsw i32 0, %1
%7 = srem i32 %0, %6
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ 34, %2 ]
ret i32 %9
}
/* Variables and functions */
long double strtod(char const *, char **);
long double strtold(const char *str, char **endptr) {
  return strtod(str, endptr);
}


x86 assembly (clang, -O0):
<strtold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtold>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define x86_fp80 @strtold(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call x86_fp80 @strtod(i8* %5, i8** %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @strtold(i8* %0, i8** nocapture %1) {
%3 = tail call x86_fp80 @strtod(i8* %0, i8** %1)
ret x86_fp80 %3
}
/* Variables and functions */
int funcmais(int);
int funcmenos(int);
int main() {
  int tmp;
  tmp = funcmenos(0);
  tmp = 0;
  tmp = funcmais(0);
  tmp = 0;
  tmp = funcmenos(-1);
  tmp = 0;
  tmp = funcmais(-1);
  tmp = 0;
  tmp = funcmenos(1);
  tmp = 0;
  tmp = funcmais(1);
  tmp = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <funcmenos@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %edi,%edi
call   1030 <funcmais@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1040 <funcmenos@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1030 <funcmais@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <funcmenos@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <funcmais@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @funcmenos(i32 0)
store i32 %3, i32* %2
store i32 0, i32* %2
%4 = call i32 @funcmais(i32 0)
store i32 %4, i32* %2
store i32 0, i32* %2
%5 = call i32 @funcmenos(i32 -1)
store i32 %5, i32* %2
store i32 0, i32* %2
%6 = call i32 @funcmais(i32 -1)
store i32 %6, i32* %2
store i32 0, i32* %2
%7 = call i32 @funcmenos(i32 1)
store i32 %7, i32* %2
store i32 0, i32* %2
%8 = call i32 @funcmais(i32 1)
store i32 %8, i32* %2
store i32 0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @funcmenos(i32 0)
%2 = tail call i32 @funcmais(i32 0)
%3 = tail call i32 @funcmenos(i32 -1)
%4 = tail call i32 @funcmais(i32 -1)
%5 = tail call i32 @funcmenos(i32 1)
%6 = tail call i32 @funcmais(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int() { printf("calls sig_int...\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"calls sig_int...\00"
define void @sig_int() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}