xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
void error_func(const char *file, int line, const char *msg) {
  fprintf(stderr, "error: %s (%s:%d)\n", msg, file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<error_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_func>:
push   %rax
mov    %esi,%r8d
mov    %rdi,%rcx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"error: %s (%s:%d)\0A\00"
define void @error_func(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"error: %s (%s:%d)\0A\00"
define void @error_func(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fork();
void test(void) { fork(); }


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

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

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @fork()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int s_ismsg(mode_t mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @s_ismsg(i32 %0) {
ret i32 -1
}
void type_cast(int s_type, int d_type, char *s_val, char *d_val) {
  switch (s_type) {
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
    break;
  case 7:
    break;
  case 8:
  case 9:
  case 10:
  case 11:
  case 12:
  case 13:
  case 14:
  case 15:
  case 16:
  case 17:
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<type_cast>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
add    $0xffffffff,%eax
sub    $0x6,%eax
jb     114e <type_cast+0x4e>
jmp    1129 <type_cast+0x29>
mov    -0x1c(%rbp),%eax
sub    $0x7,%eax
je     1153 <type_cast+0x53>
jmp    113a <type_cast+0x3a>
mov    -0x1c(%rbp),%eax
add    $0xfffffff8,%eax
sub    $0xa,%eax
jb     1158 <type_cast+0x58>
jmp    115d <type_cast+0x5d>
jmp    1162 <type_cast+0x62>
jmp    1162 <type_cast+0x62>
jmp    115d <type_cast+0x5d>
jmp    1162 <type_cast+0x62>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @type_cast(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
switch i32 %9, label %13 [
i32 1, label %10
i32 2, label %10
i32 3, label %10
i32 4, label %10
i32 5, label %10
i32 6, label %10
i32 7, label %11
i32 8, label %12
i32 9, label %12
i32 10, label %12
i32 11, label %12
i32 12, label %12
i32 13, label %12
i32 14, label %12
i32 15, label %12
i32 16, label %12
i32 17, label %12
]
10: ; preds = %4, %4, %4, %4, %4, %4
br label %14
11: ; preds = %4
br label %14
12: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %4, %4
br label %13
13: ; preds = %4, %12
br label %14
14: ; preds = %13, %11, %10
ret void
}

LLVM IR (-O2):
define void @type_cast(i32 %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
void ys_lowcase(char *s) {
  if (!s)
    return;
  for (; *s; ++s)
    if (*s >= 'A' && *s <= 'Z')
      *s = 'a' + (*s - 'A');
}


x86 assembly (clang, -O0):
<ys_lowcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <ys_lowcase+0x18>
jmp    1175 <ys_lowcase+0x75>
jmp    111d <ys_lowcase+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <ys_lowcase+0x75>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     115f <ys_lowcase+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     115f <ys_lowcase+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1164 <ys_lowcase+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <ys_lowcase+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ys_lowcase>:
test   %rdi,%rdi
je     113a <ys_lowcase+0x3a>
mov    (%rdi),%al
test   %al,%al
je     113a <ys_lowcase+0x3a>
add    $0x1,%rdi
jmp    112b <ys_lowcase+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     113a <ys_lowcase+0x3a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1120 <ys_lowcase+0x20>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1120 <ys_lowcase+0x20>
ret

LLVM IR (-O0):
define void @ys_lowcase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %33
6: ; preds = %1
br label %7
7: ; preds = %30, %6
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %33
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %29
16: ; preds = %11
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
br i1 %20, label %21, label %29
21: ; preds = %16
%22 = load i8*, i8** %2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 65
%26 = add nsw i32 97, %25
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %2
store i8 %27, i8* %28
br label %29
29: ; preds = %21, %16, %11
br label %30
30: ; preds = %29
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %2
br label %7
33: ; preds = %5, %7
ret void
}

LLVM IR (-O2):
define void @ys_lowcase(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %13
%7 = phi i8 [ %15, %13 ], [ %4, %3 ]
%8 = phi i8* [ %14, %13 ], [ %0, %3 ]
%9 = add i8 %7, -65
%10 = icmp ult i8 %9, 26
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = add nuw nsw i8 %7, 32
store i8 %12, i8* %8
br label %13
13: ; preds = %6, %11
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %13, %3, %1
ret void
}
/* Variables and functions */
int get_key_num();
int make_key(void) {
  int ret = get_key_num();
  return (ret);
}


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

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

LLVM IR (-O0):
define i32 @make_key() {
%1 = alloca i32
%2 = call i32 (...) @get_key_num()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @make_key() {
%1 = tail call i32 (...) @get_key_num()
ret i32 %1
}
/* Variables and functions */
double sin(double);
double geom_J2_sph_tpr(double x[], int dir) {
  if (dir == 0)
    return sin(x[0]);
  else if (dir == 1)
    return 1.0;
  return 0.0;
}


x86 assembly (clang, -O0):
<geom_J2_sph_tpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1140 <geom_J2_sph_tpr+0x30>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1169 <geom_J2_sph_tpr+0x59>
cmpl   $0x1,-0x14(%rbp)
jne    115c <geom_J2_sph_tpr+0x4c>
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1169 <geom_J2_sph_tpr+0x59>
jmp    1161 <geom_J2_sph_tpr+0x51>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_J2_sph_tpr>:
cmp    $0x1,%esi
je     1122 <geom_J2_sph_tpr+0x12>
test   %esi,%esi
jne    112b <geom_J2_sph_tpr+0x1b>
movsd  (%rdi),%xmm0
jmp    1030 <sin@plt>
movsd  0xed6(%rip),%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @geom_J2_sph_tpr(double* %0, i32 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @sin(double %11)
store double %12, double* %3
br label %19
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
store double 1.000000e+00, double* %3
br label %19
17: ; preds = %13
br label %18
18: ; preds = %17
store double 0.000000e+00, double* %3
br label %19
19: ; preds = %18, %16, %8
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @geom_J2_sph_tpr(double* nocapture %0, i32 %1) {
switch i32 %1, label %6 [
i32 0, label %3
i32 1, label %7
]
3: ; preds = %2
%4 = load double, double* %0
%5 = tail call double @sin(double %4)
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %6, %3
%8 = phi double [ %5, %3 ], [ 0.000000e+00, %6 ], [ 1.000000e+00, %2 ]
ret double %8
}
int fun1256() { return 1256; }


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

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

LLVM IR (-O0):
define i32 @fun1256() {
ret i32 1256
}

LLVM IR (-O2):
define i32 @fun1256() {
ret i32 1256
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double nowsecs() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return (double)now.tv_sec + now.tv_usec / 1e6;
}


x86 assembly (clang, -O0):
<nowsecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowsecs>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdl 0x8(%rsp),%xmm0
divsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @nowsecs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @nowsecs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
int output_frames_src_8_to_48(int input_frames) {
  if (input_frames > 160)
    return -1;
  return 6 * input_frames;
}


x86 assembly (clang, -O0):
<output_frames_src_8_to_48>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa0,-0x8(%rbp)
jle    1120 <output_frames_src_8_to_48+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    1127 <output_frames_src_8_to_48+0x27>
imul   $0x6,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_frames_src_8_to_48>:
lea    (%rdi,%rdi,1),%eax
cmp    $0xa1,%edi
lea    (%rax,%rax,2),%ecx
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @output_frames_src_8_to_48(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 160
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = mul nsw i32 6, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @output_frames_src_8_to_48(i32 %0) {
%2 = icmp sgt i32 %0, 160
%3 = mul nsw i32 %0, 6
%4 = select i1 %2, i32 -1, i32 %3
ret i32 %4
}
/* Variables and functions */
void *memcpy(void *, void const *, unsigned int);
void *av_memcpy(void *dest, const void *src, unsigned int size) {
  { return memcpy(dest, src, size); }
}


x86 assembly (clang, -O0):
<av_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @av_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @memcpy(i8* %7, i8* %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @av_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @memcpy(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "Usage: %s PATH PORT on|off\n", progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s PATH PORT on|off\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s PATH PORT on|off\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int libmesh_C_isnan_double(double a) {
  printf("libmesh_C_isnan_double is deprecated and should not be used!\n");
  return (a != a);
}


x86 assembly (clang, -O0):
<libmesh_C_isnan_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libmesh_C_isnan_double>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm0
ucomisd %xmm0,%xmm0
setp   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"libmesh_C_isnan_double is deprecated and should not be used!\0A\00"
define i32 @libmesh_C_isnan_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fcmp une double %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@str = [61 x i8] c"libmesh_C_isnan_double is deprecated and should not be used!\00"
define i32 @libmesh_C_isnan_double(double %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = fcmp uno double %0, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("Such a small bed.", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Such a small bed.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Such a small bed.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
scalar_t__ geteuid();
int main(void) { return geteuid() ? 1 : 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(void) { f(8); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 8)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
unsigned long get_XReparentEvent_window(void *_p) {
  return (unsigned long)((XReparentEvent *)_p)->window;
}


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

x86 assembly (clang, -O2):
<get_XReparentEvent_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XReparentEvent_window(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
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XReparentEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strupr(char *);
main() {
  char str[500];
  printf("enter ur string :");
  gets(str);
  strupr(str);
  printf("\nur string in upper case :");
  puts(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    -0x200(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x200(%rbp),%rdi
call   1060 <strupr@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x200(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1060 <strupr@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"enter ur string :\00"
@.str.1 = [27 x i8] c"\0Aur string in upper case :\00"
define i32 @main() {
%1 = alloca [500 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%6 = call i32 @strupr(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"enter ur string :\00"
@.str.1 = [27 x i8] c"\0Aur string in upper case :\00"
define i32 @main() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @strupr(i8* %2)
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ asprintf(char **, char *, char const *);
int error_unknown_option(const char *__restrict o, char **msg) {
  if (msg)
    asprintf(msg, "unknown option \"%s\"", o);
  return -EINVAL;
}


x86 assembly (clang, -O0):
<error_unknown_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113f <error_unknown_option+0x2f>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec6(%rip),%rsi
call   1030 <asprintf@plt>
xor    %eax,%eax
mov    0x2e98(%rip),%rcx
sub    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_unknown_option>:
push   %rax
test   %rsi,%rsi
je     112b <error_unknown_option+0x1b>
mov    %rdi,%rdx
lea    0xee0(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <asprintf@plt>
mov    0x2eae(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"unknown option \22%s\22\00"
@EINVAL = global i32 0
define i32 @error_unknown_option(i8* noalias %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %3
%10 = call i32 @asprintf(i8** %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* @EINVAL
%13 = sub nsw i32 0, %12
ret i32 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"unknown option \22%s\22\00"
@EINVAL = global i32 0
define i32 @error_unknown_option(i8* noalias %0, i8** %1) {
%3 = icmp eq i8** %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %2
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcpy(char *, char *);
char *xmalloc(unsigned int);
char *dodate(time_t tloc) {
  char *tp;
  char *p;
  tp = ctime(&tloc);
  tp[24] = 0;
  p = xmalloc((unsigned)25);
  (void)strcpy(p, tp);
  return (p);
}


x86 assembly (clang, -O0):
<dodate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,0x18(%rax)
mov    $0x19,%edi
call   1050 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dodate>:
push   %r14
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <ctime@plt>
mov    %rax,%r14
movb   $0x0,0x18(%rax)
mov    $0x19,%edi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dodate(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
%5 = call i8* @ctime(i32* %2)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 24
store i8 0, i8* %7
%8 = call i8* @xmalloc(i32 25)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define i8* @dodate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @ctime(i32* %2)
%4 = getelementptr inbounds i8, i8* %3, i64 24
store i8 0, i8* %4
%5 = call i8* @xmalloc(i32 25)
%6 = call i32 @strcpy(i8* %5, i8* %3)
ret i8* %5
}
int test_imm_84int32_reg(int val) { return ((val) & (0x84 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_84int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x84,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_84int32_reg>:
test   $0x84,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_84int32_reg(i32 %0) {
%2 = and i32 %0, 132
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int position_char(char s[], char c, int tam) {
  int i, pos = -1;
  for (i = 0; i < tam; i++) {
    if (s[i] == c) {
      pos = i;
      break;
    }
  }
  return pos;
}


x86 assembly (clang, -O0):
<position_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1161 <position_char+0x61>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <position_char+0x4e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1161 <position_char+0x61>
jmp    1153 <position_char+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <position_char+0x1f>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<position_char>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111f <position_char+0x1f>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,(%rdi,%rcx,1)
je     1120 <position_char+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <position_char+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @position_char(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
store i32 -1, i32* %8
store i32 0, i32* %7
br label %9
9: ; preds = %26, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %25
23: ; preds = %13
%24 = load i32, i32* %7
store i32 %24, i32* %8
br label %29
25: ; preds = %13
br label %26
26: ; preds = %25
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %9
29: ; preds = %23, %9
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @position_char(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
unsigned char io_in8(int);
int /*<<< orphan*/ io_out8(int, unsigned char);
unsigned char read_cmos(unsigned char addr) {
  io_out8(0x70, addr);
  return io_in8(0x71);
}


x86 assembly (clang, -O0):
<read_cmos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x70,%edi
movzbl -0x1(%rbp),%esi
call   1030 <io_out8@plt>
mov    $0x71,%edi
call   1040 <io_in8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cmos>:
push   %rax
mov    %edi,%esi
mov    $0x70,%edi
call   1030 <io_out8@plt>
mov    $0x71,%edi
pop    %rax
jmp    1040 <io_in8@plt>

LLVM IR (-O0):
define zeroext i8 @read_cmos(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @io_out8(i32 112, i8 zeroext %3)
%5 = call zeroext i8 @io_in8(i32 113)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @read_cmos(i8 zeroext %0) {
%2 = tail call i32 @io_out8(i32 112, i8 zeroext %0)
%3 = tail call zeroext i8 @io_in8(i32 113)
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ A2;
typedef int /*<<< orphan*/ A1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void nest1() {
  int A1[3];
  int *A2;
  printf("A1 -> %d\n", sizeof(A1));
  printf("A2 -> %d\n", sizeof(A2));
  printf("*A1 -> %d\n", sizeof(*A1));
  printf("*A2 -> %d\n", sizeof(*A2));
}


x86 assembly (clang, -O0):
<nest1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee2(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nest1>:
push   %rax
lea    0xee9(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x4,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"A1 -> %d\0A\00"
@.str.1 = [10 x i8] c"A2 -> %d\0A\00"
@.str.2 = [11 x i8] c"*A1 -> %d\0A\00"
@.str.3 = [11 x i8] c"*A2 -> %d\0A\00"
define void @nest1() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"A1 -> %d\0A\00"
@.str.1 = [10 x i8] c"A2 -> %d\0A\00"
@.str.2 = [11 x i8] c"*A1 -> %d\0A\00"
@.str.3 = [11 x i8] c"*A2 -> %d\0A\00"
define void @nest1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void flash_write8(uint32_t addr, uint8_t byte) {
  *(volatile uint8_t *)(const uint8_t *)(addr) = byte;
}


x86 assembly (clang, -O0):
<flash_write8>:
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):
<flash_write8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @flash_write8(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @flash_write8(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
void fz_nullendmask(void *user) {}


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

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

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

LLVM IR (-O2):
define void @fz_nullendmask(i8* nocapture %0) {
ret void
}
__typeof__(vprintf(1, 1)) test_vprintf_259(void) { return vprintf(1, 1); }


x86 assembly (clang, -O0):
<test_vprintf_259>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <vprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vprintf_259>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @test_vprintf_259() {
%1 = call i32 @vprintf(i8* inttoptr (i64 1 to i8*), %struct.__va_list_tag* inttoptr (i64 1 to %struct.__va_list_tag*))
ret i32 %1
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @test_vprintf_259() {
%1 = tail call i32 @vprintf(i8* inttoptr (i64 1 to i8*), %struct.__va_list_tag* inttoptr (i64 1 to %struct.__va_list_tag*))
ret i32 %1
}
void ClasstInitialize() {}


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

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

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

LLVM IR (-O2):
define void @ClasstInitialize() {
ret void
}
int os_binhex(struct part *inpart, int part, int nparts) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.part = type opaque
define i32 @os_binhex(%struct.part* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
int ap_base64encode_binary(char *, unsigned char const *, int);
int ap_base64encode(char *encoded, const char *string, int len) {
  return ap_base64encode_binary(encoded, (const unsigned char *)string, len);
}


x86 assembly (clang, -O0):
<ap_base64encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ap_base64encode_binary@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_base64encode>:
jmp    1030 <ap_base64encode_binary@plt>

LLVM IR (-O0):
define i32 @ap_base64encode(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @ap_base64encode_binary(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ap_base64encode(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ap_base64encode_binary(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
int test_imm_80int16_mem(short *val) {
  return ((*val) & (-0x80 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_80int16_mem>:
movzwl (%rdi),%eax
cmp    $0x80,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_80int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -128
%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_80int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 128
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ set_last_error(char *, char const *, char *);
int /*<<< orphan*/ strerror_r(int, char *, int);
void set_last_error_errno(int err, const char *msg) {
  char buf[64];
  strerror_r(err, buf, sizeof(buf));
  set_last_error("%s: %s", msg, buf);
}


x86 assembly (clang, -O0):
<set_last_error_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x40,%edx
call   1040 <strerror_r@plt>
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <set_last_error@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_last_error_errno>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x40,%edx
call   1040 <strerror_r@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <set_last_error@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
define void @set_last_error_errno(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = call i32 @strerror_r(i32 %6, i8* %7, i32 64)
%9 = load i8*, i8** %4
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @set_last_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
define void @set_last_error_errno(i32 %0, i8* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @strerror_r(i32 %0, i8* %4, i32 64)
%6 = call i32 @set_last_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
ret void
}
void memleak_free(const void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @memleak_free(i8* nocapture %0) {
ret void
}
double calcRectArea(float length, float height) { return length * height; }


x86 assembly (clang, -O0):
<calcRectArea>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcRectArea>:
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @calcRectArea(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
%8 = fpext float %7 to double
ret double %8
}

LLVM IR (-O2):
define double @calcRectArea(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fpext float %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SAR_W_IMM(int reg, int count) {
  addbyte(0x66);
  addbyte(0xc1);
  addbyte(0xc0 | reg | 0x38);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SAR_W_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x38,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAR_W_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
or     $0xf8,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SAR_W_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 193)
%7 = load i32, i32* %3
%8 = or i32 192, %7
%9 = or i32 %8, 56
%10 = call i32 @addbyte(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @addbyte(i32 %11)
ret void
}

LLVM IR (-O2):
define void @SAR_W_IMM(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 193)
%5 = or i32 %0, 248
%6 = tail call i32 @addbyte(i32 %5)
%7 = tail call i32 @addbyte(i32 %1)
ret void
}
memshift(p) unsigned *p;
{
  unsigned x;
  for (;;) {
    x = *p++ >> 16;
    if (x)
      return x;
  }
}


x86 assembly (clang, -O0):
<memshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
shr    $0x10,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112e <memshift+0x2e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    1108 <memshift+0x8>

x86 assembly (clang, -O2):
<memshift>:
mov    (%rdi),%eax
add    $0x4,%rdi
cmp    $0x10000,%eax
jb     1100 <memshift>
shr    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @memshift(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 65536
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = lshr i32 %5, 16
ret i32 %8
}
int lowLevel_add(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @lowLevel_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @lowLevel_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int fun1194() { return 1194; }


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

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

LLVM IR (-O0):
define i32 @fun1194() {
ret i32 1194
}

LLVM IR (-O2):
define i32 @fun1194() {
ret i32 1194
}
void DoubleLoop() {
  while (1) {
    while (1) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<DoubleLoop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <DoubleLoop+0x9>
jmp    110e <DoubleLoop+0xe>
jmp    1113 <DoubleLoop+0x13>
jmp    1109 <DoubleLoop+0x9>

x86 assembly (clang, -O2):
<DoubleLoop>:
jmp    1100 <DoubleLoop>

LLVM IR (-O0):
define void @DoubleLoop() {
br label %1
1: ; preds = %0, %3
br label %2
2: ; preds = %1
br label %3
3: ; preds = %2
br label %1
}

LLVM IR (-O2):
define void @DoubleLoop() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_8(void) { printf("%d\n", sizeof("hello")); }


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

x86 assembly (clang, -O2):
<test_8>:
lea    0xee9(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @test_8() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
int get_fp_status_ctl(void) {
  int fpstat = 0;
  __asm__ volatile("stmxcsr %0" : "=m"(fpstat));
  return (fpstat);
}


x86 assembly (clang, -O0):
<get_fp_status_ctl>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
stmxcsr -0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fp_status_ctl>:
movl   $0x0,-0x4(%rsp)
stmxcsr -0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @get_fp_status_ctl() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}