xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
int getsockopt(int const, int /*<<< orphan*/, int /*<<< orphan*/, int *, int *);
int getSocketError(const int socket) {
  int optval = 0;
  socklen_t optlen = sizeof(optval);
  int retVal = getsockopt(socket, SOL_SOCKET, SO_ERROR, &optval, &optlen);
  if (retVal == -1) {
    return retVal;
  }
  return optval;
}


x86 assembly (clang, -O0):
<getSocketError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1163 <getSocketError+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <getSocketError+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSocketError>:
push   %rax
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
cmp    $0xffffffff,%eax
je     1147 <getSocketError+0x37>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @getSocketError(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp eq i32 %8, -1
%10 = load i32, i32* %2
%11 = select i1 %9, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
void *my_aligned_alloc(int, int);
void *t1_immediate1() { return my_aligned_alloc(320, 32); }


x86 assembly (clang, -O0):
<t1_immediate1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x140,%edi
mov    $0x20,%esi
call   1030 <my_aligned_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_immediate1>:
mov    $0x140,%edi
mov    $0x20,%esi
jmp    1030 <my_aligned_alloc@plt>

LLVM IR (-O0):
define i8* @t1_immediate1() {
%1 = call i8* @my_aligned_alloc(i32 320, i32 32)
ret i8* %1
}

LLVM IR (-O2):
define i8* @t1_immediate1() {
%1 = tail call i8* @my_aligned_alloc(i32 320, i32 32)
ret i8* %1
}
int rpc_accept_finish(int sd, void *info) { return 0; }


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

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

LLVM IR (-O0):
define i32 @rpc_accept_finish(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @rpc_accept_finish(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int Rand(int);
float Choose(float a, float b, float c) {
  int r = Rand(3);
  if (r == 0)
    return a;
  else if (r == 1)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<Choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    $0x3,%edi
call   1030 <Rand@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114d <Choose+0x3d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1170 <Choose+0x60>
cmpl   $0x1,-0x14(%rbp)
jne    1166 <Choose+0x56>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1170 <Choose+0x60>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Choose>:
sub    $0x18,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x14(%rsp)
mov    $0x3,%edi
call   1030 <Rand@plt>
movss  0x14(%rsp),%xmm0
test   %eax,%eax
je     1145 <Choose+0x35>
movss  0x10(%rsp),%xmm0
cmp    $0x1,%eax
jne    114a <Choose+0x3a>
add    $0x18,%rsp
ret
movss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define float @Choose(float %0, float %1, float %2) {
%4 = tail call i32 @Rand(i32 3)
switch i32 %4, label %6 [
i32 0, label %7
i32 1, label %5
]
5: ; preds = %3
br label %7
6: ; preds = %3
br label %7
7: ; preds = %3, %6, %5
%8 = phi float [ %1, %5 ], [ %2, %6 ], [ %0, %3 ]
ret float %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello, world!");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scc1();
void caller1() { scc1(); }


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

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

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

LLVM IR (-O2):
define void @caller1() {
%1 = tail call i32 (...) @scc1()
ret void
}
unsigned xrop3_143_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_143_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_143_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_143_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_143_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %5, -1
%7 = or i32 %6, %3
ret i32 %7
}
int rand_getrandres(void) { return 1024; }


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

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

LLVM IR (-O0):
define i32 @rand_getrandres() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @rand_getrandres() {
ret i32 1024
}
void StackCheck() {}


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

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

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

LLVM IR (-O2):
define void @StackCheck() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void header() {
  puts("----------------------------------------------------------");
  puts("| Hash Table Implementation (c) 2016 Michael P. Nitowski |");
  puts("----------------------------------------------------------");
}


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

x86 assembly (clang, -O2):
<header>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"----------------------------------------------------------\00"
@.str.1 = [59 x i8] c"| Hash Table Implementation (c) 2016 Michael P. Nitowski |\00"
define void @header() {
%1 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"----------------------------------------------------------\00"
@.str.1 = [59 x i8] c"| Hash Table Implementation (c) 2016 Michael P. Nitowski |\00"
define void @header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgetc(int /*<<< orphan*/ *);
unsigned short get_2(FILE *fp) {
  unsigned short result;
  result = (unsigned char)fgetc(fp) << 8;
  result |= (unsigned char)fgetc(fp);
  return result;
}


x86 assembly (clang, -O0):
<get_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movzbl %al,%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movzbl %al,%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    %rax,%rbx
shl    $0x8,%ebx
mov    %r14,%rdi
call   1030 <fgetc@plt>
movzbl %al,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i16 @get_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @fgetc(i32* %4)
%6 = trunc i64 %5 to i8
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 8
%9 = trunc i32 %8 to i16
store i16 %9, i16* %3
%10 = load i32*, i32** %2
%11 = call i64 @fgetc(i32* %10)
%12 = trunc i64 %11 to i8
%13 = zext i8 %12 to i32
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = or i32 %15, %13
%17 = trunc i32 %16 to i16
store i16 %17, i16* %3
%18 = load i16, i16* %3
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @get_2(i32* nocapture %0) {
%2 = tail call i64 @fgetc(i32* %0)
%3 = trunc i64 %2 to i16
%4 = shl i16 %3, 8
%5 = tail call i64 @fgetc(i32* %0)
%6 = trunc i64 %5 to i16
%7 = and i16 %6, 255
%8 = or i16 %7, %4
ret i16 %8
}
void PEM_write_bio_X509(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_write_bio_X509() {
ret void
}
/* Variables and functions */
void Reserved_Handler27(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler27>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler27+0x9>
jmp    1109 <Reserved_Handler27+0x9>

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

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

LLVM IR (-O2):
define void @Reserved_Handler27() {
br label %1
1: ; preds = %0, %1
br label %1
}
void foo() {
  int x = 1;
label:
  x = 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %0
store i32 2, i32* %1
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 ^ 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 3, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TXTOUT(char *);
void ITEMOUT(void) { TXTOUT("@item "); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"@item \00"
define void @ITEMOUT() {
%1 = call i32 @TXTOUT(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"@item \00"
define void @ITEMOUT() {
%1 = tail call i32 @TXTOUT(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ produce_dirs_below(char *);
int main(int argc, char *argv[]) {
  assert(argc == 2);
  produce_dirs_below(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <produce_dirs_below@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    0x8(%rbx),%rdi
call   1030 <produce_dirs_below@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @produce_dirs_below(i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @produce_dirs_below(i8* %7)
ret i32 0
}
int count(int n, int c, int m) {
  int i;
  int j = 0;
  int r;
  j = n / c;
  n = j;
  while (n >= m) {
    j += n / m;
    r = n % m;
    n = n / m;
    n = n + r;
  }
  return j;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     115f <count+0x5f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <count+0x24>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%edx
cmp    %ecx,%eax
jge    1110 <count+0x10>
mov    %edx,%eax
ret
mov    %edx,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edx,%eax
cltd
idiv   %ecx
add    %eax,%esi
add    %eax,%edx
cmp    %ecx,%edx
jge    1120 <count+0x20>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @count(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %8
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
store i32 %12, i32* %8
%13 = load i32, i32* %8
store i32 %13, i32* %4
br label %14
14: ; preds = %18, %3
%15 = load i32, i32* %4
%16 = load i32, i32* %6
%17 = icmp sge i32 %15, %16
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = sdiv i32 %19, %20
%22 = load i32, i32* %8
%23 = add nsw i32 %22, %21
store i32 %23, i32* %8
%24 = load i32, i32* %4
%25 = load i32, i32* %6
%26 = srem i32 %24, %25
store i32 %26, i32* %9
%27 = load i32, i32* %4
%28 = load i32, i32* %6
%29 = sdiv i32 %27, %28
store i32 %29, i32* %4
%30 = load i32, i32* %4
%31 = load i32, i32* %9
%32 = add nsw i32 %30, %31
store i32 %32, i32* %4
br label %14
33: ; preds = %14
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @count(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, %1
%5 = icmp slt i32 %4, %2
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ %4, %3 ]
%8 = phi i32 [ %10, %6 ], [ %4, %3 ]
%9 = sdiv i32 %7, %2
%10 = add nsw i32 %9, %8
%11 = srem i32 %7, %2
%12 = add nsw i32 %11, %9
%13 = icmp slt i32 %12, %2
br i1 %13, label %14, label %6
14: ; preds = %6, %3
%15 = phi i32 [ %4, %3 ], [ %10, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: bloopsawhat notes\n"
         " (ex.: bloopsawhat \"a b c d e f g + a b c\"\n");
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"usage: bloopsawhat notes\0A (ex.: bloopsawhat \22a b c d e f g + a b c\22\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"usage: bloopsawhat notes\0A (ex.: bloopsawhat \22a b c d e f g + a b c\22\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
ret void
}
int use_system_dma(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @use_system_dma() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DeleteLambdamaxData(void *lambdaattr) { free(lambdaattr); }


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

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

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

LLVM IR (-O2):
define void @DeleteLambdamaxData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
float f(float x) { return x - x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
subss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fsub float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fsub float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tek_text(void) { printf("\033[?38l"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?38l\00"
define void @tek_text() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?38l\00"
define void @tek_text() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ free_bucket_real(char const *, int);
uint64_t free_bucket(const char *bucketpath) {
  return free_bucket_real(bucketpath, true);
}


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

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

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

LLVM IR (-O2):
define i32 @free_bucket(i8* %0) {
%2 = tail call i32 @free_bucket_real(i8* %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rdmsr(int);
uint64_t apic_get_base(void) { return (rdmsr(0x1b) & 0xffffff000ULL); }


x86 assembly (clang, -O0):
<apic_get_base>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <rdmsr@plt>
cltq
movabs $0xffffff000,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<apic_get_base>:
push   %rax
mov    $0x1b,%edi
call   1030 <rdmsr@plt>
and    $0xfffff000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @apic_get_base() {
%1 = call i32 @rdmsr(i32 27)
%2 = sext i32 %1 to i64
%3 = and i64 %2, 68719472640
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @apic_get_base() {
%1 = tail call i32 @rdmsr(i32 27)
%2 = and i32 %1, -4096
ret i32 %2
}
int f2(int x, int y) { return x - y + 2; }


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

x86 assembly (clang, -O2):
<f2>:
sub    %esi,%edi
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = add i32 %0, 2
%4 = sub i32 %3, %1
ret i32 %4
}
int fun517() { return 517; }


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

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

LLVM IR (-O0):
define i32 @fun517() {
ret i32 517
}

LLVM IR (-O2):
define i32 @fun517() {
ret i32 517
}
/* Variables and functions */
int /*<<< orphan*/ iexit();
int /*<<< orphan*/ iwrites(char *);
int main() {
  iwrites("Hello World!\n");
  iexit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <iwrites@plt>
mov    $0x0,%al
call   1040 <iexit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <iwrites@plt>
xor    %eax,%eax
call   1040 <iexit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = call i32 @iwrites(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @iexit()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = tail call i32 @iwrites(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @iexit()
ret i32 0
}
/* Variables and functions */
int rand();
int get_rand(int min, int max) { return rand() % max + min; }


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_rand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_rand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int isupper(int);
int iswupper(wint_t c) { return c <= 255 ? isupper(c) : 0; }


x86 assembly (clang, -O0):
<iswupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1138 <iswupper+0x28>
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
mov    %eax,-0x8(%rbp)
jmp    1142 <iswupper+0x32>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <iswupper+0x32>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswupper>:
cmp    $0xff,%edi
jg     111d <iswupper+0xd>
jmp    1030 <isupper@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 255
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @isupper(i32 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iswupper(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @isupper(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, int *);
int readNumber() {
  int *digit = (int *)malloc(sizeof(int));
  scanf("%d", digit);
  return *digit;
}


x86 assembly (clang, -O0):
<readNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNumber>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1040 <scanf@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @readNumber() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @readNumber() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
ret i32 %4
}
int do_568() { return 568; }


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

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

LLVM IR (-O0):
define i32 @do_568() {
ret i32 568
}

LLVM IR (-O2):
define i32 @do_568() {
ret i32 568
}
int foo(int i) {
  if (i > 0) {
    i = i - 1;
    foo(i);
    return i;
  }
  return 10;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1141 <foo+0x31>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <foo+0x38>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0x1(%rdi),%ecx
test   %edi,%edi
mov    $0xa,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add i32 %0, -1
%4 = select i1 %2, i32 %3, i32 10
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void libdha_exit(const char *message, int level) {
  printf("libdha: FATAL: %s\n", message);
  exit(level);
}


x86 assembly (clang, -O0):
<libdha_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<libdha_exit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"libdha: FATAL: %s\0A\00"
define void @libdha_exit(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 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"libdha: FATAL: %s\0A\00"
define void @libdha_exit(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sqrt(double);
int main(int argc, char *argv[]) {
  double x = sqrt(2.0);
  printf("sqrt(2.0) = %f\n", x);
  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)
movsd  0xec2(%rip),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"sqrt(2.0) = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call double @sqrt(double 2.000000e+00)
store double %7, double* %6
%8 = load double, double* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"sqrt(2.0) = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 0x3FF6A09E667F3BCD)
ret i32 0
}
/* Variables and functions */
unsigned long labs(long);
__attribute__((unused)) long getmvalue(long val, unsigned long mask,
                                       int signext) {
  long result;
  result = labs(val) & mask;
  return (signext && (val < 0) ? -result : result);
}


x86 assembly (clang, -O0):
<getmvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
and    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1158 <getmvalue+0x48>
cmpq   $0x0,-0x8(%rbp)
jge    1158 <getmvalue+0x48>
xor    %eax,%eax
sub    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1160 <getmvalue+0x50>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmvalue>:
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
and    %rsi,%rcx
mov    %rcx,%rax
neg    %rax
test   %edx,%edx
cmove  %rcx,%rax
test   %rdi,%rdi
cmovns %rcx,%rax
ret

LLVM IR (-O0):
define i64 @getmvalue(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = call i64 @labs(i64 %8)
%10 = load i64, i64* %5
%11 = and i64 %9, %10
store i64 %11, i64* %7
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %3
%15 = load i64, i64* %4
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i64, i64* %7
%19 = sub nsw i64 0, %18
br label %22
20: ; preds = %14, %3
%21 = load i64, i64* %7
br label %22
22: ; preds = %20, %17
%23 = phi i64 [ %19, %17 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @getmvalue(i64 %0, i64 %1, i32 %2) {
%4 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%5 = and i64 %4, %1
%6 = icmp ne i32 %2, 0
%7 = icmp slt i64 %0, 0
%8 = and i1 %7, %6
%9 = sub nsw i64 0, %5
%10 = select i1 %8, i64 %9, i64 %5
ret i64 %10
}
int is_restart_error(struct tcb *tcp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @is_restart_error(%struct.tcb* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
char *basename(const char *filename) {
  char *p = strrchr(filename, '/');
  return p ? p + 1 : (char *)filename;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(struct tm *, struct tm const *, int);
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
void copy_tm_to_TM64(const struct tm *src, struct tm *dest) {
  if (src == NULL) {
    memset(dest, 0, sizeof(*dest));
  } else {
    memcpy(dest, src, sizeof(*dest));
  }
}


x86 assembly (clang, -O0):
<copy_tm_to_TM64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1150 <copy_tm_to_TM64+0x30>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
jmp    1162 <copy_tm_to_TM64+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_tm_to_TM64>:
test   %rdi,%rdi
je     1138 <copy_tm_to_TM64+0x18>
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1040 <memcpy@plt>
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x4,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @copy_tm_to_TM64(%struct.tm* %0, %struct.tm* %1) {
%3 = icmp eq %struct.tm* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @memset(%struct.tm* %1, i32 0, i32 4)
br label %8
6: ; preds = %2
%7 = tail call i32 @memcpy(%struct.tm* %1, %struct.tm* %0, i32 4)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_reassociate(struct wpa_ctrl *ctrl, int argc,
                            const char *argv[]) {
  return wpa_ctrl_command(ctrl, "REASSOCIATE");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_reassociate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_reassociate>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"REASSOCIATE\00"
define i32 @wpa_cli_cmd_reassociate(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"REASSOCIATE\00"
define i32 @wpa_cli_cmd_reassociate(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
int security_sb_mount(char *dev_name, struct nameidata *nd, char *type,
                      unsigned long flags, void *data) {
  return 0;
}


x86 assembly (clang, -O0):
<security_sb_mount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.nameidata = type opaque
define i32 @security_sb_mount(i8* %0, %struct.nameidata* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca %struct.nameidata*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store %struct.nameidata* %1, %struct.nameidata** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
%struct.nameidata = type opaque
define i32 @security_sb_mount(i8* nocapture readnone %0, %struct.nameidata* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i8* nocapture readnone %4) {
ret i32 0
}
/* Type definitions */
struct utimeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ utimeval_less_than_yas530(struct utimeval *,
                                             struct utimeval *);
int utimeval_greater_or_equal_yas530(struct utimeval *first,
                                     struct utimeval *second) {
  return !utimeval_less_than_yas530(first, second);
}


x86 assembly (clang, -O0):
<utimeval_greater_or_equal_yas530>:
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 <utimeval_less_than_yas530@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.utimeval = type { i32 }
define i32 @utimeval_greater_or_equal_yas530(%struct.utimeval* %0, %struct.utimeval* %1) {
%3 = alloca %struct.utimeval*
%4 = alloca %struct.utimeval*
store %struct.utimeval* %0, %struct.utimeval** %3
store %struct.utimeval* %1, %struct.utimeval** %4
%5 = load %struct.utimeval*, %struct.utimeval** %3
%6 = load %struct.utimeval*, %struct.utimeval** %4
%7 = call i32 @utimeval_less_than_yas530(%struct.utimeval* %5, %struct.utimeval* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.utimeval = type { i32 }
define i32 @utimeval_greater_or_equal_yas530(%struct.utimeval* %0, %struct.utimeval* %1) {
%3 = tail call i32 @utimeval_less_than_yas530(%struct.utimeval* %0, %struct.utimeval* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned short htons(unsigned short);
unsigned short host_short_to_network(unsigned short x) { return htons(x); }


x86 assembly (clang, -O0):
<host_short_to_network>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <htons@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_short_to_network>:
jmp    1030 <htons@plt>

LLVM IR (-O0):
define zeroext i16 @host_short_to_network(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @htons(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @host_short_to_network(i16 zeroext %0) {
%2 = tail call zeroext i16 @htons(i16 zeroext %0)
ret i16 %2
}