xunge/DecIR huggingface dataset:
int execute_fadvise64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_fadvise64() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int d;
  scanf("%d", &d);
  if (d > 0) {
    printf("2\n");
  } else if (d == 0) {
    printf("1\n");
  } else {
    printf("0\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
cmpl   $0x0,-0x8(%rbp)
jne    1175 <main+0x55>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <main+0x61>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xec7(%rip),%rax
lea    0xebe(%rip),%rcx
cmove  %rax,%rcx
lea    0xeb7(%rip),%rdi
cmovle %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [2 x i8] c"0\00"
@str.4 = [2 x i8] c"1\00"
@str.5 = [2 x i8] c"2\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 = icmp sgt i32 %4, 0
%6 = icmp eq i32 %4, 0
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
%8 = select i1 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), i8* %7
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
float pow(float, float);
float f(float t) {
  float const delta = 6.f / 29;
  float const delta_2 = delta * delta;
  float const delta_3 = delta * delta * delta;
  return t > (delta_3) ? pow(t, (float)(1.0 / 3.0))
                       : delta_2 * t / 3.0 + 4 / 29.0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec1(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeaf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    117a <f+0x6a>
movss  -0x4(%rbp),%xmm0
movss  0xea5(%rip),%xmm1
call   1030 <pow@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11a8 <f+0x98>
movss  0xe82(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe85(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe71(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
ucomiss 0xee8(%rip),%xmm0
jbe    112d <f+0x1d>
movss  0xee6(%rip),%xmm1
call   1030 <pow@plt>
cvtss2sd %xmm0,%xmm0
jmp    1149 <f+0x39>
mulss  0xecf(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xecf(%rip),%xmm0
addsd  0xecf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %2
store float 0x3FCA7B9620000000, float* %3
store float 0x3FA5EAB140000000, float* %4
store float 0x3F822354E0000000, float* %5
%6 = load float, float* %2
%7 = fcmp ogt float %6, 0x3F822354E0000000
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load float, float* %2
%10 = call float @pow(float %9, float 0x3FD5555560000000)
%11 = fpext float %10 to double
br label %18
12: ; preds = %1
%13 = load float, float* %2
%14 = fmul float 0x3FA5EAB140000000, %13
%15 = fpext float %14 to double
%16 = fdiv double %15, 3.000000e+00
%17 = fadd double %16, 0x3FC1A7B9611A7B96
br label %18
18: ; preds = %12, %8
%19 = phi double [ %11, %8 ], [ %17, %12 ]
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fcmp ogt float %0, 0x3F822354E0000000
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call float @pow(float %0, float 0x3FD5555560000000)
%5 = fpext float %4 to double
br label %11
6: ; preds = %1
%7 = fmul float %0, 0x3FA5EAB140000000
%8 = fpext float %7 to double
%9 = fdiv double %8, 3.000000e+00
%10 = fadd double %9, 0x3FC1A7B9611A7B96
br label %11
11: ; preds = %6, %3
%12 = phi double [ %5, %3 ], [ %10, %6 ]
%13 = fptrunc double %12 to float
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_ContentDirectory_GetSystemUpdateID(void *, int);
int /*<<< orphan*/ printf(char *);
void UpnpContentDirectory_GetSystemUpdateID(void *upnptoken) {
  printf("Invoke: UpnpContentDirectory_GetSystemUpdateID();\r\n");
  UpnpResponse_ContentDirectory_GetSystemUpdateID(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UpnpContentDirectory_GetSystemUpdateID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1040 <UpnpResponse_ContentDirectory_GetSystemUpdateID@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpContentDirectory_GetSystemUpdateID>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1040 <UpnpResponse_ContentDirectory_GetSystemUpdateID@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Invoke: UpnpContentDirectory_GetSystemUpdateID();\0D\0A\00"
define void @UpnpContentDirectory_GetSystemUpdateID(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_ContentDirectory_GetSystemUpdateID(i8* %4, i32 250)
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"Invoke: UpnpContentDirectory_GetSystemUpdateID();\0D\00"
define void @UpnpContentDirectory_GetSystemUpdateID(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_ContentDirectory_GetSystemUpdateID(i8* %0, i32 250)
ret void
}
int starttls_start(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @starttls_start() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  char *ptr = NULL;
  fprintf(stderr, "|0| everything looks fine. lets produce a SIGSEGV\n");
  *ptr = 1;
  fprintf(stderr, "|1| after first provocated SIGSEGV\n");
  *ptr = 1;
  fprintf(stderr, "|2| after second provocated SIGSEGV\n");
  fprintf(stderr, "|X| We survived - enough played today.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xef8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"|0| everything looks fine. lets produce a SIGSEGV\0A\00"
@.str.1 = [36 x i8] c"|1| after first provocated SIGSEGV\0A\00"
@.str.2 = [37 x i8] c"|2| after second provocated SIGSEGV\0A\00"
@.str.3 = [40 x i8] c"|X| We survived - enough played today.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
store i8 1, i8* %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %2
store i8 1, i8* %8
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"|0| everything looks fine. lets produce a SIGSEGV\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
void sig_hup(int signo) {
  printf("SIGHUP recived, pid = %ld\n", (long)getpid());
}


x86 assembly (clang, -O0):
<sig_hup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_hup>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"SIGHUP recived, pid = %ld\0A\00"
define void @sig_hup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"SIGHUP recived, pid = %ld\0A\00"
define void @sig_hup(i32 %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
short how_deep(char *);
int /*<<< orphan*/ printf(char *, short);
int main() {
  short signed int x = how_deep("welcome");
  printf("result: %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <how_deep@plt>
mov    %ax,-0x6(%rbp)
lea    0xec2(%rip),%rdi
movswl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <how_deep@plt>
movswl %ax,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"welcome\00"
@.str.1 = [12 x i8] c"result: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
%3 = call signext i16 @how_deep(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i16 %3, i16* %2
%4 = load i16, i16* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i16 signext %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"welcome\00"
@.str.1 = [12 x i8] c"result: %d\0A\00"
define i32 @main() {
%1 = tail call signext i16 @how_deep(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i16 signext %1)
ret i32 0
}
char *strcpy(char *dst, const char *src) {
  char *d = dst;
  while ((*dst++ = *src++) != 0)
    ;
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int, int,
                           int, int);
int /*<<< orphan*/ stderr;
void range_error(const char *file, int line, int low, int high, int actual) {
  fprintf(stderr, "%s:%d: Out of range [expected: %d..%d, got %d]\n", file,
          line, low, high, actual);
  exit(12);
}


x86 assembly (clang, -O0):
<range_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%eax
lea    0xea5(%rip),%rsi
mov    %eax,(%rsp)
call   1030 <fprintf@plt>
mov    $0xc,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<range_error>:
push   %rax
mov    %ecx,%r9d
mov    %edx,%eax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eae(%rip),%rsi
mov    (%rsi),%edi
mov    %r8d,(%rsp)
lea    0xec1(%rip),%rsi
mov    %eax,%r8d
call   1030 <fprintf@plt>
mov    $0xc,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"%s:%d: Out of range [expected: %d..%d, got %d]\0A\00"
define void @range_error(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i32 %14, i32 %15, i32 %16)
%18 = call i32 @exit(i32 12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"%s:%d: Out of range [expected: %d..%d, got %d]\0A\00"
define void @range_error(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = tail call i32 @exit(i32 12)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ grdfcn_(int *, double *, double *, int *);
void mgh_grdfcn(int n, const double *x, double *g, int nprob) {
  int _n = n, _nprob = nprob;
  assert(sizeof(double) == sizeof(*x));
  grdfcn_(&_n, (double *)x, (double *)g, &_nprob);
}


x86 assembly (clang, -O0):
<mgh_grdfcn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rcx
call   1040 <grdfcn_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgh_grdfcn>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
mov    %ecx,(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rcx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <grdfcn_@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mgh_grdfcn(i32 %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
store i32 %11, i32* %9
%12 = load i32, i32* %8
store i32 %12, i32* %10
%13 = call i32 @assert(i32 1)
%14 = load double*, double** %6
%15 = load double*, double** %7
%16 = call i32 @grdfcn_(i32* %9, double* %14, double* %15, i32* %10)
ret void
}

LLVM IR (-O2):
define void @mgh_grdfcn(i32 %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
store i32 %0, i32* %5
%8 = bitcast i32* %6 to i8*
store i32 %3, i32* %6
%9 = tail call i32 @assert(i32 1)
%10 = call i32 @grdfcn_(i32* %5, double* %1, double* %2, i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tlwr1043nd_init();
void board_init(void) { tlwr1043nd_init(); }


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

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

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

LLVM IR (-O2):
define void @board_init() {
%1 = tail call i32 (...) @tlwr1043nd_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCB_1_UartPostEnable();
void SCB_1_ScbModePostEnable(void) { SCB_1_UartPostEnable(); }


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

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

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

LLVM IR (-O2):
define void @SCB_1_ScbModePostEnable() {
%1 = tail call i32 (...) @SCB_1_UartPostEnable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ omp_set_dynamic(int /*<<< orphan*/);
int /*<<< orphan*/ omp_set_nested(int);
int /*<<< orphan*/ report_num_threads(int);
int main(int argc, char const *argv[]) {
  omp_set_dynamic(0);
  omp_set_nested(1);
#pragma omp parallel num_threads(2)
  {
    report_num_threads(1);
#pragma omp parallel num_threads(2)
    {
      report_num_threads(2);
#pragma omp parallel num_threads(2)
      { report_num_threads(3); }
    }
  }
  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)
xor    %edi,%edi
call   1030 <omp_set_dynamic@plt>
mov    $0x1,%edi
call   1040 <omp_set_nested@plt>
mov    $0x1,%edi
call   1050 <report_num_threads@plt>
mov    $0x2,%edi
call   1050 <report_num_threads@plt>
mov    $0x3,%edi
call   1050 <report_num_threads@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <omp_set_dynamic@plt>
mov    $0x1,%edi
call   1040 <omp_set_nested@plt>
mov    $0x1,%edi
call   1050 <report_num_threads@plt>
mov    $0x2,%edi
call   1050 <report_num_threads@plt>
mov    $0x3,%edi
call   1050 <report_num_threads@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @omp_set_dynamic(i32 0)
%7 = call i32 @omp_set_nested(i32 1)
%8 = call i32 @report_num_threads(i32 1)
%9 = call i32 @report_num_threads(i32 2)
%10 = call i32 @report_num_threads(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @omp_set_dynamic(i32 0)
%4 = tail call i32 @omp_set_nested(i32 1)
%5 = tail call i32 @report_num_threads(i32 1)
%6 = tail call i32 @report_num_threads(i32 2)
%7 = tail call i32 @report_num_threads(i32 3)
ret i32 0
}
double SFMSanitizeRadians(double r) {
  while (r < 0)
    r += (2 * 3.14159265);
  while (r >= (2 * 3.14159265))
    r -= (2 * 3.14159265);
  return (r);
}


x86 assembly (clang, -O0):
<SFMSanitizeRadians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112e <SFMSanitizeRadians+0x2e>
movsd  0xee1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1109 <SFMSanitizeRadians+0x9>
jmp    1133 <SFMSanitizeRadians+0x33>
movsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1165 <SFMSanitizeRadians+0x65>
movsd  -0x8(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1133 <SFMSanitizeRadians+0x33>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SFMSanitizeRadians>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    112a <SFMSanitizeRadians+0x2a>
movsd  0xeee(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1120 <SFMSanitizeRadians+0x20>
ucomisd 0xece(%rip),%xmm0
jb     115a <SFMSanitizeRadians+0x5a>
movsd  0xecc(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jae    1150 <SFMSanitizeRadians+0x50>
ret

LLVM IR (-O0):
define double @SFMSanitizeRadians(double %0) {
%2 = alloca double
store double %0, double* %2
br label %3
3: ; preds = %6, %1
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* %2
%8 = fadd double %7, 0x401921FB53C8D4F1
store double %8, double* %2
br label %3
9: ; preds = %3
br label %10
10: ; preds = %13, %9
%11 = load double, double* %2
%12 = fcmp oge double %11, 0x401921FB53C8D4F1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %2
%15 = fsub double %14, 0x401921FB53C8D4F1
store double %15, double* %2
br label %10
16: ; preds = %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @SFMSanitizeRadians(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi double [ %0, %1 ], [ %8, %6 ]
%5 = fcmp ult double %4, 0x401921FB53C8D4F1
br i1 %5, label %14, label %10
6: ; preds = %1, %6
%7 = phi double [ %8, %6 ], [ %0, %1 ]
%8 = fadd double %7, 0x401921FB53C8D4F1
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %6, label %3
10: ; preds = %3, %10
%11 = phi double [ %12, %10 ], [ %4, %3 ]
%12 = fadd double %11, 0xC01921FB53C8D4F1
%13 = fcmp ult double %12, 0x401921FB53C8D4F1
br i1 %13, label %14, label %10
14: ; preds = %10, %3
%15 = phi double [ %4, %3 ], [ %12, %10 ]
ret double %15
}
void init_sub_color_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_color_pt_funcs_c() {
ret void
}
/* Variables and functions */
scalar_t__ strcasestr(char const *, char const *);
scalar_t__ strstr(char const *, char const *);
int strstr_Wrapper(const char *haystack, const char *needle,
                   int intCaseSensitive) {
  if (intCaseSensitive)
    return (int)strstr(haystack, needle);
  else
    return (int)strcasestr(haystack, needle);
}


x86 assembly (clang, -O0):
<strstr_Wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <strstr_Wrapper+0x32>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <strstr_Wrapper+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasestr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr_Wrapper>:
push   %rax
test   %edx,%edx
je     112c <strstr_Wrapper+0xc>
call   1040 <strstr@plt>
pop    %rcx
ret
call   1030 <strcasestr@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @strstr_Wrapper(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i64 @strstr(i8* %0, i8* %1)
br label %9
7: ; preds = %3
%8 = tail call i64 @strcasestr(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i64 [ %6, %5 ], [ %8, %7 ]
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int errno;
void xcldir(DIR **d) {
  if (d && *d) {
    int errno_ = errno;
    (void)closedir(*d);
    errno = errno_;
  }
}


x86 assembly (clang, -O0):
<xcldir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <xcldir+0x49>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1159 <xcldir+0x49>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
mov    -0xc(%rbp),%ecx
mov    0x2e89(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcldir>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <xcldir+0x20>
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1130 <xcldir+0x20>
mov    0x2eb9(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <closedir@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @xcldir(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = icmp ne i32** %4, null
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* @errno
store i32 %11, i32* %3
%12 = load i32**, i32*** %2
%13 = load i32*, i32** %12
%14 = call i32 @closedir(i32* %13)
%15 = load i32, i32* %3
store i32 %15, i32* @errno
br label %16
16: ; preds = %10, %6, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @xcldir(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @closedir(i32* %4)
store i32 %7, i32* @errno
br label %9
9: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
char keyboard_getchar();
char getc() { return keyboard_getchar(); }


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

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

LLVM IR (-O0):
define signext i8 @getc() {
%1 = call signext i8 (...) @keyboard_getchar()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getc() {
%1 = tail call signext i8 (...) @keyboard_getchar()
ret i8 %1
}
void foo(float *output) { *output = 0.0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @foo(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
store float 0.000000e+00, float* %3
ret void
}

LLVM IR (-O2):
define void @foo(float* nocapture writeonly %0) {
store float 0.000000e+00, float* %0
ret void
}
void USBHostPwrFaultDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned short *)(ulBase + 0x00000400))) &= ~0x00000010;
}


x86 assembly (clang, -O0):
<USBHostPwrFaultDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%cx
movzwl %cx,%ecx
and    $0xffffffef,%ecx
mov    %cx,0x400(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrFaultDisable>:
andw   $0xffef,0x400(%rdi)
ef
ret

LLVM IR (-O0):
define void @USBHostPwrFaultDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1024
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
%7 = zext i16 %6 to i32
%8 = and i32 %7, -17
%9 = trunc i32 %8 to i16
store volatile i16 %9, i16* %5
ret void
}

LLVM IR (-O2):
define void @USBHostPwrFaultDisable(i64 %0) {
%2 = add i64 %0, 1024
%3 = inttoptr i64 %2 to i16*
%4 = load volatile i16, i16* %3
%5 = and i16 %4, -17
store volatile i16 %5, i16* %3
ret void
}
int test_imm_3Euint16_mem(unsigned short *val) {
  return ((*val) & (-0x3E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Euint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffc2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Euint16_mem>:
movzwl (%rdi),%eax
test   $0xffc2,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Euint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -62
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_3Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -62
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timespec {
  unsigned long long tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ get_time(struct timespec *);
uint64_t current_time_us(void) {
  struct timespec ts;
  get_time(&ts);
  return ts.tv_sec * 1000000ULL + ts.tv_nsec / 1000;
}


x86 assembly (clang, -O0):
<current_time_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <get_time@plt>
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time_us>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <get_time@plt>
imul   $0xf4240,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define i64 @current_time_us() {
%1 = alloca %struct.timespec
%2 = call i32 @get_time(%struct.timespec* %1)
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
define i64 @current_time_us() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @get_time(%struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add i64 %6, %10
ret i64 %11
}
void ELMModuleReset(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x10)))) = ((0x1u) << (0x00000001u));
}


x86 assembly (clang, -O0):
<ELMModuleReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ELMModuleReset>:
add    $0x10,%edi
movl   $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @ELMModuleReset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 2, i32* %6
ret void
}

LLVM IR (-O2):
define void @ELMModuleReset(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 2, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gdb2029();
int /*<<< orphan*/ optimized_1();
int main(void) {
  gdb2029();
  optimized_1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gdb2029()
%2 = tail call i32 (...) @optimized_1()
ret i32 0
}
/* Variables and functions */
int Lcallfunc(int /*<<< orphan*/);
int callfunc(int (*func)(int value), int value) {
  return Lcallfunc(0) * 0 + func(value) * 2;
}


x86 assembly (clang, -O0):
<callfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
call   1030 <Lcallfunc@plt>
imul   $0x0,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callfunc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
call   1030 <Lcallfunc@plt>
mov    %ebx,%edi
call   *%r14
add    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @callfunc(i32 (i32)* %0, i32 %1) {
%3 = alloca i32 (i32)*
%4 = alloca i32
store i32 (i32)* %0, i32 (i32)** %3
store i32 %1, i32* %4
%5 = call i32 @Lcallfunc(i32 0)
%6 = mul nsw i32 %5, 0
%7 = load i32 (i32)*, i32 (i32)** %3
%8 = load i32, i32* %4
%9 = call i32 %7(i32 %8)
%10 = mul nsw i32 %9, 2
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @callfunc(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 @Lcallfunc(i32 0)
%4 = tail call i32 %0(i32 %1)
%5 = shl nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GBA_CPUClearHalted();
int /*<<< orphan*/ GBA_Swi(int);
void GBA_Reset(void) {
  GBA_CPUClearHalted();
  GBA_Swi(0x26);
}


x86 assembly (clang, -O0):
<GBA_Reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GBA_CPUClearHalted@plt>
mov    $0x26,%edi
call   1030 <GBA_Swi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GBA_Reset>:
push   %rax
xor    %eax,%eax
call   1040 <GBA_CPUClearHalted@plt>
mov    $0x26,%edi
pop    %rax
jmp    1030 <GBA_Swi@plt>

LLVM IR (-O0):
define void @GBA_Reset() {
%1 = call i32 (...) @GBA_CPUClearHalted()
%2 = call i32 @GBA_Swi(i32 38)
ret void
}

LLVM IR (-O2):
define void @GBA_Reset() {
%1 = tail call i32 (...) @GBA_CPUClearHalted()
%2 = tail call i32 @GBA_Swi(i32 38)
ret void
}
int x32_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x32_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TinySOCK();
int main(int argc, char *argv[]) {
  TinySOCK();
  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)
mov    $0x0,%al
call   1030 <TinySOCK@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @TinySOCK()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TinySOCK()
ret i32 0
}
/* Variables and functions */
scalar_t__ err(char *, int /*<<< orphan*/, char const *);
int /*<<< orphan*/ errno;
scalar_t__ putenv(char *);
bool put_env(const char *var) {
  return putenv((char *)var) == 0 ||
         err("failed to modify environment", errno, var);
}


x86 assembly (clang, -O0):
<put_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <putenv@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     116a <put_env+0x4a>
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rdi
call   1040 <err@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_env>:
push   %rbx
mov    %rdi,%rbx
call   1030 <putenv@plt>
test   %rax,%rax
je     1153 <put_env+0x33>
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
mov    %rbx,%rdx
call   1040 <err@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"failed to modify environment\00"
@errno = global i32 0
define i32 @put_env(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @putenv(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = load i8*, i8** %2
%9 = call i64 @err(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [29 x i8] c"failed to modify environment\00"
@errno = global i32 0
define i32 @put_env(i8* %0) {
%2 = tail call i64 @putenv(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i64 @err(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %10
}
unsigned long int __lshrsi3(unsigned long int a, short int b) {
  while (b--)
    a >>= 1;
  return a;
}


x86 assembly (clang, -O0):
<__lshrsi3>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0xa(%rbp)
cmp    $0x0,%ax
je     1139 <__lshrsi3+0x39>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <__lshrsi3+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lshrsi3>:
mov    %rdi,%rax
test   %si,%si
je     114a <__lshrsi3+0x4a>
lea    -0x1(%rsi),%ecx
mov    %esi,%edi
and    $0x7,%di
je     112d <__lshrsi3+0x2d>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
shr    %rax
add    $0x1,%edx
cmp    %dx,%di
jne    1120 <__lshrsi3+0x20>
sub    %edx,%esi
cmp    $0x7,%cx
jb     114a <__lshrsi3+0x4a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
shr    $0x8,%rax
add    $0xfff8,%si
jne    1140 <__lshrsi3+0x40>
ret

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

LLVM IR (-O2):
define i64 @__lshrsi3(i64 %0, i16 signext %1) {
%3 = icmp eq i16 %1, 0
br i1 %3, label %27, label %4
4: ; preds = %2
%5 = add i16 %1, -1
%6 = and i16 %1, 7
%7 = icmp eq i16 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %4, %8
%9 = phi i16 [ %12, %8 ], [ %1, %4 ]
%10 = phi i64 [ %13, %8 ], [ %0, %4 ]
%11 = phi i16 [ %14, %8 ], [ 0, %4 ]
%12 = add i16 %9, -1
%13 = lshr i64 %10, 1
%14 = add i16 %11, 1
%15 = icmp eq i16 %14, %6
br i1 %15, label %16, label %8
16: ; preds = %8, %4
%17 = phi i64 [ undef, %4 ], [ %13, %8 ]
%18 = phi i16 [ %1, %4 ], [ %12, %8 ]
%19 = phi i64 [ %0, %4 ], [ %13, %8 ]
%20 = icmp ult i16 %5, 7
br i1 %20, label %27, label %21
21: ; preds = %16, %21
%22 = phi i16 [ %25, %21 ], [ %18, %16 ]
%23 = phi i64 [ %24, %21 ], [ %19, %16 ]
%24 = lshr i64 %23, 8
%25 = add i16 %22, -8
%26 = icmp eq i16 %25, 0
br i1 %26, label %27, label %21
27: ; preds = %16, %21, %2
%28 = phi i64 [ %0, %2 ], [ %17, %16 ], [ %24, %21 ]
ret i64 %28
}
double feetToMiles(double feet) { return feet / 5280.0; }


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

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

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

LLVM IR (-O2):
define double @feetToMiles(double %0) {
%2 = fdiv double %0, 5.280000e+03
ret double %2
}
/* Variables and functions */
char *event_api_name();
char *get_event_api_name(void) { return event_api_name(); }


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

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

LLVM IR (-O0):
define i8* @get_event_api_name() {
%1 = call i8* (...) @event_api_name()
ret i8* %1
}

LLVM IR (-O2):
define i8* @get_event_api_name() {
%1 = tail call i8* (...) @event_api_name()
ret i8* %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XRectangle;

/* Variables and functions */
short get_XRectangle_x(void *_p) { return (short)((XRectangle *)_p)->x; }


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

x86 assembly (clang, -O2):
<get_XRectangle_x>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define signext i16 @get_XRectangle_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ Cbuf_Execute();
int /*<<< orphan*/ Client_Frame(int);
void common_Frame(int msec) {
  Cbuf_Execute();
  Client_Frame(msec);
}


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

x86 assembly (clang, -O2):
<common_Frame>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Cbuf_Execute@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <Client_Frame@plt>

LLVM IR (-O0):
define void @common_Frame(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Cbuf_Execute()
%4 = load i32, i32* %2
%5 = call i32 @Client_Frame(i32 %4)
ret void
}

LLVM IR (-O2):
define void @common_Frame(i32 %0) {
%2 = tail call i32 (...) @Cbuf_Execute()
%3 = tail call i32 @Client_Frame(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_atexit_fun1(void) { printf("I am in my_atexit_fun1\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"I am in my_atexit_fun1\00"
define void @my_atexit_fun1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
void GB_PPUEnd(void) {}


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

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

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

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