xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXPECT_NEAR(float, float, float);
void ExpectFloatNearEst(float _a, float _b) { EXPECT_NEAR(_a, _b, 1e-3f); }


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

x86 assembly (clang, -O2):
<ExpectFloatNearEst>:
movss  0xee8(%rip),%xmm2
jmp    1030 <EXPECT_NEAR@plt>

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

LLVM IR (-O2):
define void @ExpectFloatNearEst(float %0, float %1) {
%3 = tail call i32 @EXPECT_NEAR(float %0, float %1, float 0x3F50624DE0000000)
ret void
}
/* Variables and functions */
int EILSEQ;
int scalanative_eilseq() { return EILSEQ; }


x86 assembly (clang, -O0):
<scalanative_eilseq>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_eilseq>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EILSEQ = global i32 0
define i32 @scalanative_eilseq() {
%1 = load i32, i32* @EILSEQ
ret i32 %1
}

LLVM IR (-O2):
@EILSEQ = global i32 0
define i32 @scalanative_eilseq() {
%1 = load i32, i32* @EILSEQ
ret i32 %1
}
/* Variables and functions */
float M_PI;
float tan(float);
float compute_focal_length(float image_plane_ratio, float fov_angle) {
  float tan_of_halfangle = tan((M_PI * fov_angle) / (180 * 2));
  float focal_length = image_plane_ratio / (2 * tan_of_halfangle);
  return focal_length;
}


x86 assembly (clang, -O0):
<compute_focal_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    0x2ebf(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeca(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <tan@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_focal_length>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    0x2eca(%rip),%rax
mulss  (%rax),%xmm1
divss  0xed6(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <tan@plt>
addss  %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @compute_focal_length(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* @M_PI
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fdiv float %9, 3.600000e+02
%11 = call float @tan(float %10)
store float %11, float* %5
%12 = load float, float* %3
%13 = load float, float* %5
%14 = fmul float 2.000000e+00, %13
%15 = fdiv float %12, %14
store float %15, float* %6
%16 = load float, float* %6
ret float %16
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @compute_focal_length(float %0, float %1) {
%3 = load float, float* @M_PI
%4 = fmul float %3, %1
%5 = fdiv float %4, 3.600000e+02
%6 = tail call float @tan(float %5)
%7 = fmul float %6, 2.000000e+00
%8 = fdiv float %0, %7
ret float %8
}
void fantasia_usa_bot(int num) { (void)num; }


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

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

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

LLVM IR (-O2):
define void @fantasia_usa_bot(i32 %0) {
ret void
}
int fib(int num) {
  if (num == 0 || num == 1) {
    return num;
  } else
    return (fib(num - 1) + fib(num - 2));
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <fib+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113a <fib+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <fib+0x4d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fib+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fib+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void yy_fatal_error(const char *msg) {
  (void)fprintf(stderr, "%s\n", msg);
  exit(2);
}


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

x86 assembly (clang, -O2):
<yy_fatal_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yy_fatal_error(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yy_fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f(int, char const **);
main() {
  const char *ps[3];
  ps[0] = "hi";
  ps[1] = "there";
  ps[2] = 0;
  f(2, ps);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x2,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
lea    0xedd(%rip),%rax
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"hi\00"
@.str.1 = [6 x i8] c"there\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 2
store i8* null, i8** %5
%6 = call i32 @f(i32 2, i8** %3)
ret i32 0
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
struct Cyc_List_List *Cyc_RemoveAggrs_remove_aggrs(struct Cyc_List_List *);
struct Cyc_List_List *Cyc_do_removeaggrs(int ignore,
                                         struct Cyc_List_List *tds) {
  struct Cyc_List_List *_T0;
  _T0 = Cyc_RemoveAggrs_remove_aggrs(tds);
  return _T0;
}


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

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

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_removeaggrs(i32 %0, %struct.Cyc_List_List* %1) {
%3 = alloca i32
%4 = alloca %struct.Cyc_List_List*
%5 = alloca %struct.Cyc_List_List*
store i32 %0, i32* %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%7 = call %struct.Cyc_List_List* @Cyc_RemoveAggrs_remove_aggrs(%struct.Cyc_List_List* %6)
store %struct.Cyc_List_List* %7, %struct.Cyc_List_List** %5
%8 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
ret %struct.Cyc_List_List* %8
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_removeaggrs(i32 %0, %struct.Cyc_List_List* %1) {
%3 = tail call %struct.Cyc_List_List* @Cyc_RemoveAggrs_remove_aggrs(%struct.Cyc_List_List* %1)
ret %struct.Cyc_List_List* %3
}
int dnk_size() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dnk_size() {
ret i32 0
}
/* Variables and functions */
scalar_t__ atan2(float, float);
float atan2f(float y, float x) { return (float)atan2(y, x); }


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

x86 assembly (clang, -O2):
<atan2f>:
push   %rax
call   1030 <atan2@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atan2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @atan2(float %5, float %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @atan2f(float %0, float %1) {
%3 = tail call i64 @atan2(float %0, float %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_error_setf(void *e, const char *name, const char *format, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_error_setf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_error_setf>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_error_setf(i8* %0, i8* %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_error_setf(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, ...) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int notnum(string) const char *string;
{
  if (isnum(string))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<notnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <isnum@plt>
cmp    $0x0,%eax
je     113c <notnum+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <notnum+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @notnum(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @isnum to i32 (i8*, ...)*)(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @notnum(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @isnum to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug_print(int, char *, double, int);
int parse_regex_ghetto_trunc(double d) {
  debug_print(8, "parse_regex_ghetto_trunc: %f becomes %d", d, (int)d);
  return ((int)d);
}


x86 assembly (clang, -O0):
<parse_regex_ghetto_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%edx
mov    $0x8,%edi
lea    0xecd(%rip),%rsi
call   1030 <debug_print@plt>
cvttsd2si -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_regex_ghetto_trunc>:
push   %rbx
cvttsd2si %xmm0,%ebx
lea    0xee4(%rip),%rsi
mov    $0x8,%edi
mov    %ebx,%edx
call   1030 <debug_print@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"parse_regex_ghetto_trunc: %f becomes %d\00"
define i32 @parse_regex_ghetto_trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = call i32 @debug_print(i32 8, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double %3, i32 %5)
%7 = load double, double* %2
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [40 x i8] c"parse_regex_ghetto_trunc: %f becomes %d\00"
define i32 @parse_regex_ghetto_trunc(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call i32 @debug_print(i32 8, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double %0, i32 %2)
ret i32 %2
}
void INT_Excep_USBA_USBAR(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_USBA_USBAR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BrushlessGimbalSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void BrushlessGimbalSettingsRequestUpdate() {
  UAVObjRequestUpdate(BrushlessGimbalSettingsHandle());
}


x86 assembly (clang, -O0):
<BrushlessGimbalSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <BrushlessGimbalSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrushlessGimbalSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <BrushlessGimbalSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @BrushlessGimbalSettingsRequestUpdate() {
%1 = call i32 (...) @BrushlessGimbalSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @BrushlessGimbalSettingsRequestUpdate() {
%1 = tail call i32 (...) @BrushlessGimbalSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int sheet_row_callback(size_t row, size_t maxcol, void *callbackdata) {
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<sheet_row_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sheet_row_callback(i64 %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ nextsym();
void needvarname() {
  error("need variable name");
  nextsym();
}


x86 assembly (clang, -O0):
<needvarname>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <error@plt>
mov    $0x0,%al
call   1030 <nextsym@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<needvarname>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nextsym@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"need variable name\00"
define void @needvarname() {
%1 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @nextsym()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"need variable name\00"
define void @needvarname() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @nextsym()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void csr_writeb(uint8_t value, uint32_t addr) {
  *((volatile uint8_t *)addr) = value;
}


x86 assembly (clang, -O0):
<csr_writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<csr_writeb>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @csr_writeb(i32 %0, i64 %1) {
%3 = inttoptr i64 %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
void mega_foo2(const int a) { (void)a; }


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

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

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

LLVM IR (-O2):
define void @mega_foo2(i32 %0) {
ret void
}
int fstat(int handle, struct stat *statbuf) { return -1; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  int cChar = 0;
  printf("please input a character:\n");
  cChar = getchar();
  while (cChar != EOF) {
    putchar(cChar);
    cChar = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%eax
je     118c <main+0x5c>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1163 <main+0x33>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9d(%rip),%rbx
cmp    (%rbx),%eax
je     1162 <main+0x32>
nop
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@str = [26 x i8] c"please input a character:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %13, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %4, %2 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret i32 0
}
__attribute__((no, noclone)) unsigned __int128 t152_3add(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((unsigned __int128)(-1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t152_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0xffffffffffffffff,%rdx
adc    $0xffffffffffffffff,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t152_3add+0x48>
jmp    115f <t152_3add+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t152_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
adc    $0xffffffffffffffff,%r14
jae    112b <t152_3add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t152_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 -1, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t152_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ test4();
void test_test4() { test4(); }


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

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

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

LLVM IR (-O2):
define void @test_test4() {
%1 = tail call i32 (...) @test4()
ret void
}
void XrmCombineDatabase() {}


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

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

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

LLVM IR (-O2):
define void @XrmCombineDatabase() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
void sub() {
  printf("sub");
  test();
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"sub\00"
define void @sub() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
ret void
}
unsigned int f2(int x) { return (x << 5) | ((unsigned int)x >> 27); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1b,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
rol    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 5
%5 = load i32, i32* %2
%6 = lshr i32 %5, 27
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 5)
ret i32 %2
}
call6f(d, uc, us, ui, ul) double d;
unsigned char uc;
unsigned short us;
unsigned int ui;
unsigned long ul;
{
  d = d;
  call6g(uc, us, ui, ul);
}


x86 assembly (clang, -O0):
<call6f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %esi,%eax
mov    %dil,%sil
movsd  %xmm0,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movzbl -0x11(%rbp),%edi
movzwl -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <call6g@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6f>:
movzbl %dil,%edi
movzwl %si,%esi
xor    %eax,%eax
jmp    1030 <call6g@plt>

LLVM IR (-O0):
define i32 @call6f(double %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca i8
%9 = alloca i16
%10 = alloca i32
%11 = alloca i64
%12 = trunc i32 %1 to i8
%13 = trunc i32 %2 to i16
store double %0, double* %7
store i8 %12, i8* %8
store i16 %13, i16* %9
store i32 %3, i32* %10
store i64 %4, i64* %11
%14 = load double, double* %7
store double %14, double* %7
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = load i16, i16* %9
%18 = zext i16 %17 to i32
%19 = load i32, i32* %10
%20 = load i64, i64* %11
%21 = call i32 (i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6g to i32 (i32, i32, i32, i64, ...)*)(i32 %16, i32 %18, i32 %19, i64 %20)
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @call6f(double %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = and i32 %1, 255
%7 = and i32 %2, 65535
%8 = tail call i32 (i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6g to i32 (i32, i32, i32, i64, ...)*)(i32 %6, i32 %7, i32 %3, i64 %4)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, void *, int);
char *encode32(char *buf, uint32_t data) {
  uint32_t ndata = htonl(data);
  memcpy(buf, (void *)(&ndata), sizeof(uint32_t));
  return buf + sizeof(uint32_t);
}


x86 assembly (clang, -O0):
<encode32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @encode32(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
%7 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void g(void) {
  int n = 10, m = 20;
  int v[n + 1][m * 2];
#pragma omp parallel shared(v) firstprivate(n, m)
  { v[n - 1][m - 1] = 4; }
  if (v[9][19] != 4) {
    fprintf(stderr, "v[9][19] != 4\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%edx
mov    -0x8(%rbp),%eax
add    %eax,%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rdx,%rax
imul   %rcx,%rax
lea    0xf(,%rax,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rax
sub    %rsi,%rax
mov    %rax,%rsp
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rsi
imul   %rcx,%rsi
shl    $0x2,%rsi
mov    %rax,%rdx
add    %rsi,%rdx
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
movslq %esi,%rsi
movl   $0x4,(%rdx,%rsi,4)
imul   $0x9,%rcx,%rcx
cmpl   $0x4,0x4c(%rax,%rcx,4)
je     11c2 <g+0xa2>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"v[9][19] != 4\0A\00"
define void @g() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 10, i32* %1
store i32 20, i32* %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 2
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %3
%13 = mul nuw i64 %8, %11
%14 = alloca i32, i64 %13
store i64 %8, i64* %4
store i64 %11, i64* %5
%15 = load i32, i32* %1
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = mul nsw i64 %17, %11
%19 = getelementptr inbounds i32, i32* %14, i64 %18
%20 = load i32, i32* %2
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
store i32 4, i32* %23
%24 = mul nsw i64 9, %11
%25 = getelementptr inbounds i32, i32* %14, i64 %24
%26 = getelementptr inbounds i32, i32* %25, i64 19
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 4
br i1 %28, label %29, label %33
29: ; preds = %0
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%32 = call i32 (...) @abort()
unreachable
33: ; preds = %0
%34 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @g() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_init_channels();
int /*<<< orphan*/ sys_init_timers();
void sys_main_init(void) {
  sys_init_channels();
  sys_init_timers();
}


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

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

LLVM IR (-O0):
define void @sys_main_init() {
%1 = call i32 (...) @sys_init_channels()
%2 = call i32 (...) @sys_init_timers()
ret void
}

LLVM IR (-O2):
define void @sys_main_init() {
%1 = tail call i32 (...) @sys_init_channels()
%2 = tail call i32 (...) @sys_init_timers()
ret void
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void LowerCase(char *s) {
  int j;
  for (j = 0; j < strlen(s); j++)
    s[j] = tolower(s[j]);
}


x86 assembly (clang, -O0):
<LowerCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <LowerCase+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <LowerCase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowerCase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <LowerCase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <LowerCase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @LowerCase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void I2SInPointerSet(uint32_t ui32Base, uint32_t ui32NextPointer) {
  ;
  (*((volatile unsigned long *)(0x40021000 + 0x00000020))) = ui32NextPointer;
}


x86 assembly (clang, -O0):
<I2SInPointerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x40021020,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SInPointerSet>:
mov    %rsi,0x40021020
40
ret

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

LLVM IR (-O2):
define void @I2SInPointerSet(i64 %0, i64 %1) {
store volatile i64 %1, i64* inttoptr (i64 1073877024 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printerr_ex(int, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int system(char *);
void syncdir(char *src, char *dst) {
  char scmd[512];
  int ret;
  snprintf(scmd, 512 - 1, "rsync \"%s/\" --delete -aq \"%s\"", src, dst);
  ret = system(scmd);
  printerr_ex((ret < 0), scmd, 1);
}


x86 assembly (clang, -O0):
<syncdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x1ff,%esi
lea    0xea2(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x214(%rbp)
cmpl   $0x0,-0x214(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
lea    -0x210(%rbp),%rsi
mov    $0x1,%edx
call   1050 <printerr_ex@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syncdir>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xebb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1ff,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
shr    $0x1f,%eax
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <printerr_ex@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"rsync \22%s/\22 --delete -aq \22%s\22\00"
define void @syncdir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 511, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = call i32 @system(i8* %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 0
%15 = zext i1 %14 to i32
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%17 = call i32 @printerr_ex(i32 %15, i8* %16, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"rsync \22%s/\22 --delete -aq \22%s\22\00"
define void @syncdir(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 511, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @system(i8* %4)
%7 = lshr i32 %6, 31
%8 = call i32 @printerr_ex(i32 %7, i8* %4, i32 1)
ret void
}
unsigned chrhash(void *p, int M) {
  register unsigned hashval;
  register char *s = p;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % M;
}


x86 assembly (clang, -O0):
<chrhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <chrhash+0x4b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <chrhash+0x1a>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <chrhash+0x29>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <chrhash+0x10>
jmp    112b <chrhash+0x2b>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @chrhash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul i32 %8, 31
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
void f12(void) {}


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

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

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

LLVM IR (-O2):
define void @f12() {
ret void
}
int cdrom_lba_to_msf_accurate(int lba) {
  int pos;
  int m, s, f;
  pos = lba + 150;
  f = pos % 75;
  pos -= f;
  pos /= 75;
  s = pos % 60;
  pos -= s;
  pos /= 60;
  m = pos;
  return ((m << 16) | (s << 8) | f);
}


x86 assembly (clang, -O0):
<cdrom_lba_to_msf_accurate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x96,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdrom_lba_to_msf_accurate>:
add    $0x96,%edi
movslq %edi,%rax
imul   $0x1b4e81b5,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x4b,%ecx,%edx
imul   $0x7482296b,%rax,%rsi
mov    %eax,%edi
sub    %edx,%edi
movslq %ecx,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %rsi,%rcx
shr    $0x3f,%rcx
shr    $0x2b,%rsi
add    %ecx,%esi
shl    $0x10,%esi
or     %edi,%esi
shl    $0x8,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @cdrom_lba_to_msf_accurate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 150
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = srem i32 %9, 75
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 75
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = srem i32 %16, 60
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = sdiv i32 %21, 60
store i32 %22, i32* %3
%23 = load i32, i32* %3
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = shl i32 %24, 16
%26 = load i32, i32* %5
%27 = shl i32 %26, 8
%28 = or i32 %25, %27
%29 = load i32, i32* %6
%30 = or i32 %28, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @cdrom_lba_to_msf_accurate(i32 %0) {
%2 = add nsw i32 %0, 150
%3 = srem i32 %2, 75
%4 = sdiv i32 %2, 75
%5 = srem i32 %4, 60
%6 = sdiv i32 %2, 4500
%7 = shl i32 %6, 16
%8 = shl nsw i32 %5, 8
%9 = or i32 %7, %3
%10 = or i32 %9, %8
ret i32 %10
}
/* Variables and functions */
scalar_t__ niquery_set_qtype(int);
int niquery_option_name_handler(int index, const char *arg) {
  if (niquery_set_qtype(2) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<niquery_option_name_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <niquery_set_qtype@plt>
cmp    $0x0,%rax
jge    113f <niquery_option_name_handler+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <niquery_option_name_handler+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<niquery_option_name_handler>:
push   %rax
mov    $0x2,%edi
call   1030 <niquery_set_qtype@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @niquery_option_name_handler(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i64 @niquery_set_qtype(i32 2)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}