xunge/DecIR huggingface dataset:
int test_imm_1Eint64_highword_reg(long long val) {
  return ((val >> 32) & (0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Eint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x1e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Eint64_highword_reg>:
movabs $0x1e00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Eint64_highword_reg(i64 %0) {
%2 = and i64 %0, 128849018880
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int encode_size(int size, unsigned char *data) {
  if (size < 252) {
    data[0] = size;
    return 1;
  } else {
    data[0] = 252 + (size & 0x3);
    data[1] = (size - (int)data[0]) >> 2;
    return 2;
  }
}


x86 assembly (clang, -O0):
<encode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xfc,-0x8(%rbp)
jge    112f <encode_size+0x2f>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1161 <encode_size+0x61>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
add    $0xfc,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
sar    $0x2,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_size>:
cmp    $0xfb,%edi
jg     1111 <encode_size+0x11>
mov    %dil,(%rsi)
mov    $0x1,%eax
ret
mov    %edi,%eax
or     $0xfc,%al
mov    %al,(%rsi)
movzbl %al,%eax
sub    %eax,%edi
shr    $0x2,%edi
mov    %dil,0x1(%rsi)
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @encode_size(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 252
%4 = trunc i32 %0 to i8
br i1 %3, label %5, label %6
5: ; preds = %2
store i8 %4, i8* %1
br label %13
6: ; preds = %2
%7 = or i8 %4, -4
store i8 %7, i8* %1
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %0, %8
%10 = lshr i32 %9, 2
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %11, i8* %12
br label %13
13: ; preds = %6, %5
%14 = phi i32 [ 1, %5 ], [ 2, %6 ]
ret i32 %14
}
void FinalizeSets(void) {}


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

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

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

LLVM IR (-O2):
define void @FinalizeSets() {
ret void
}
/* Type definitions */
struct kdtree {
  int dummy;
};
struct kdres {
  int dummy;
};

/* Variables and functions */
struct kdres *kd_nearest(struct kdtree *, double *);
struct kdres *kd_nearest3(struct kdtree *tree, double x, double y, double z) {
  double pos[3];
  pos[0] = x;
  pos[1] = y;
  pos[2] = z;
  return kd_nearest(tree, pos);
}


x86 assembly (clang, -O0):
<kd_nearest3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <kd_nearest@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_nearest3>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
mov    %rsp,%rsi
call   1030 <kd_nearest@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest3(%struct.kdtree* %0, double %1, double %2, double %3) {
%5 = alloca %struct.kdtree*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [3 x double]
store %struct.kdtree* %0, %struct.kdtree** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
store double %10, double* %11
%12 = load double, double* %7
%13 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
store double %12, double* %13
%14 = load double, double* %8
%15 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
store double %14, double* %15
%16 = load %struct.kdtree*, %struct.kdtree** %5
%17 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%18 = call %struct.kdres* @kd_nearest(%struct.kdtree* %16, double* %17)
ret %struct.kdres* %18
}

LLVM IR (-O2):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest3(%struct.kdtree* %0, double %1, double %2, double %3) {
%5 = alloca [3 x double]
%6 = bitcast [3 x double]* %5 to i8*
%7 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
store double %1, double* %7
%8 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
store double %2, double* %8
%9 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
store double %3, double* %9
%10 = call %struct.kdres* @kd_nearest(%struct.kdtree* %0, double* %7)
ret %struct.kdres* %10
}
unsigned long insert_nsi(unsigned long insn, long value,
                         int dialect __attribute__((unused)),
                         const char **errmsg __attribute__((unused))) {
  return insn | (-value & 0xffff);
}


x86 assembly (clang, -O0):
<insert_nsi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xffff,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_nsi>:
neg    %esi
movzwl %si,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @insert_nsi(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = sub nsw i64 0, %10
%12 = and i64 %11, 65535
%13 = or i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @insert_nsi(i64 %0, i64 %1, i32 %2, i8** nocapture readnone %3) {
%5 = sub nsw i64 0, %1
%6 = and i64 %5, 65535
%7 = or i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ check_fortran_integer();
int /*<<< orphan*/ check_fortran_real();
int /*<<< orphan*/ print_info();
int main(int argc, char *argv[]) {
  check_fortran_integer();
  check_fortran_real();
  print_info();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @check_fortran_integer()
%4 = tail call i32 (...) @check_fortran_real()
%5 = tail call i32 (...) @print_info()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: gluon-radvd [-h] -i <interface> -p <prefix> [ -p "
                  "<prefix> ... ]\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: gluon-radvd [-h] -i <interface> -p <prefix> [ -p <prefix> ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: gluon-radvd [-h] -i <interface> -p <prefix> [ -p <prefix> ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int zgeth1(int *(*)(int, char *, int));
int zgethex(int *func_read(int, char *, int)) {
  register int c;
  c = zgeth1(func_read);
  return c;
}


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

x86 assembly (clang, -O2):
<zgethex>:
jmp    1030 <zgeth1@plt>

LLVM IR (-O0):
define i32 @zgethex(i32* (i32, i8*, i32)* %0) {
%2 = alloca i32* (i32, i8*, i32)*
%3 = alloca i32
store i32* (i32, i8*, i32)* %0, i32* (i32, i8*, i32)** %2
%4 = load i32* (i32, i8*, i32)*, i32* (i32, i8*, i32)** %2
%5 = call i32 @zgeth1(i32* (i32, i8*, i32)* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @zgethex(i32* (i32, i8*, i32)* %0) {
%2 = tail call i32 @zgeth1(i32* (i32, i8*, i32)* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_awk_comments() {
  test_parser_verify_parse(test_parser_sourcefile("awk", " #comment"), "awk",
                           "", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_awk_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebc(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_awk_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec5(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"awk\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_awk_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"awk\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_awk_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void called(int b) {
  printf("b: %d\n", b);
  printf("b*2: %d\n", b * 2);
  printf("call back function being called\n");
}


x86 assembly (clang, -O0):
<called>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<called>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%ebx
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"b: %d\0A\00"
@.str.1 = [9 x i8] c"b*2: %d\0A\00"
@.str.2 = [33 x i8] c"call back function being called\0A\00"
define void @called(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"b: %d\0A\00"
@.str.1 = [9 x i8] c"b*2: %d\0A\00"
@str = [32 x i8] c"call back function being called\00"
define void @called(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = shl nsw i32 %0, 1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *strong_s3();
const char *__attribute__((section(".test.c"))) sibcall_strong_s3(void) {
  return strong_s3();
}


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

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

LLVM IR (-O0):
define i8* @sibcall_strong_s3() section ".test.c" {
%1 = call i8* (...) @strong_s3()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_strong_s3() section ".test.c" {
%1 = tail call i8* (...) @strong_s3()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int sum1 = 10 + 11 + 12, sum2 = 010 + 011 + 012, sum3 = 0x10 + 0x11 + 0x12;
  printf("sum1 =  %d\n", sum1);
  printf("sum2 =  %d\n", sum2);
  printf("sum3 =  %d\n", sum3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x21,-0x8(%rbp)
movl   $0x1b,-0xc(%rbp)
movl   $0x33,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x21,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x33,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"sum1 = %d\0A\00"
@.str.1 = [12 x i8] c"sum2 = %d\0A\00"
@.str.2 = [12 x i8] c"sum3 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 33)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 27)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 51)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ status;

/* Variables and functions */
int write(int, int *, int);
int bme_send_status_to_client(int client, int status) {
  return write(client, &status, sizeof(status));
}


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

x86 assembly (clang, -O2):
<bme_send_status_to_client>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bme_send_status_to_client(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 = call i32 @write(i32 %5, i32* %4, i32 4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @bme_send_status_to_client(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
ret i32 %4
}
float addition(float a, float b) { return a + b; }


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

x86 assembly (clang, -O2):
<addition>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @addition(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 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @addition(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun4() { printf("In fun4\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"In fun4\00"
define void @fun4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutSwapBuffers();
void s2winSwapBuffers(void) { glutSwapBuffers(); }


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

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

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

LLVM IR (-O2):
define void @s2winSwapBuffers() {
%1 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
void *mp_alloc_fast(struct mempool *, unsigned int);
void *mp_alloc(struct mempool *pool, unsigned size) {
  return mp_alloc_fast(pool, size);
}


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

x86 assembly (clang, -O2):
<mp_alloc>:
jmp    1030 <mp_alloc_fast@plt>

LLVM IR (-O0):
%struct.mempool = type { i32 }
define i8* @mp_alloc(%struct.mempool* %0, i32 %1) {
%3 = alloca %struct.mempool*
%4 = alloca i32
store %struct.mempool* %0, %struct.mempool** %3
store i32 %1, i32* %4
%5 = load %struct.mempool*, %struct.mempool** %3
%6 = load i32, i32* %4
%7 = call i8* @mp_alloc_fast(%struct.mempool* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @mp_alloc(%struct.mempool* %0, i32 %1) {
%3 = tail call i8* @mp_alloc_fast(%struct.mempool* %0, i32 %1)
ret i8* %3
}
double temt6000_getlux(double vol) { return 2 * (100 * vol); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
mulsd  0xef8(%rip),%xmm0
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @temt6000_getlux(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.000000e+02, %3
%5 = fmul double 2.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @temt6000_getlux(double %0) {
%2 = fmul double %0, 1.000000e+02
%3 = fmul double %2, 2.000000e+00
ret double %3
}
/* Variables and functions */
void CL_CharEvent(int key) {}


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

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

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

LLVM IR (-O2):
define void @CL_CharEvent(i32 %0) {
ret void
}
int isxdigit(int a) {
  unsigned int ua = (unsigned int)a;
  return ((ua - '0') < 10U) || ((ua | 32U) - 'a' < 6);
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
jb     1133 <isxdigit+0x33>
mov    -0x8(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x6,%eax
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
or     $0x20,%edi
add    $0xffffff9f,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = sub i32 %5, 48
%7 = icmp ult i32 %6, 10
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = or i32 %9, 32
%11 = sub i32 %10, 97
%12 = icmp ult i32 %11, 6
br label %13
13: ; preds = %8, %1
%14 = phi i1 [ true, %1 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = or i32 %0, 32
%5 = add i32 %4, -97
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
unsigned int strtoul(char *, char **, int /*<<< orphan*/);
int parse_int(char *str, unsigned *pvalue) {
  char *end;
  unsigned value = strtoul(str, &end, 0);
  if (end != str) {
    *pvalue = value;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1155 <parse_int+0x45>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115c <parse_int+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <strtoul@plt>
cmp    %rbx,0x8(%rsp)
je     113b <parse_int+0x2b>
mov    %eax,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_int(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtoul(i8* %0, i8** %3, i32 0)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 %5, i32* %1
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %10
}
void soma(void *num1, void *num2) {
  int *pnum1 = (int *)num1;
  int *pnum2 = (int *)num2;
  *pnum2 = *pnum1 + *pnum2;
}


x86 assembly (clang, -O0):
<soma>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma>:
mov    (%rdi),%eax
add    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @soma(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
%16 = load i32*, i32** %6
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @soma(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, %5
store i32 %7, i32* %4
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  c = 0;
  while ((x > z) && (y > z)) {
    x = x - 1;
    y = y - 1;
    c = c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x15(%rbp)
jle    1161 <main+0x51>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1171 <main+0x61>
jmp    1191 <main+0x81>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x34>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %4
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %5
store i32 0, i32* %2
br label %9
9: ; preds = %19, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp sgt i32 %14, %15
br label %17
17: ; preds = %13, %9
%18 = phi i1 [ false, %9 ], [ %16, %13 ]
br i1 %18, label %19, label %26
19: ; preds = %17
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %3
%22 = load i32, i32* %4
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %4
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %9
26: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ LLONG_MAX;
__attribute__((always_)) int64_t
__checkint_int64_div_signed_unsigned(int64_t x, uint64_t y, int32_t *err) {
  if (y <= LLONG_MAX)
    return x / (int64_t)y;
  return 0;
}


x86 assembly (clang, -O0):
<__checkint_int64_div_signed_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%rax
jg     1135 <__checkint_int64_div_signed_unsigned+0x35>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    113c <__checkint_int64_div_signed_unsigned+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__checkint_int64_div_signed_unsigned>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %rsi,(%rcx)
jl     1113 <__checkint_int64_div_signed_unsigned+0x13>
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
@LLONG_MAX = global i64 0
define i32 @__checkint_int64_div_signed_unsigned(i32 %0, i64 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32*
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32* %2, i32** %7
%8 = load i64, i64* %6
%9 = load i64, i64* @LLONG_MAX
%10 = icmp sle i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i32
%15 = sdiv i32 %12, %14
store i32 %15, i32* %4
br label %17
16: ; preds = %3
store i32 0, i32* %4
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@LLONG_MAX = global i64 0
define i32 @__checkint_int64_div_signed_unsigned(i32 %0, i64 %1, i32* nocapture readnone %2) {
%4 = load i64, i64* @LLONG_MAX
%5 = icmp slt i64 %4, %1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = trunc i64 %1 to i32
%8 = sdiv i32 %0, %7
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
double __ieee754_sqrt(double);
double sqrt(double x) { return __ieee754_sqrt(x); }


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

x86 assembly (clang, -O2):
<sqrt>:
jmp    1030 <__ieee754_sqrt@plt>

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

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double @__ieee754_sqrt(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int32_t ReadUint8Be(const void *in, uint8_t *value) {
  assert(in != NULL);
  assert(value != NULL);
  const uint8_t *buf = (const uint8_t *)in;
  *value = buf[0];
  return 1;
}


x86 assembly (clang, -O0):
<ReadUint8Be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadUint8Be>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ReadUint8Be(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 i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32*, i32** %4
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to i32*
store i32* %15, i32** %5
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
store i32 %18, i32* %19
ret i32 1
}

LLVM IR (-O2):
define i32 @ReadUint8Be(i8* %0, i32* writeonly %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = bitcast i8* %0 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %1
ret i32 1
}
/* Variables and functions */
int iParent(int);
int /*<<< orphan*/ siftDown(int *, int, int);
void heapify(int *p, int size) {
  int start = iParent(size - 1);
  while (start >= 0) {
    siftDown(p, start, size - 1);
    start -= 1;
  }
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1040 <iParent@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1167 <heapify+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <siftDown@plt>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <heapify+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1040 <iParent@plt>
test   %eax,%eax
js     1151 <heapify+0x31>
mov    %eax,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <siftDown@plt>
add    $0xffffffff,%ebp
jb     1140 <heapify+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @heapify(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @iParent(i32 %3)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %4, %2 ]
%8 = tail call i32 @siftDown(i32* %0, i32 %7, i32 %3)
%9 = add nsw i32 %7, -1
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
long set_nest_flg(long, int);
long bgn_nest_flg(long flg_n) { return set_nest_flg(flg_n, +1); }


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

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

LLVM IR (-O0):
define i64 @bgn_nest_flg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @set_nest_flg(i64 %3, i32 1)
ret i64 %4
}

LLVM IR (-O2):
define i64 @bgn_nest_flg(i64 %0) {
%2 = tail call i64 @set_nest_flg(i64 %0, i32 1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char const);
void uart_writeline(const char *data) {
  unsigned int i = 0;
  while (data[i] != '\0') {
    uart_putc(data[i++]);
  }
  uart_putc(0x0D);
  uart_putc(0x0A);
}


x86 assembly (clang, -O0):
<uart_writeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <uart_writeline+0x46>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_putc@plt>
jmp    1123 <uart_writeline+0x13>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
call   1030 <uart_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_writeline>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <uart_writeline+0x35>
mov    %rdi,%rbx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <uart_putc@plt>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ebp
test   %al,%al
jne    1130 <uart_writeline+0x20>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <uart_putc@plt>

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

LLVM IR (-O2):
define void @uart_writeline(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add i32 %6, 1
%8 = tail call i32 @uart_putc(i8 signext %5)
%9 = zext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = tail call i32 @uart_putc(i8 signext 13)
%15 = tail call i32 @uart_putc(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int main(void) {
  unsigned int multiplo = (unsigned int)2;
  while (multiplo != 0) {
    multiplo = multiplo * (unsigned int)2;
    printf("Ecco il multipli di %u: %u\n", (unsigned int)2, multiplo);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1152 <main+0x42>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xee0(%rip),%r14
add    %ebx,%ebx
mov    %r14,%rdi
mov    $0x2,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
test   %ebx,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c"Ecco il multipli di %u: %u\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %3, %1 ]
%3 = shl i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 2, i32 %3)
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_lock_t;

/* Variables and functions */
void omp_unset_lock(omp_lock_t *_Lock) {}


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

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

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

LLVM IR (-O2):
define void @omp_unset_lock(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ left_motor_forward(int);
int /*<<< orphan*/ right_motor_forward(int);
void push() {
  left_motor_forward(50);
  right_motor_forward(50);
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1030 <left_motor_forward@plt>
mov    $0x32,%edi
call   1040 <right_motor_forward@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
push   %rax
mov    $0x32,%edi
call   1030 <left_motor_forward@plt>
mov    $0x32,%edi
pop    %rax
jmp    1040 <right_motor_forward@plt>

LLVM IR (-O0):
define void @push() {
%1 = call i32 @left_motor_forward(i32 50)
%2 = call i32 @right_motor_forward(i32 50)
ret void
}

LLVM IR (-O2):
define void @push() {
%1 = tail call i32 @left_motor_forward(i32 50)
%2 = tail call i32 @right_motor_forward(i32 50)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
char *skip_digits(char *chp) {
  while (1) {
    if (*chp == '\0' || *chp == '\n' || !isdigit(*chp))
      return chp;
    chp++;
  }
}


x86 assembly (clang, -O0):
<skip_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <skip_digits+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1151 <skip_digits+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115b <skip_digits+0x4b>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_digits+0xc>

x86 assembly (clang, -O2):
<skip_digits>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     113d <skip_digits+0x2d>
cmp    $0xa,%al
je     113d <skip_digits+0x2d>
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     113d <skip_digits+0x2d>
add    $0x1,%rbx
jmp    1120 <skip_digits+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_digits(i8* %0) {
br label %2
2: ; preds = %1, %9
%3 = phi i8* [ %0, %1 ], [ %10, %9 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 10, label %8
]
5: ; preds = %2
%6 = tail call i32 @isdigit(i8 signext %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2, %2, %5
ret i8* %3
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
}
void test_jinterval_setup() {}


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

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

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

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