xunge/DecIR huggingface dataset:
outerr(s, a, b, c) char *s, *a, *b, *c;
{
  char buf[200];
  sprintf(buf, s, a, b, c);
  write(2, buf, (unsigned)strlen(buf));
}


x86 assembly (clang, -O0):
<outerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    -0xf0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0xf0(%rbp),%rax
mov    %rax,-0xf8(%rbp)
lea    -0xf0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xf8(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outerr>:
push   %rbx
sub    $0xd0,%rsp
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <write@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @outerr(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [200 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* %12, i8* %13, i8* %14, i8* %15)
%17 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%19 = call i64 @strlen(i8* %18)
%20 = trunc i64 %19 to i32
%21 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %17, i32 %20)
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @outerr(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [200 x i8]
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3)
%8 = call i64 @strlen(i8* %6)
%9 = trunc i64 %8 to i32
%10 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %6, i32 %9)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_submatrix(float **b, int nrl, int nrh, int ncl, int nch) {
  free((char *)(b + nrl - 1));
}


x86 assembly (clang, -O0):
<free_submatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_submatrix>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_submatrix(float** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float** %0, float*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load float**, float*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float*, float** %11, i64 %13
%15 = getelementptr inbounds float*, float** %14, i64 -1
%16 = bitcast float** %15 to i8*
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
define void @free_submatrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds float*, float** %0, i64 %6
%8 = getelementptr inbounds float*, float** %7, i64 -1
%9 = bitcast float** %8 to i8*
%10 = tail call i32 @free(i8* %9)
ret void
}
extern void null_command() {}


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

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

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

LLVM IR (-O2):
define void @null_command() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ bla();
int /*<<< orphan*/ foo();
void dont_thread_2(int first) {
  int i = 0;
  do {
    if (first)
      foo();
    else
      bar();
    first = 0;
    bla();
  } while (i++ < 100);
}


x86 assembly (clang, -O0):
<dont_thread_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1158 <dont_thread_2+0x28>
mov    $0x0,%al
call   1050 <foo@plt>
jmp    115f <dont_thread_2+0x2f>
mov    $0x0,%al
call   1030 <bar@plt>
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bla@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x64,%eax
jl     1142 <dont_thread_2+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dont_thread_2>:
push   %rbx
xor    %eax,%eax
test   %edi,%edi
je     113e <dont_thread_2+0xe>
call   1050 <foo@plt>
jmp    1143 <dont_thread_2+0x13>
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <bla@plt>
mov    $0x64,%ebx
nop
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <bla@plt>
add    $0xffffffff,%ebx
jne    1150 <dont_thread_2+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @dont_thread_2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 (...) @foo()
br label %11
9: ; preds = %4
%10 = call i32 (...) @bar()
br label %11
11: ; preds = %9, %7
store i32 0, i32* %2
%12 = call i32 (...) @bla()
br label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = icmp slt i32 %14, 100
br i1 %16, label %4, label %17
17: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @dont_thread_2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @foo()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %3, %5
%8 = tail call i32 (...) @bla()
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %13, %9 ]
%11 = tail call i32 (...) @bar()
%12 = tail call i32 (...) @bla()
%13 = add nuw nsw i32 %10, 1
%14 = icmp eq i32 %13, 101
br i1 %14, label %15, label %9
15: ; preds = %9
ret void
}
/* Type definitions */
struct upnphttp {
  int dummy;
};
typedef int /*<<< orphan*/ resp;

/* Variables and functions */
int /*<<< orphan*/ BuildSendAndCloseSoapResp(struct upnphttp *, char const *,
                                             int);
void GetNATRSIPStatus(struct upnphttp *h, const char *action) {
  static const char resp[] =
      "<u:GetNATRSIPStatusResponse "
      "xmlns:u=\"urn:schemas-upnp-org:service:WANIPConnection:1\">"
      "<NewRSIPAvailable>0</NewRSIPAvailable>"
      "<NewNATEnabled>1</NewNATEnabled>"
      "</u:GetNATRSIPStatusResponse>";
  BuildSendAndCloseSoapResp(h, resp, sizeof(resp) - 1);
}


x86 assembly (clang, -O0):
<GetNATRSIPStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0xb8,%edx
call   1030 <BuildSendAndCloseSoapResp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNATRSIPStatus>:
lea    0xee9(%rip),%rsi
mov    $0xb8,%edx
jmp    1030 <BuildSendAndCloseSoapResp@plt>

LLVM IR (-O0):
%struct.upnphttp = type { i32 }
@GetNATRSIPStatus.resp = internal constant [185 x i8] c"<u:GetNATRSIPStatusResponse xmlns:u=\22urn:schemas-upnp-org:service:WANIPConnection:1\22><NewRSIPAvailable>0</NewRSIPAvailable><NewNATEnabled>1</NewNATEnabled></u:GetNATRSIPStatusResponse>\00"
define void @GetNATRSIPStatus(%struct.upnphttp* %0, i8* %1) {
%3 = alloca %struct.upnphttp*
%4 = alloca i8*
store %struct.upnphttp* %0, %struct.upnphttp** %3
store i8* %1, i8** %4
%5 = load %struct.upnphttp*, %struct.upnphttp** %3
%6 = call i32 @BuildSendAndCloseSoapResp(%struct.upnphttp* %5, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @GetNATRSIPStatus.resp, i64 0, i64 0), i32 184)
ret void
}

LLVM IR (-O2):
%struct.upnphttp = type { i32 }
@GetNATRSIPStatus.resp = internal constant [185 x i8] c"<u:GetNATRSIPStatusResponse xmlns:u=\22urn:schemas-upnp-org:service:WANIPConnection:1\22><NewRSIPAvailable>0</NewRSIPAvailable><NewNATEnabled>1</NewNATEnabled></u:GetNATRSIPStatusResponse>\00"
define void @GetNATRSIPStatus(%struct.upnphttp* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @BuildSendAndCloseSoapResp(%struct.upnphttp* %0, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @GetNATRSIPStatus.resp, i64 0, i64 0), i32 184)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t max_32(int32_t a, int32_t b) { return a - ((a - b) & ((a - b) >> 31)); }


x86 assembly (clang, -O0):
<max_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    -0x8(%rbp),%edx
sar    $0x1f,%edx
and    %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_32>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max_32(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* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = ashr i32 %11, 31
%13 = and i32 %8, %12
%14 = sub nsw i32 %5, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @max_32(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
char *strcat(char *s1, const char *s2) {
  char *tmp = s1;
  while (*s1 != '\0')
    s1++;
  while ((*s1++ = *s2++) != '\0')
    ;
  return tmp;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116d <strcat+0x6d>
jmp    113a <strcat+0x3a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int test_imm_36int32_reg(int val) { return ((val) & (0x36 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_36int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 54
%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_36int32_reg(i32 %0) {
%2 = and i32 %0, 54
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(2 == 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int tun_open_common0(char *, int /*<<< orphan*/);
int tap_open(char *dev) { return tun_open_common0(dev, 0); }


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

x86 assembly (clang, -O2):
<tap_open>:
xor    %esi,%esi
jmp    1030 <tun_open_common0@plt>

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

LLVM IR (-O2):
define i32 @tap_open(i8* %0) {
%2 = tail call i32 @tun_open_common0(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ PIN_INT2_DriverIRQHandler();
__attribute__((weak)) void PIN_INT2_IRQHandler(void) {
  PIN_INT2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PIN_INT2_IRQHandler() {
%1 = call i32 (...) @PIN_INT2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PIN_INT2_IRQHandler() {
%1 = tail call i32 (...) @PIN_INT2_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dcd_migrate_data();
void platform_startup() { dcd_migrate_data(); }


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

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

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

LLVM IR (-O2):
define void @platform_startup() {
%1 = tail call i32 (...) @dcd_migrate_data()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rl_back_to_indent();
rl_vi_first_print() { rl_back_to_indent(); }


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

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

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

LLVM IR (-O2):
define i32 @rl_vi_first_print() {
%1 = tail call i32 (...) @rl_back_to_indent()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ __le32;

/* Variables and functions */
int /*<<< orphan*/ htole32(int /*<<< orphan*/);
__le32 cpu_to_le32(uint32_t x) { return (__le32)htole32(x); }


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

x86 assembly (clang, -O2):
<cpu_to_le32>:
jmp    1030 <htole32@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_le32(i32 %0) {
%2 = tail call i32 @htole32(i32 %0)
ret i32 %2
}
int blue_counter() {
  static int counter = 20;
  counter = counter + 1;
  return counter;
}


x86 assembly (clang, -O0):
<blue_counter>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    0x2f07(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blue_counter>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@blue_counter.counter = internal global i32 20
define i32 @blue_counter() {
%1 = load i32, i32* @blue_counter.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @blue_counter.counter
%3 = load i32, i32* @blue_counter.counter
ret i32 %3
}

LLVM IR (-O2):
@blue_counter.counter = internal unnamed_addr global i32 20
define i32 @blue_counter() {
%1 = load i32, i32* @blue_counter.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @blue_counter.counter
ret i32 %2
}
void INT_Excep_PERIB_INTB132(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB132() {
ret void
}
/* Variables and functions */
int get_irqmask();
int /*<<< orphan*/ set_irqmask(int);
void enable_interrupt(int number) {
  set_irqmask(get_irqmask() & ~(1 << number));
}


x86 assembly (clang, -O0):
<enable_interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_irqmask@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    %eax,%edi
call   1030 <set_irqmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_interrupt>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <get_irqmask@plt>
btr    %ebx,%eax
mov    %eax,%edi
pop    %rbx
jmp    1030 <set_irqmask@plt>

LLVM IR (-O0):
define void @enable_interrupt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_irqmask()
%4 = load i32, i32* %2
%5 = shl i32 1, %4
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = call i32 @set_irqmask(i32 %7)
ret void
}

LLVM IR (-O2):
define void @enable_interrupt(i32 %0) {
%2 = tail call i32 (...) @get_irqmask()
%3 = shl nuw i32 1, %0
%4 = xor i32 %3, -1
%5 = and i32 %2, %4
%6 = tail call i32 @set_irqmask(i32 %5)
ret void
}
int fun208() { return 208; }


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

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

LLVM IR (-O0):
define i32 @fun208() {
ret i32 208
}

LLVM IR (-O2):
define i32 @fun208() {
ret i32 208
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_bool_exp(int, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_true_exp(unsigned loc) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Absyn_bool_exp(1, loc);
  return _T0;
}


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

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

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_true_exp(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.Cyc_Absyn_Exp*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_bool_exp(i32 1, i32 %4)
store %struct.Cyc_Absyn_Exp* %5, %struct.Cyc_Absyn_Exp** %3
%6 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
ret %struct.Cyc_Absyn_Exp* %6
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_true_exp(i32 %0) {
%2 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_bool_exp(i32 1, i32 %0)
ret %struct.Cyc_Absyn_Exp* %2
}
/* Variables and functions */
unsigned short NumberOnly();
int /*<<< orphan*/ WriteInstruction(char *);
int /*<<< orphan*/ WriteNumber(unsigned short);
void CR_Sound(void) {
  unsigned short int nNum = NumberOnly();
  nNum = 41;
  WriteInstruction("ld hl,(sndptr)");
  WriteInstruction("ld de,");
  WriteNumber(nNum);
  WriteInstruction("add hl,de");
  WriteInstruction("call isnd");
}


x86 assembly (clang, -O0):
<CR_Sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <NumberOnly@plt>
mov    %ax,-0x2(%rbp)
movw   $0x29,-0x2(%rbp)
lea    0xeb0(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xeb3(%rip),%rdi
call   1040 <WriteInstruction@plt>
movzwl -0x2(%rbp),%edi
call   1030 <WriteNumber@plt>
lea    0xea5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xea3(%rip),%rdi
call   1040 <WriteInstruction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Sound>:
push   %rax
xor    %eax,%eax
call   1050 <NumberOnly@plt>
lea    0xec1(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec4(%rip),%rdi
call   1040 <WriteInstruction@plt>
mov    $0x29,%edi
call   1030 <WriteNumber@plt>
lea    0xeb5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"ld hl,(sndptr)\00"
@.str.1 = [7 x i8] c"ld de,\00"
@.str.2 = [10 x i8] c"add hl,de\00"
@.str.3 = [10 x i8] c"call isnd\00"
define void @CR_Sound() {
%1 = alloca i16
%2 = call zeroext i16 (...) @NumberOnly()
store i16 %2, i16* %1
store i16 41, i16* %1
%3 = call i32 @WriteInstruction(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @WriteInstruction(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = load i16, i16* %1
%6 = call i32 @WriteNumber(i16 zeroext %5)
%7 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"ld hl,(sndptr)\00"
@.str.1 = [7 x i8] c"ld de,\00"
@.str.2 = [10 x i8] c"add hl,de\00"
@.str.3 = [10 x i8] c"call isnd\00"
define void @CR_Sound() {
%1 = tail call zeroext i16 (...) @NumberOnly()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @WriteNumber(i16 zeroext 41)
%5 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ htobe64(int /*<<< orphan*/);
uint64_t jet_htobe64(uint64_t host_endian_64bits) {
  return htobe64(host_endian_64bits);
}


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

x86 assembly (clang, -O2):
<jet_htobe64>:
jmp    1030 <htobe64@plt>

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

LLVM IR (-O2):
define i32 @jet_htobe64(i32 %0) {
%2 = tail call i32 @htobe64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cginc1pi(int v) { ngen("%s\t$%d,(%%eax)", "addl", v); }


x86 assembly (clang, -O0):
<cginc1pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc1pi>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s\09$%d,(%%eax)\00"
@.str.1 = [5 x i8] c"addl\00"
define void @cginc1pi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s\09$%d,(%%eax)\00"
@.str.1 = [5 x i8] c"addl\00"
define void @cginc1pi(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_OPEN_MAX;
int sysconf(int /*<<< orphan*/);
machdep_sys_getdtablesize() { return (sysconf(_SC_OPEN_MAX)); }


x86 assembly (clang, -O0):
<machdep_sys_getdtablesize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_getdtablesize>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_OPEN_MAX = global i32 0
define i32 @machdep_sys_getdtablesize() {
%1 = load i32, i32* @_SC_OPEN_MAX
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_OPEN_MAX = global i32 0
define i32 @machdep_sys_getdtablesize() {
%1 = load i32, i32* @_SC_OPEN_MAX
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int mapHexDigit(int);
int addHexDigit(int *val, int digit) {
  digit = mapHexDigit(digit);
  if (digit < 0)
    return -1;
  *val = (*val << 4) | digit;
  return 0;
}


x86 assembly (clang, -O0):
<addHexDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <mapHexDigit@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1140 <addHexDigit+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <addHexDigit+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x4,%ecx
or     -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addHexDigit>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <mapHexDigit@plt>
test   %eax,%eax
js     112c <addHexDigit+0x1c>
mov    (%rbx),%ecx
shl    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @addHexDigit(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 = call i32 @mapHexDigit(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %18
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = shl i32 %13, 4
%15 = load i32, i32* %5
%16 = or i32 %14, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
store i32 0, i32* %3
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @addHexDigit(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @mapHexDigit(i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* %0
%7 = shl i32 %6, 4
%8 = or i32 %7, %3
store i32 %8, i32* %0
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %10
}
void mis_release(struct mis_dis *dis) {}


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

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

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

LLVM IR (-O2):
%struct.mis_dis = type opaque
define void @mis_release(%struct.mis_dis* nocapture %0) {
ret void
}
char *getcwd(char *buf, int size) { return "dummy"; }


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeee(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"dummy\00"
define i8* @getcwd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"dummy\00"
define i8* @getcwd(i8* nocapture readnone %0, i32 %1) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct fs_volume {
  int dummy;
};
struct fs_dirent {
  int dummy;
};

/* Variables and functions */
struct fs_dirent *diskfs_dirent_create(struct fs_volume *, int /*<<< orphan*/,
                                       int);
struct fs_dirent *diskfs_volume_root(struct fs_volume *v) {
  return diskfs_dirent_create(v, 0, 2);
}


x86 assembly (clang, -O0):
<diskfs_volume_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <diskfs_dirent_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diskfs_volume_root>:
xor    %esi,%esi
mov    $0x2,%edx
jmp    1030 <diskfs_dirent_create@plt>

LLVM IR (-O0):
%struct.fs_dirent = type { i32 }
%struct.fs_volume = type { i32 }
define %struct.fs_dirent* @diskfs_volume_root(%struct.fs_volume* %0) {
%2 = alloca %struct.fs_volume*
store %struct.fs_volume* %0, %struct.fs_volume** %2
%3 = load %struct.fs_volume*, %struct.fs_volume** %2
%4 = call %struct.fs_dirent* @diskfs_dirent_create(%struct.fs_volume* %3, i32 0, i32 2)
ret %struct.fs_dirent* %4
}

LLVM IR (-O2):
%struct.fs_dirent = type { i32 }
%struct.fs_volume = type { i32 }
define %struct.fs_dirent* @diskfs_volume_root(%struct.fs_volume* %0) {
%2 = tail call %struct.fs_dirent* @diskfs_dirent_create(%struct.fs_volume* %0, i32 0, i32 2)
ret %struct.fs_dirent* %2
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
unsigned int ilog2(unsigned int);
uint32_t next_p2(uint32_t x) { return 2U << ilog2(x - 1); }


x86 assembly (clang, -O0):
<next_p2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <ilog2@plt>
mov    %eax,%ecx
mov    $0x2,%eax
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_p2>:
push   %rax
add    $0xffffffff,%edi
call   1030 <ilog2@plt>
mov    $0x2,%edx
mov    %eax,%ecx
shl    %cl,%edx
mov    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @next_p2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
%5 = call i32 @ilog2(i32 %4)
%6 = shl i32 2, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @next_p2(i32 %0) {
%2 = add i32 %0, -1
%3 = tail call i32 @ilog2(i32 %2)
%4 = shl i32 2, %3
ret i32 %4
}
/* Variables and functions */
int assert(int);
int main() {
  assert(0 ? 42 : 0 ? 54 : 0 ? 65 : 7) == 7;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 7)
%3 = icmp eq i32 %2, 7
%4 = zext i1 %3 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 7)
ret i32 0
}
double linerp(double a, double b, double x) { return a * (1 - x) + b * x; }


x86 assembly (clang, -O0):
<linerp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linerp>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @linerp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %7, double %9, double %12)
ret double %13
}

LLVM IR (-O2):
define double @linerp(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = fmul double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Welcome to Sorting Demo!\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 = [26 x i8] c"Welcome to Sorting Demo!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Welcome to Sorting Demo!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *string_escape_character_array(char *, char *, char *);
char *string_escape_full(char *destination, char *source) {
  return string_escape_character_array(destination, source, "$'#");
}


x86 assembly (clang, -O0):
<string_escape_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <string_escape_character_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_escape_full>:
lea    0xee9(%rip),%rdx
jmp    1030 <string_escape_character_array@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"$'#\00"
define i8* @string_escape_full(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 i8* @string_escape_character_array(i8* %5, i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"$'#\00"
define i8* @string_escape_full(i8* %0, i8* %1) {
%3 = tail call i8* @string_escape_character_array(i8* %0, i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ hal_early_print_printf(char *);
int /*<<< orphan*/ private_hal_io_interrupt_init();
void hal_io_init() {
  hal_early_print_printf("\nInitializing io module...\n");
  private_hal_io_interrupt_init();
  return;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"\0AInitializing io module...\0A\00"
define void @hal_io_init() {
%1 = call i32 @hal_early_print_printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @private_hal_io_interrupt_init()
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0AInitializing io module...\0A\00"
define void @hal_io_init() {
%1 = tail call i32 @hal_early_print_printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @private_hal_io_interrupt_init()
ret void
}
void adts_test(void) {
  ;
  return;
}


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

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

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

LLVM IR (-O2):
define void @adts_test() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) extern void Uart0_SetBaudrate(uint32_t baud) {}


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

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

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

LLVM IR (-O2):
define void @Uart0_SetBaudrate(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tgl_free_release(void *ptr, int size) { free(ptr); }


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

x86 assembly (clang, -O2):
<tgl_free_release>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tgl_free_release(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
float crealf(float _Complex z) { abort(); }


x86 assembly (clang, -O0):
<crealf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movlpd %xmm0,-0x8(%rbp)
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<crealf>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define float @crealf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
unreachable
}

LLVM IR (-O2):
define float @crealf(<2 x float> %0) {
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ stop();
void deinit(void) { stop(); }


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

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

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

LLVM IR (-O2):
define void @deinit() {
%1 = tail call i32 (...) @stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fatal_OutOfMemory();
char *strdup(char const *);
int strlen(char *);
void MakeStringLiteral(const char *p_token, long *r_literal) {
  char *t_value;
  t_value = strdup(p_token + 1);
  if (t_value == NULL)
    Fatal_OutOfMemory();
  t_value[strlen(t_value) - 1] = '\0';
  *r_literal = (long)t_value;
}


x86 assembly (clang, -O0):
<MakeStringLiteral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1163 <MakeStringLiteral+0x33>
mov    $0x0,%al
call   1040 <Fatal_OutOfMemory@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeStringLiteral>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
add    $0x1,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <MakeStringLiteral+0x1f>
xor    %eax,%eax
call   1040 <Fatal_OutOfMemory@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @MakeStringLiteral(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = tail call i8* @strdup(i8* %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @Fatal_OutOfMemory()
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @strlen(i8* %4)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %4, i64 %11
store i8 0, i8* %12
%13 = ptrtoint i8* %4 to i64
store i64 %13, i64* %1
ret void
}
/* Type definitions */
struct pure_option {
  int dummy;
};
struct getopt_x {
  int dummy;
};

/* Variables and functions */
int getopt_x_prepare0(struct getopt_x *, int, char **, char const *,
                      struct pure_option *, char const *, int);
int getopt_x_prepare_verbose(struct getopt_x *state, int argc, char **argv,
                             const char *optstring,
                             struct pure_option *longopts, const char *optreq) {
  return getopt_x_prepare0(state, argc, argv, optstring, longopts, optreq, 1);
}


x86 assembly (clang, -O0):
<getopt_x_prepare_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
movl   $0x1,(%rsp)
call   1030 <getopt_x_prepare0@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_x_prepare_verbose>:
push   %rax
movl   $0x1,(%rsp)
call   1030 <getopt_x_prepare0@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.getopt_x = type { i32 }
%struct.pure_option = type { i32 }
define i32 @getopt_x_prepare_verbose(%struct.getopt_x* %0, i32 %1, i8** %2, i8* %3, %struct.pure_option* %4, i8* %5) {
%7 = alloca %struct.getopt_x*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca %struct.pure_option*
%12 = alloca i8*
store %struct.getopt_x* %0, %struct.getopt_x** %7
store i32 %1, i32* %8
store i8** %2, i8*** %9
store i8* %3, i8** %10
store %struct.pure_option* %4, %struct.pure_option** %11
store i8* %5, i8** %12
%13 = load %struct.getopt_x*, %struct.getopt_x** %7
%14 = load i32, i32* %8
%15 = load i8**, i8*** %9
%16 = load i8*, i8** %10
%17 = load %struct.pure_option*, %struct.pure_option** %11
%18 = load i8*, i8** %12
%19 = call i32 @getopt_x_prepare0(%struct.getopt_x* %13, i32 %14, i8** %15, i8* %16, %struct.pure_option* %17, i8* %18, i32 1)
ret i32 %19
}

LLVM IR (-O2):
%struct.getopt_x = type { i32 }
%struct.pure_option = type { i32 }
define i32 @getopt_x_prepare_verbose(%struct.getopt_x* %0, i32 %1, i8** %2, i8* %3, %struct.pure_option* %4, i8* %5) {
%7 = tail call i32 @getopt_x_prepare0(%struct.getopt_x* %0, i32 %1, i8** %2, i8* %3, %struct.pure_option* %4, i8* %5, i32 1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, unsigned int);
void bitstream_read_string(char **b, char *out_string, unsigned int len) {
  strncpy(out_string, (char *)*b, len);
  *b += len;
}


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

x86 assembly (clang, -O2):
<bitstream_read_string>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%rax
mov    %rdi,%r14
mov    (%rdi),%rsi
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    %ebx,%eax
add    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @bitstream_read_string(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i32, i32* %6
%11 = call i32 @strncpy(i8* %7, i8* %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8* %16, i8** %13
ret void
}

LLVM IR (-O2):
define void @bitstream_read_string(i8** nocapture %0, i8* %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @strncpy(i8* %1, i8* %4, i32 %2)
%6 = load i8*, i8** %0
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
double pow(double, int);
double functionTest1(double x) { return -1.0 * pow(x - 4.1, 2); }


x86 assembly (clang, -O0):
<functionTest1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionTest1>:
push   %rax
addsd  0xee7(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
xorpd  0xee5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @functionTest1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 4.100000e+00
%5 = call double @pow(double %4, i32 2)
%6 = fmul double -1.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @functionTest1(double %0) {
%2 = fadd double %0, -4.100000e+00
%3 = tail call double @pow(double %2, i32 2)
%4 = fneg double %3
ret double %4
}