xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int Min(int, int);
double log10(double);
int32_t lin2db(double d) {
  if (d == 0)
    return ((1 << 8) - 1);
  else
    return Min(-(int32_t)(20.0 * log10(d) / (48.0 / (1 << 8))), (1 << 8) - 1);
}


x86 assembly (clang, -O0):
<lin2db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1151 <lin2db+0x31>
jp     1151 <lin2db+0x31>
movl   $0xff,-0x4(%rbp)
jmp    118b <lin2db+0x6b>
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe8e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
xor    %edi,%edi
sub    %eax,%edi
mov    $0xff,%esi
call   1030 <Min@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lin2db>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1132 <lin2db+0x12>
jp     1132 <lin2db+0x12>
mov    $0xff,%eax
ret
push   %rax
call   1040 <log10@plt>
mulsd  0xec0(%rip),%xmm0
divsd  0xec0(%rip),%xmm0
cvttsd2si %xmm0,%edi
neg    %edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <Min@plt>

LLVM IR (-O0):
define i32 @lin2db(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 255, i32* %2
br label %15
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @log10(double %8)
%10 = fmul double 2.000000e+01, %9
%11 = fdiv double %10, 1.875000e-01
%12 = fptosi double %11 to i32
%13 = sub nsw i32 0, %12
%14 = call i32 @Min(i32 %13, i32 255)
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @lin2db(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call double @log10(double %0)
%5 = fmul double %4, 2.000000e+01
%6 = fdiv double %5, 1.875000e-01
%7 = fptosi double %6 to i32
%8 = sub nsw i32 0, %7
%9 = tail call i32 @Min(i32 %8, i32 255)
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ 255, %1 ]
ret i32 %11
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int file_exists(const char *fileName) {
  struct stat buf;
  int i = stat(fileName, &buf);
  if (i == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1142 <file_exists+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <file_exists+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_9Fuint16_reg(unsigned short val) {
  return ((val) & (0x9F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x9f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_9Fuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 159
%6 = icmp ne i32 %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_9Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 159
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void REQ_BINFO_handler(int fd) {}


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

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

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

LLVM IR (-O2):
define void @REQ_BINFO_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error() {
  fprintf(stderr, "Bad input format\n");
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Bad input format\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Bad input format\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_vhdl_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("vhdl", " --comment"),
                            "comment", "--comment");
}


x86 assembly (clang, -O0):
<test_vhdl_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec8(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vhdl_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecd(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"vhdl\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"--comment\00"
define void @test_vhdl_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"vhdl\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"--comment\00"
define void @test_vhdl_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t sub2(uint32_t a, uint32_t b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i64 @sub2(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
void toggle_OUTPUT(int port, int pin) {
  if ((pin > 31) || (pin < 0)) {
    return;
  }
  if (port == 0x00) {
    *(unsigned int volatile *)(0x41004400 + 0x1C) = (1 << pin);
  } else if (port == 0x80) {
    *(unsigned int volatile *)(0x41004400 + 0x9C) = (1 << pin);
  }
}


x86 assembly (clang, -O0):
<toggle_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jg     111e <toggle_OUTPUT+0x1e>
cmpl   $0x0,-0x8(%rbp)
jge    1123 <toggle_OUTPUT+0x23>
jmp    116a <toggle_OUTPUT+0x6a>
cmpl   $0x0,-0x4(%rbp)
jne    1145 <toggle_OUTPUT+0x45>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x4100441c,%eax
mov    %ecx,(%rax)
jmp    116a <toggle_OUTPUT+0x6a>
cmpl   $0x80,-0x4(%rbp)
jne    1165 <toggle_OUTPUT+0x65>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x4100449c,%eax
mov    %ecx,(%rax)
jmp    116a <toggle_OUTPUT+0x6a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_OUTPUT>:
cmp    $0x1f,%esi
ja     1128 <toggle_OUTPUT+0x28>
test   %edi,%edi
je     1118 <toggle_OUTPUT+0x18>
cmp    $0x80,%edi
jne    1128 <toggle_OUTPUT+0x28>
mov    $0x4100449c,%eax
jmp    111d <toggle_OUTPUT+0x1d>
mov    $0x4100441c,%eax
mov    $0x1,%edx
mov    %esi,%ecx
shl    %cl,%edx
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @toggle_OUTPUT(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 31
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = shl i32 1, %15
store volatile i32 %16, i32* inttoptr (i64 1090536476 to i32*)
br label %24
17: ; preds = %11
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 128
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %4
%22 = shl i32 1, %21
store volatile i32 %22, i32* inttoptr (i64 1090536604 to i32*)
br label %23
23: ; preds = %20, %17
br label %24
24: ; preds = %10, %23, %14
ret void
}

LLVM IR (-O2):
define void @toggle_OUTPUT(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 31
br i1 %3, label %9, label %4
4: ; preds = %2
switch i32 %0, label %9 [
i32 0, label %6
i32 128, label %5
]
5: ; preds = %4
br label %6
6: ; preds = %4, %5
%7 = phi i32* [ inttoptr (i64 1090536604 to i32*), %5 ], [ inttoptr (i64 1090536476 to i32*), %4 ]
%8 = shl nuw i32 1, %1
store volatile i32 %8, i32* %7
br label %9
9: ; preds = %6, %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ UChar;
typedef int /*<<< orphan*/ UBreakIterator;

/* Variables and functions */
int /*<<< orphan*/ printTextRange(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
int /*<<< orphan*/ ubrk_last(int /*<<< orphan*/ *);
int /*<<< orphan*/ ubrk_previous(int /*<<< orphan*/ *);
void printLast(UBreakIterator *boundary, UChar *str) {
  int32_t start;
  int32_t end = ubrk_last(boundary);
  start = ubrk_previous(boundary);
  printTextRange(str, start, end);
}


x86 assembly (clang, -O0):
<printLast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ubrk_last@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ubrk_previous@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <printTextRange@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLast>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <ubrk_last@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <ubrk_previous@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <printTextRange@plt>

LLVM IR (-O0):
define void @printLast(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = call i32 @ubrk_last(i32* %7)
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = call i32 @ubrk_previous(i32* %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @printTextRange(i32* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @printLast(i32* %0, i32* %1) {
%3 = tail call i32 @ubrk_last(i32* %0)
%4 = tail call i32 @ubrk_previous(i32* %0)
%5 = tail call i32 @printTextRange(i32* %1, i32 %4, i32 %3)
ret void
}
/* Variables and functions */
int PAPI_unlock(int);
void papif_unlock__(int *lock, int *check) { *check = PAPI_unlock(*lock); }


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

x86 assembly (clang, -O2):
<papif_unlock__>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_unlock@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_unlock__(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_unlock(i32 %3)
store i32 %4, i32* %1
ret void
}
unsigned int gcd(unsigned int x, unsigned int y) {
  if (y == 0) {
    return x;
  } else {
    return gcd(y, x % y);
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <gcd+0x38>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <gcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = urem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
double StringToNumberInternal(char *, int /*<<< orphan*/, char const,
                              char const);
double StringToNumber2(char *input, const char decimalSeparator,
                       const char thousandSeparator) {
  return StringToNumberInternal(input, 0, decimalSeparator, thousandSeparator);
}


x86 assembly (clang, -O0):
<StringToNumber2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
xor    %esi,%esi
movsbl %al,%edx
movsbl -0xa(%rbp),%ecx
call   1030 <StringToNumberInternal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringToNumber2>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <StringToNumberInternal@plt>

LLVM IR (-O0):
define double @StringToNumber2(i8* %0, i8 signext %1, i8 signext %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 i8*, i8** %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call double @StringToNumberInternal(i8* %7, i32 0, i8 signext %8, i8 signext %9)
ret double %10
}

LLVM IR (-O2):
define double @StringToNumber2(i8* %0, i8 signext %1, i8 signext %2) {
%4 = tail call double @StringToNumberInternal(i8* %0, i32 0, i8 signext %1, i8 signext %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ bfc_deinit(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ bfc_halt(int /*<<< orphan*/);
int /*<<< orphan*/ bfc_init(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ bfc_main();
int main(void) {
  bfc_init(0, 0);
  bfc_main();
  bfc_deinit(0, 0);
  bfc_halt(EXIT_SUCCESS);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1050 <bfc_init@plt>
mov    $0x0,%al
call   1060 <bfc_main@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <bfc_deinit@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <bfc_halt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1050 <bfc_init@plt>
xor    %eax,%eax
call   1060 <bfc_main@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <bfc_deinit@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <bfc_halt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bfc_init(i32 0, i32 0)
%3 = call i32 (...) @bfc_main()
%4 = call i32 @bfc_deinit(i32 0, i32 0)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @bfc_halt(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @bfc_init(i32 0, i32 0)
%2 = tail call i32 (...) @bfc_main()
%3 = tail call i32 @bfc_deinit(i32 0, i32 0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @bfc_halt(i32 %4)
ret i32 0
}
int Sort_Double_Decrease(const void *a, const void *b) {
  if ((*(double *)(a)) >= (*(double *)(b)))
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<Sort_Double_Decrease>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jb     112e <Sort_Double_Decrease+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1135 <Sort_Double_Decrease+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sort_Double_Decrease>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setb   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @Sort_Double_Decrease(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp oge double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @Sort_Double_Decrease(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ult double %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get16_be(void *p) { return *(uint8_t *)p << 8 | *((uint8_t *)p + 1); }


x86 assembly (clang, -O0):
<get16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16_be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get16_be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
int test_imm_EDint16_mem(short *val) {
  return ((*val) & (0xED << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EDint16_mem>:
testb  $0xed,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EDint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 237
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_78int32_reg(int val) { return ((val) & (0x78 << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_78int32_reg(i32 %0) {
%2 = and i32 %0, 120
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int ENOENT;
int ENOTDIR;
int string_wildcard_expand_error(const char *path, int err) {
  if (err == ENOENT || err == ENOTDIR) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<string_wildcard_expand_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
je     112f <string_wildcard_expand_error+0x2f>
mov    -0x14(%rbp),%eax
mov    0x2ed1(%rip),%rcx
cmp    (%rcx),%eax
jne    113b <string_wildcard_expand_error+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <string_wildcard_expand_error+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_wildcard_expand_error>:
mov    0x2ec9(%rip),%rax
cmp    %esi,(%rax)
setne  %al
mov    0x2ee5(%rip),%rcx
cmp    %esi,(%rcx)
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
@ENOENT = global i32 0
@ENOTDIR = global i32 0
define i32 @string_wildcard_expand_error(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOENT
%4 = icmp ne i32 %3, %1
%5 = load i32, i32* @ENOTDIR
%6 = icmp ne i32 %5, %1
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
double bar(float);
int printf(char *, double);
int main(void) { return printf("r = %f\n", bar(3.14f)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
call   1030 <bar@plt>
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1030 <bar@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"r = %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @bar(float 0x40091EB860000000)
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"r = %f\0A\00"
define i32 @main() {
%1 = tail call double @bar(float 0x40091EB860000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef void const *b;
typedef void *a;

/* Variables and functions */
int /*<<< orphan*/ cpy3(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int cpy8(void *, void const *);
void cpy11(void *a, const void *b) {
  cpy8(a, b), cpy3((uint8_t *)a + 8, (uint8_t *)b + 8);
}


x86 assembly (clang, -O0):
<cpy11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cpy8@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   1040 <cpy3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy11>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cpy8@plt>
add    $0x20,%rbx
add    $0x20,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cpy3@plt>

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

LLVM IR (-O2):
define void @cpy11(i8* %0, i8* %1) {
%3 = tail call i32 @cpy8(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %0, i64 32
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i8, i8* %1, i64 32
%7 = bitcast i8* %6 to i32*
%8 = tail call i32 @cpy3(i32* %5, i32* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ balance_iter(int);
int /*<<< orphan*/ hal_delay(int);
void balance_run(void) {
  for (;; hal_delay(2))
    balance_iter(2);
}


x86 assembly (clang, -O0):
<balance_run>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <balance_run+0x9>
mov    $0x2,%edi
call   1030 <balance_iter@plt>
mov    $0x2,%edi
call   1040 <hal_delay@plt>
jmp    1129 <balance_run+0x9>

x86 assembly (clang, -O2):
<balance_run>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1030 <balance_iter@plt>
mov    $0x2,%edi
call   1040 <hal_delay@plt>
jmp    1130 <balance_run+0x10>

LLVM IR (-O0):
define void @balance_run() {
br label %1
1: ; preds = %3, %0
%2 = call i32 @balance_iter(i32 2)
br label %3
3: ; preds = %1
%4 = call i32 @hal_delay(i32 2)
br label %1
}

LLVM IR (-O2):
define void @balance_run() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @balance_iter(i32 2)
%3 = tail call i32 @hal_delay(i32 2)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ SHIFTREG_ENC_1_SetIntMode(unsigned int);
void SHIFTREG_ENC_1_Init(void) { SHIFTREG_ENC_1_SetIntMode((2u)); }


x86 assembly (clang, -O0):
<SHIFTREG_ENC_1_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SHIFTREG_ENC_1_SetIntMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHIFTREG_ENC_1_Init>:
mov    $0x2,%edi
jmp    1030 <SHIFTREG_ENC_1_SetIntMode@plt>

LLVM IR (-O0):
define void @SHIFTREG_ENC_1_Init() {
%1 = call i32 @SHIFTREG_ENC_1_SetIntMode(i32 2)
ret void
}

LLVM IR (-O2):
define void @SHIFTREG_ENC_1_Init() {
%1 = tail call i32 @SHIFTREG_ENC_1_SetIntMode(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int ret = 0;
  long nr_of_reductions = 1;
  fun(1);
  printf("RETURNED %d\n", ret);
  if (ret != 5) {
    return 1;
  } else {
    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)
movq   $0x1,-0x20(%rbp)
mov    $0x1,%edi
call   1030 <fun@plt>
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x5,-0x14(%rbp)
je     1174 <main+0x54>
movl   $0x1,-0x4(%rbp)
jmp    117b <main+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <fun@plt>
lea    0xece(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"RETURNED %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fun(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Test run!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Test run!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Test run!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int lrr;

/* Variables and functions */
void rtcp_xr_dlrr_set_dlrr(uint8_t *p_rtcp_xr_dlrr, uint32_t lrr) {
  p_rtcp_xr_dlrr[12] = (lrr >> 24) & 0xff;
  p_rtcp_xr_dlrr[13] = (lrr >> 16) & 0xff;
  p_rtcp_xr_dlrr[14] = (lrr >> 8) & 0xff;
  p_rtcp_xr_dlrr[15] = (lrr)&0xff;
}


x86 assembly (clang, -O0):
<rtcp_xr_dlrr_set_dlrr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x34(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x38(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x3c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcp_xr_dlrr_set_dlrr>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,0x30(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x34(%rdi)
mov    %edx,0x38(%rdi)
mov    %esi,0x3c(%rdi)
ret

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

LLVM IR (-O2):
define void @rtcp_xr_dlrr_set_dlrr(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = getelementptr inbounds i32, i32* %0, i64 12
store i32 %3, i32* %4
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 13
store i32 %6, i32* %7
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %0, i64 14
store i32 %9, i32* %10
%11 = and i32 %1, 255
%12 = getelementptr inbounds i32, i32* %0, i64 15
store i32 %11, i32* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_core(int, int);
void emit_arith(int op) { emit_core(op, 1); }


x86 assembly (clang, -O0):
<emit_arith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <emit_core@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @emit_arith(i32 %0) {
%2 = tail call i32 @emit_core(i32 %0, i32 1)
ret void
}
int main() {
  int x, y, z;
  z = 5;
  if (z > 2) {
    x = 2;
    y = 3;
  } else {
    x = 3;
    y = 2;
  }
  z = x + y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jle    112f <main+0x2f>
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
jmp    113d <main+0x3d>
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, size_t);
void *talloc_named_const(void const *, size_t, char const *);
void *_talloc_zero(const void *ctx, size_t size, const char *name) {
  void *p = talloc_named_const(ctx, size, name);
  if (p) {
    memset(p, '\0', size);
  }
  return p;
}


x86 assembly (clang, -O0):
<_talloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <talloc_named_const@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1163 <_talloc_zero+0x43>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_talloc_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <talloc_named_const@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <_talloc_zero+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_talloc_zero(i8* %0, i64 %1, i8* %2) {
%4 = tail call i8* @talloc_named_const(i8* %0, i64 %1, i8* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memset(i8* %4, i8 signext 0, i64 %1)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
/* Variables and functions */
int wcsunitse(char const *, char const *, double *, double *, double *, int);
int wcsunits(const char have[], const char want[], double *scale,
             double *offset, double *power) {
  return wcsunitse(have, want, scale, offset, power, 0x0);
}


x86 assembly (clang, -O0):
<wcsunits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <wcsunitse@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsunits>:
xor    %r9d,%r9d
jmp    1030 <wcsunitse@plt>

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

LLVM IR (-O2):
define i32 @wcsunits(i8* %0, i8* %1, double* %2, double* %3, double* %4) {
%6 = tail call i32 @wcsunitse(i8* %0, i8* %1, double* %2, double* %3, double* %4, i32 0)
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int comparator_time_t(time_t *a, time_t *b) {
  return *a == *b ? 0 : *a < *b ? -1 : 1;
}


x86 assembly (clang, -O0):
<comparator_time_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jne    112a <comparator_time_t+0x2a>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <comparator_time_t+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator_time_t>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparator_time_t(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = icmp eq i64 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load i64*, i64** %3
%13 = load i64, i64* %12
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
%16 = icmp slt i64 %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 1
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ 0, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @comparator_time_t(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = icmp eq i64 %3, %4
%6 = icmp slt i64 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int strlen(char const *);
int get_decrypt_output_length(const char *szInput) {
  int output_len = 0;
  if (szInput) {
    output_len = strlen(szInput) / 2;
  }
  return output_len;
}


x86 assembly (clang, -O0):
<get_decrypt_output_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1142 <get_decrypt_output_length+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_decrypt_output_length>:
test   %rdi,%rdi
je     1129 <get_decrypt_output_length+0x19>
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_decrypt_output_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = sdiv i32 %4, 2
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
void recv_message(int sockfd) {
  char message[6];
  message[5] = '\0';
  if (read(sockfd, message, 5) != 5) {
    perror("Couldn't read 5 chars");
  } else {
    printf("Message from server: %s\n", message);
  }
}


x86 assembly (clang, -O0):
<recv_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x5,%edx
call   1040 <read@plt>
cmp    $0x5,%eax
je     116a <recv_message+0x3a>
lea    0xea0(%rip),%rdi
call   1050 <perror@plt>
jmp    117a <recv_message+0x4a>
lea    -0xa(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_message>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x2(%rsp),%rsi
mov    $0x5,%edx
call   1040 <read@plt>
cmp    $0x5,%eax
jne    115d <recv_message+0x2d>
lea    0xec5(%rip),%rdi
lea    0x2(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret
lea    0xe9c(%rip),%rdi
pop    %rax
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Couldn't read 5 chars\00"
@.str.1 = [25 x i8] c"Message from server: %s\0A\00"
define void @recv_message(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 5
store i8 0, i8* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 5)
%8 = icmp ne i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
11: ; preds = %1
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Couldn't read 5 chars\00"
@.str.1 = [25 x i8] c"Message from server: %s\0A\00"
define void @recv_message(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 5
store i8 0, i8* %4
%5 = call i32 @read(i32 %0, i8* %3, i32 5)
%6 = icmp eq i32 %5, 5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %11
11: ; preds = %9, %7
ret void
}
void logic16() {}


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

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

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

LLVM IR (-O2):
define void @logic16() {
ret void
}
/* Variables and functions */
int rom_present(char *);
int vga_available() { return rom_present("ibm_vga.bin"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"ibm_vga.bin\00"
define i32 @vga_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"ibm_vga.bin\00"
define i32 @vga_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}