xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Reserved123_DriverIRQHandler();
__attribute__((weak)) void Reserved123_IRQHandler(void) {
  Reserved123_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved123_IRQHandler() {
%1 = call i32 (...) @Reserved123_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved123_IRQHandler() {
%1 = tail call i32 (...) @Reserved123_DriverIRQHandler()
ret void
}
/* Variables and functions */
void *debug_malloc_id(size_t, char *, int /*<<< orphan*/);
void *debug_malloc(size_t k) { return debug_malloc_id(k, "<UNKNOWN>", 0); }


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

x86 assembly (clang, -O2):
<debug_malloc>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <debug_malloc_id@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"<UNKNOWN>\00"
define i8* @debug_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @debug_malloc_id(i64 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"<UNKNOWN>\00"
define i8* @debug_malloc(i64 %0) {
%2 = tail call i8* @debug_malloc_id(i64 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %2
}
unsigned int do_get_phy_addr(unsigned int vaddr) { return vaddr; }


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

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

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

LLVM IR (-O2):
define i32 @do_get_phy_addr(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
char get_start_no_len(const char *input) {
  for (int i = 0;; i++) {
    if (!isspace(input[i])) {
      return i;
    }
  }
}


x86 assembly (clang, -O0):
<get_start_no_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1149 <get_start_no_len+0x39>
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    114e <get_start_no_len+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <get_start_no_len+0x13>

x86 assembly (clang, -O2):
<get_start_no_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <get_start_no_len+0x10>
add    $0xff,%bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define signext i8 @get_start_no_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @isspace(i8 signext %5)
%7 = icmp eq i32 %6, 0
%8 = add nuw i64 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = trunc i64 %3 to i8
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_MediaRenderer_ConnectionManager_GetCurrentConnectionIDs(void *,
                                                                     char *);
void UpnpMediaRenderer_ConnectionManager_GetCurrentConnectionIDs(
    void *upnptoken) {
  ;
  UpnpResponse_MediaRenderer_ConnectionManager_GetCurrentConnectionIDs(
      upnptoken, "0");
}


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

x86 assembly (clang, -O2):
<UpnpMediaRenderer_ConnectionManager_GetCurrentConnectionIDs>:
lea    0xee9(%rip),%rsi
jmp    1030 <UpnpResponse_MediaRenderer_ConnectionManager_GetCurrentConnectionIDs@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @UpnpMediaRenderer_ConnectionManager_GetCurrentConnectionIDs(i8* %0) {
%2 = tail call i32 @UpnpResponse_MediaRenderer_ConnectionManager_GetCurrentConnectionIDs(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int ExternalLibrary(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ExternalLibrary() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mem_free(void *ptr) { free((char *)ptr - sizeof(unsigned long)); }


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

x86 assembly (clang, -O2):
<mem_free>:
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mem_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mainCounter(int /*<<< orphan*/);
void InitCounter() { mainCounter(0); }


x86 assembly (clang, -O0):
<InitCounter>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mainCounter@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitCounter>:
xor    %edi,%edi
jmp    1030 <mainCounter@plt>

LLVM IR (-O0):
define void @InitCounter() {
%1 = call i32 @mainCounter(i32 0)
ret void
}

LLVM IR (-O2):
define void @InitCounter() {
%1 = tail call i32 @mainCounter(i32 0)
ret void
}
int f(const int *b, const struct a *c, const int *d, const int *e) {
  return *b == *d;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rdx),%ecx
sete   %al
ret

LLVM IR (-O0):
%struct.a = type opaque
define i32 @f(i32* %0, %struct.a* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca %struct.a*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store %struct.a* %1, %struct.a** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = icmp eq i32 %10, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.a = type opaque
define i32 @f(i32* nocapture %0, %struct.a* nocapture readnone %1, i32* nocapture %2, i32* nocapture readnone %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void debug(int i, int j) { printf("step %x\t%x\n", i, j); }


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"step %x\09%x\0A\00"
define void @debug(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"step %x\09%x\0A\00"
define void @debug(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int TerminalAutoFlush() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @TerminalAutoFlush() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() { fprintf(stderr, "Usage: ./cp src_file dst_file\n"); }


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: ./cp src_file dst_file\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: ./cp src_file dst_file\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
void glmSubtractVector2f(float result[2], const float v1[2],
                         const float v2[2]) {
  result[0] = v1[0] - v2[0];
  result[1] = v1[1] - v2[1];
}


x86 assembly (clang, -O0):
<glmSubtractVector2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSubtractVector2f>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @glmSubtractVector2f(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_THREAD_CPUTIME_ID;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int start_time(struct timespec *ts) {
  return clock_gettime(CLOCK_THREAD_CPUTIME_ID, ts);
}


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

x86 assembly (clang, -O2):
<start_time>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_THREAD_CPUTIME_ID = global i32 0
define i32 @start_time(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_THREAD_CPUTIME_ID
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_THREAD_CPUTIME_ID = global i32 0
define i32 @start_time(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_THREAD_CPUTIME_ID
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dele() { printf("\ndeletion completed, thank you\n"); }


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"\0Adeletion completed, thank you\00"
define void @dele() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int is_empty_arg(char *arg) {
  int ret = 1;
  if (arg != NULL) {
    if (*arg)
      ret = 0;
  };
  return ret;
}


x86 assembly (clang, -O0):
<is_empty_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <is_empty_arg+0x33>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <is_empty_arg+0x2e>
movl   $0x0,-0xc(%rbp)
jmp    1133 <is_empty_arg+0x33>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty_arg>:
test   %rdi,%rdi
je     110e <is_empty_arg+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_empty_arg(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncasecmp(char *, char *, int);
void strncasecmp_0() {
  char *x = "abc";
  char *y = "Abc";
  clang_analyzer_eval(strncasecmp(x, y, 3) == 0);
}


x86 assembly (clang, -O0):
<strncasecmp_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp_0>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strncasecmp_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncasecmp(i8* %3, i8* %4, i32 3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strncasecmp_0() {
%1 = tail call i64 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assign();
void main() { test_assign(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test_assign()
ret void
}
unsigned long __umoddi3(unsigned long a __attribute__((unused)),
                        unsigned long b __attribute__((unused))) {
  return 0.0;
}


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

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

LLVM IR (-O0):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i64 0
}

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
ret i64 0
}
/* Variables and functions */
int tbuffer_copy_test();
int tbuffer_next_test();
int tbx_tbuf_test() {
  int err_next, err_copy;
  err_next = tbuffer_next_test();
  err_copy = tbuffer_copy_test();
  return (err_next + err_copy);
}


x86 assembly (clang, -O0):
<tbx_tbuf_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <tbuffer_next_test@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <tbuffer_copy_test@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbx_tbuf_test>:
push   %rbx
xor    %eax,%eax
call   1030 <tbuffer_next_test@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <tbuffer_copy_test@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tbx_tbuf_test() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @tbuffer_next_test()
store i32 %3, i32* %1
%4 = call i32 (...) @tbuffer_copy_test()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @tbx_tbuf_test() {
%1 = tail call i32 (...) @tbuffer_next_test()
%2 = tail call i32 (...) @tbuffer_copy_test()
%3 = add nsw i32 %2, %1
ret i32 %3
}
indreg0adrx1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*p0) = (((float *)(11111111 & ~(__alignof__(float) - 1)))[x1]); }


x86 assembly (clang, -O0):
<indreg0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac4,%eax
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrx1_set>:
movslq %esi,%rax
movss  0xa98ac4(,%rax,4),%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define i32 @indreg0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %17
%19 = load float, float* %18
%20 = load float*, float** %12
store float %19, float* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @indreg0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %7
%9 = load float, float* %8
store float %9, float* %4
ret i32 undef
}
unsigned xrop3_2_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = D & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_2_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_2_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%edi
not    %dil
movzbl %dil,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_2_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = or i32 %32, %36
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = and i32 %41, %42
%44 = or i32 %37, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_2_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i8 %1, %0
%7 = xor i8 %6, -1
%8 = zext i8 %7 to i32
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %10, %8
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y;
};
struct TYPE_4__ {
  TYPE_1__ xcreatewindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcreatewindow_y(void *_p, int _v) {
  ((XEvent *)_p)->xcreatewindow.y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcreatewindow_y>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xcreatewindow_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmove_bca_1a2t_b();
int /*<<< orphan*/ gmove_bca_1a2t_b2();
int /*<<< orphan*/ gmove_bca_2a3t_b2();
int main() {
  gmove_bca_1a2t_b2();
  gmove_bca_1a2t_b();
  gmove_bca_2a3t_b2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gmove_bca_1a2t_b2@plt>
mov    $0x0,%al
call   1040 <gmove_bca_1a2t_b@plt>
mov    $0x0,%al
call   1030 <gmove_bca_2a3t_b2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gmove_bca_1a2t_b2()
%3 = call i32 (...) @gmove_bca_1a2t_b()
%4 = call i32 (...) @gmove_bca_2a3t_b2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_bca_1a2t_b2()
%2 = tail call i32 (...) @gmove_bca_1a2t_b()
%3 = tail call i32 (...) @gmove_bca_2a3t_b2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(unsigned int);
int /*<<< orphan*/ _FPU_SETCW(unsigned int);
unsigned int _controlfp(unsigned int val, unsigned int mask) {
  unsigned int ret;
  _FPU_GETCW(ret);
  if (mask) {
    ret &= ~mask;
    ret |= val;
    _FPU_SETCW(ret);
  }
  return ret;
}


x86 assembly (clang, -O0):
<_controlfp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
cmpl   $0x0,-0x8(%rbp)
je     115d <_controlfp+0x3d>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_controlfp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <_FPU_GETCW@plt>
test   %ebp,%ebp
je     1137 <_controlfp+0x17>
mov    %ebx,%edi
call   1040 <_FPU_SETCW@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_controlfp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @_FPU_GETCW(i32 %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i32, i32* %4
%12 = xor i32 %11, -1
%13 = load i32, i32* %5
%14 = and i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = or i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = call i32 @_FPU_SETCW(i32 %18)
br label %20
20: ; preds = %10, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @_controlfp(i32 returned %0, i32 %1) {
%3 = tail call i32 @_FPU_GETCW(i32 undef)
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @_FPU_SETCW(i32 %0)
br label %7
7: ; preds = %5, %2
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_swap16p(int /*<<< orphan*/ *, int /*<<< orphan*/);
void be16_to_cpup(uint16_t *outp, uint16_t in) { cpu_swap16p(outp, in); }


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

x86 assembly (clang, -O2):
<be16_to_cpup>:
jmp    1030 <cpu_swap16p@plt>

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

LLVM IR (-O2):
define void @be16_to_cpup(i32* %0, i32 %1) {
%3 = tail call i32 @cpu_swap16p(i32* %0, i32 %1)
ret void
}
void t(char *g, char *j) {
  g++;
  g++;
  g[2] = 'l';
  g[0] = g[2];
  j[0] = 'l';
  j++;
  j++;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x6c,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x6c,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
movb   $0x6c,0x4(%rdi)
movb   $0x6c,0x2(%rdi)
movb   $0x6c,(%rsi)
ret

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

LLVM IR (-O2):
define void @t(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = getelementptr inbounds i8, i8* %0, i64 4
store i8 108, i8* %4
store i8 108, i8* %3
store i8 108, i8* %1
ret void
}
char *GetTelnetPort() { return "2002"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"2002\00"
define i8* @GetTelnetPort() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "strace [options] <program> [program arguments]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"strace [options] <program> [program arguments]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"strace [options] <program> [program arguments]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int show_foo();
int main() { return show_foo(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @show_foo()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @show_foo()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear_term(void) {
  printf("\033[2J\033[H");
  return;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
define void @clear_term() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
define void @clear_term() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo_2_2_1_2_2_1_1_2_1() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_2_1_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void clr10(int *x) { memset(x, 0, 10); }


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

x86 assembly (clang, -O2):
<clr10>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clr10(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 10)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t WatchCurrentTimeStamp(void) { return 1000999; }


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

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

LLVM IR (-O0):
define i32 @WatchCurrentTimeStamp() {
ret i32 1000999
}

LLVM IR (-O2):
define i32 @WatchCurrentTimeStamp() {
ret i32 1000999
}
/* Type definitions */
struct jtrace_instance {
  int dummy;
};

/* Variables and functions */
struct jtrace_instance *jtrc_find_get_instance(char *);
struct jtrace_instance *jtrc_default_instance(void) {
  return jtrc_find_get_instance("jtrc_default");
}


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

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

LLVM IR (-O0):
%struct.jtrace_instance = type { i32 }
@.str = [13 x i8] c"jtrc_default\00"
define %struct.jtrace_instance* @jtrc_default_instance() {
%1 = call %struct.jtrace_instance* @jtrc_find_get_instance(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret %struct.jtrace_instance* %1
}

LLVM IR (-O2):
%struct.jtrace_instance = type { i32 }
@.str = [13 x i8] c"jtrc_default\00"
define %struct.jtrace_instance* @jtrc_default_instance() {
%1 = tail call %struct.jtrace_instance* @jtrc_find_get_instance(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret %struct.jtrace_instance* %1
}
/* Variables and functions */
int /*<<< orphan*/ show_notes_file();
void do_cmd_knowledge_notes(void) {
  show_notes_file();
  return;
}


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

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

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

LLVM IR (-O2):
define void @do_cmd_knowledge_notes() {
%1 = tail call i32 (...) @show_notes_file()
ret void
}
int bics_si_test1(int a, int b, int c) {
  int d = a & ~b;
  if (d == 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<bics_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1133 <bics_si_test1+0x33>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <bics_si_test1+0x3f>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test1>:
mov    %esi,%ecx
not    %ecx
and    %edi,%ecx
lea    (%rsi,%rcx,1),%eax
test   %ecx,%ecx
cmove  %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @bics_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %5, %1
%8 = select i1 %6, i32 %0, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int STC31xx_ReadByte8(int);
int STC31xx_AlarmGet(void) {
  int res;
  res = STC31xx_ReadByte8(0x01);
  res = res >> 5;
  return (res);
}


x86 assembly (clang, -O0):
<STC31xx_AlarmGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <STC31xx_ReadByte8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC31xx_AlarmGet>:
push   %rax
mov    $0x1,%edi
call   1030 <STC31xx_ReadByte8@plt>
sar    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC31xx_AlarmGet() {
%1 = alloca i32
%2 = call i32 @STC31xx_ReadByte8(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 5
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @STC31xx_AlarmGet() {
%1 = tail call i32 @STC31xx_ReadByte8(i32 1)
%2 = ashr i32 %1, 5
ret i32 %2
}
void RTSocketSgWriteLVNB(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSocketSgWriteLVNB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgbool();
int /*<<< orphan*/ commit();
int /*<<< orphan*/ gentext();
void genbool(void) {
  gentext();
  commit();
  cgbool();
}


x86 assembly (clang, -O0):
<genbool>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gentext@plt>
mov    $0x0,%al
call   1040 <commit@plt>
mov    $0x0,%al
call   1050 <cgbool@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genbool>:
push   %rax
xor    %eax,%eax
call   1030 <gentext@plt>
xor    %eax,%eax
call   1040 <commit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cgbool@plt>

LLVM IR (-O0):
define void @genbool() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @commit()
%3 = call i32 (...) @cgbool()
ret void
}

LLVM IR (-O2):
define void @genbool() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @commit()
%3 = tail call i32 (...) @cgbool()
ret void
}
int device_pm_pre_add(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @device_pm_pre_add(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGPDFOperatorTableRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGPDFOperatorTableRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGPDFOperatorTableRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double drho_dy(double L, double a_rhoy, double rho_y, double y) {
  return -M_PI * a_rhoy * rho_y * sin(M_PI * a_rhoy * y / L) / L;
}


x86 assembly (clang, -O0):
<drho_dy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e84(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drho_dy>:
sub    $0x28,%rsp
movapd %xmm0,%xmm4
movsd  %xmm0,0x8(%rsp)
mov    0x2ec3(%rip),%rax
movsd  (%rax),%xmm0
movapd 0xecf(%rip),%xmm5
xorpd  %xmm0,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm5,0x10(%rsp)
mulsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
divsd  %xmm4,%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @drho_dy(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = fneg double %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = load double, double* @M_PI
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %5
%21 = fdiv double %19, %20
%22 = call double @sin(double %21)
%23 = fmul double %14, %22
%24 = load double, double* %5
%25 = fdiv double %23, %24
ret double %25
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @drho_dy(double %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fneg double %5
%7 = fmul double %6, %1
%8 = fmul double %7, %2
%9 = fmul double %5, %1
%10 = fmul double %9, %3
%11 = fdiv double %10, %0
%12 = tail call double @sin(double %11)
%13 = fmul double %12, %8
%14 = fdiv double %13, %0
ret double %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void MPURegionDisable(uint32_t ui32Region) {
  ASSERT(ui32Region < 8);
  (*((volatile uint32_t *)(0xE000ED98))) = ui32Region;
  (*((volatile uint32_t *)(0xE000EDA0))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<MPURegionDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%ecx
mov    $0xe000ed98,%eax
mov    %ecx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0xe000eda0,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionDisable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x8,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0xe000eda0,%eax
mov    %ebx,-0x8(%rax)
andl   $0xfffffffe,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @MPURegionDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 8
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
store volatile i32 %7, i32* inttoptr (i64 3758157208 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 3758157216 to i32*)
%9 = and i32 %8, -2
store volatile i32 %9, i32* inttoptr (i64 3758157216 to i32*)
ret void
}

LLVM IR (-O2):
define void @MPURegionDisable(i32 %0) {
%2 = icmp slt i32 %0, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
store volatile i32 %0, i32* inttoptr (i64 3758157208 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 3758157216 to i32*)
%6 = and i32 %5, -2
store volatile i32 %6, i32* inttoptr (i64 3758157216 to i32*)
ret void
}