xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setSocket(int *sockete) {
  *sockete = socket(AF_INET, SOCK_STREAM, 0);
  if (&sockete < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<setSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x10(%rbp),%rax
cmp    $0x0,%rax
jae    1157 <setSocket+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <setSocket+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSocket>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @setSocket(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32, i32* @AF_INET
%5 = load i32, i32* @SOCK_STREAM
%6 = call i32 @socket(i32 %4, i32 %5, i32 0)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = icmp ult i32** %3, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @setSocket(i32* nocapture writeonly %0) {
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %0
ret i32 0
}
int fusion_uchar(unsigned char *p) { return p[0x12345]; }


x86 assembly (clang, -O0):
<fusion_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x12345(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fusion_uchar>:
movzbl 0x12345(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fusion_uchar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 74565
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fusion_uchar(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 74565
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ swift_inv_data_tag(unsigned long);
int /*<<< orphan*/ swift_inv_insn_tag(unsigned long);
void swift_idflash_clear(void) {
  unsigned long addr;
  for (addr = 0; addr < 0x2000; addr += 0x10) {
    swift_inv_insn_tag(addr << 1);
    swift_inv_data_tag(addr);
  }
}


x86 assembly (clang, -O0):
<swift_idflash_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x2000,-0x8(%rbp)
jae    1165 <swift_idflash_clear+0x45>
mov    -0x8(%rbp),%rdi
shl    $0x1,%rdi
call   1040 <swift_inv_insn_tag@plt>
mov    -0x8(%rbp),%rdi
call   1030 <swift_inv_data_tag@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <swift_idflash_clear+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swift_idflash_clear>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffffffffff0,%rbx
xor    %r14d,%r14d
xchg   %ax,%ax
add    $0x10,%rbx
mov    %r14,%rdi
call   1040 <swift_inv_insn_tag@plt>
mov    %rbx,%rdi
call   1030 <swift_inv_data_tag@plt>
add    $0x20,%r14
cmp    $0x1ff0,%rbx
jb     1130 <swift_idflash_clear+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @swift_idflash_clear() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %11, %0
%3 = load i64, i64* %1
%4 = icmp ult i64 %3, 8192
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = load i64, i64* %1
%7 = shl i64 %6, 1
%8 = call i32 @swift_inv_insn_tag(i64 %7)
%9 = load i64, i64* %1
%10 = call i32 @swift_inv_data_tag(i64 %9)
br label %11
11: ; preds = %5
%12 = load i64, i64* %1
%13 = add i64 %12, 16
store i64 %13, i64* %1
br label %2
14: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @swift_idflash_clear() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = shl nuw nsw i64 %2, 1
%4 = tail call i32 @swift_inv_insn_tag(i64 %3)
%5 = tail call i32 @swift_inv_data_tag(i64 %2)
%6 = add nuw nsw i64 %2, 16
%7 = icmp ult i64 %2, 8176
br i1 %7, label %1, label %8
8: ; preds = %1
ret void
}
int cmp(const void *a, const void *b) {
  int c = *(int *)a;
  int d = *(int *)b;
  if (c < d) {
    return -1;
  } else if (c == d) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <cmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <cmp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <cmp+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int PECIDomainValid(unsigned long);
void PECIDomainValueClear(unsigned long ulBase, unsigned long ulDomain) {
  DEBUG_ASSERT(ulBase == 0x400B0000);
  DEBUG_ASSERT(PECIDomainValid(ulDomain));
  (*((volatile unsigned long *)(ulBase + 0x00000040 + (ulDomain * 4)))) &=
      ~0x0000FFFF;
}


x86 assembly (clang, -O0):
<PECIDomainValueClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rcx
and    $0xffffffffffff0000,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainValueClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400b0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
andq   $0xffffffffffff0000,0x40(%rbx,%r14,4)
ff ff
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PECIDomainValueClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074462720
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @PECIDomainValid(i64 %9)
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %3
%13 = add i64 %12, 64
%14 = load i64, i64* %4
%15 = mul i64 %14, 4
%16 = add i64 %13, %15
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = and i64 %18, -65536
store volatile i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @PECIDomainValueClear(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074462720
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @PECIDomainValid(i64 %1)
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = add i64 %0, 64
%9 = shl i64 %1, 2
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, -65536
store volatile i64 %13, i64* %11
ret void
}
int test_imm_B8int64_lowword_mem(long long *val) {
  return ((*val) & (0xB8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B8int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int car(int *twoInts) { return *twoInts; }


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

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

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

LLVM IR (-O2):
define i32 @car(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int carlosFn(int x, int y) { return -100 * x + y * y * y; }


x86 assembly (clang, -O0):
<carlosFn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xffffff9c,-0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carlosFn>:
imul   $0xffffff9c,%edi,%ecx
mov    %esi,%eax
imul   %esi,%eax
imul   %esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @carlosFn(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 = mul nsw i32 -100, %5
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @carlosFn(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, -100
%4 = mul nsw i32 %1, %1
%5 = mul nsw i32 %4, %1
%6 = add nsw i32 %5, %3
ret i32 %6
}
int test1(const char *p) { return (int)(*p); }


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

x86 assembly (clang, -O2):
<test1>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fread(void *, size_t, int, void *);
void default_read(void *stream, void *out, size_t count) {
  fread(out, count, 1, stream);
}


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

x86 assembly (clang, -O2):
<default_read>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
jmp    1030 <fread@plt>

LLVM IR (-O0):
define void @default_read(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i8*, i8** %4
%10 = call i32 @fread(i8* %7, i64 %8, i32 1, i8* %9)
ret void
}

LLVM IR (-O2):
define void @default_read(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @fread(i8* %1, i64 %2, i32 1, i8* %0)
ret void
}
int iscntrl(int c) { return c == 0 || c == 0x1f || c == 0x7f; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iscntrl+0x2f>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iscntrl+0x2f>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
mov    $0x1,%eax
test   %edi,%edi
je     110e <iscntrl+0xe>
cmp    $0x1f,%edi
jne    110f <iscntrl+0xf>
ret
xor    %eax,%eax
cmp    $0x7f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
switch i32 %0, label %2 [
i32 31, label %5
i32 0, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 127
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int const double_to_d22(double);
int rot_key(double a) {
  const int m = double_to_d22(360.0);
  return double_to_d22(a) % m;
}


x86 assembly (clang, -O0):
<rot_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
call   1030 <double_to_d22@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <double_to_d22@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot_key>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xedd(%rip),%xmm0
call   1030 <double_to_d22@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <double_to_d22@plt>
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rot_key(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = call i32 @double_to_d22(double 3.600000e+02)
store i32 %4, i32* %3
%5 = load double, double* %2
%6 = call i32 @double_to_d22(double %5)
%7 = load i32, i32* %3
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rot_key(double %0) {
%2 = tail call i32 @double_to_d22(double 3.600000e+02)
%3 = tail call i32 @double_to_d22(double %0)
%4 = srem i32 %3, %2
ret i32 %4
}
int ffsl(long int mask) { return __builtin_ffsl(mask); }


x86 assembly (clang, -O0):
<ffsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsl>:
bsf    %rdi,%rcx
add    $0x1,%ecx
xor    %eax,%eax
test   %rdi,%rdi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ffsl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = add i64 %4, 1
%6 = icmp eq i64 %3, 0
%7 = select i1 %6, i64 0, i64 %5
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ffsl(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = icmp eq i64 %0, 0
%4 = trunc i64 %2 to i32
%5 = add nuw nsw i32 %4, 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xbutton_y(void *_p, int _v) {
  ((XEvent *)_p)->xbutton.y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xbutton_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xbutton_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xbutton_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int test(int argc, void *argv[]) {
  printf("%s\n", argv[0]);
  printf("%d\n", *(int *)argv[1]);
  return 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @test(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @test(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = bitcast i8** %5 to i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ entab(int *);
int /*<<< orphan*/ settab(int, char **, int *);
int main(int argc, char *argv[]) {
  int tab[100];
  settab(argc, argv, tab);
  entab(tab);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x1a0(%rbp),%rdx
call   1030 <settab@plt>
lea    -0x1a0(%rbp),%rdi
call   1040 <entab@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1030 <settab@plt>
mov    %rbx,%rdi
call   1040 <entab@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [100 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%9 = call i32 @settab(i32 %6, i8** %7, i32* %8)
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%11 = call i32 @entab(i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%6 = call i32 @settab(i32 %0, i8** %1, i32* %5)
%7 = call i32 @entab(i32* %5)
ret i32 0
}
/* Variables and functions */
uintptr_t __align_up(uintptr_t __p, uintptr_t __a) {
  return (__p + __a - 1) & ~(__a - 1);
}


x86 assembly (clang, -O0):
<__align_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__align_up>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @__align_up(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @__align_up(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ readlink(char *, char *, size_t);
int /*<<< orphan*/ sprintf(char *, char *, int);
ssize_t getcwd_by_pid(pid_t pid, char *buf, size_t bufsiz) {
  char link[128];
  sprintf(link, "/proc/%d/cwd", pid);
  return readlink(link, buf, bufsiz);
}


x86 assembly (clang, -O0):
<getcwd_by_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <readlink@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd_by_pid>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xec5(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <readlink@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/proc/%d/cwd\00"
define i32 @getcwd_by_pid(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [128 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @readlink(i8* %11, i8* %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"/proc/%d/cwd\00"
define i32 @getcwd_by_pid(i32 %0, i8* nocapture %1, i64 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @readlink(i8* %5, i8* %1, i64 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, char *);
int getpid();
int /*<<< orphan*/ stdout;
char **sys_siglist;
void gestionnaire(int numero) {
  fprintf(stdout, "\n%u a recu le signal %d (%s)\n", getpid(), numero,
          sys_siglist[numero]);
}


x86 assembly (clang, -O0):
<gestionnaire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
mov    -0x4(%rbp),%ecx
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
movslq -0x4(%rbp),%rsi
mov    (%rax,%rsi,8),%r8
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gestionnaire>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eac(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eac(%rip),%rcx
mov    (%rcx),%rdx
movslq %ebx,%rcx
mov    (%rdx,%rcx,8),%r8
lea    0xeb3(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [30 x i8] c"\0A%u a recu le signal %d (%s)\0A\00"
@sys_siglist = global i8** null
define void @gestionnaire(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 (...) @getpid()
%5 = load i32, i32* %2
%6 = load i8**, i8*** @sys_siglist
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %6, i64 %8
%10 = load i8*, i8** %9
%11 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [30 x i8] c"\0A%u a recu le signal %d (%s)\0A\00"
@sys_siglist = global i8** null
define void @gestionnaire(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (...) @getpid()
%4 = load i8**, i8*** @sys_siglist
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8*, i8** %4, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %0, i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatalf(char *, int);
int digitsBaseTen(int x) {
  int digCount;
  if (x < 0)
    fatalf("digitsBaseTen: negative argument %d", x);
  for (digCount = 1; x >= 10; x /= 10, ++digCount)
    ;
  return digCount;
}


x86 assembly (clang, -O0):
<digitsBaseTen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1134 <digitsBaseTen+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <fatalf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1166 <digitsBaseTen+0x56>
jmp    114a <digitsBaseTen+0x3a>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <digitsBaseTen+0x2b>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitsBaseTen>:
mov    %edi,%esi
test   %edi,%edi
js     1145 <digitsBaseTen+0x35>
mov    $0x1,%eax
cmp    $0xa,%esi
jb     1144 <digitsBaseTen+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
nopw   0x0(%rax,%rax,1)
mov    %esi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%esi
mov    %edx,%esi
ja     1130 <digitsBaseTen+0x20>
ret
push   %rax
lea    0xeb3(%rip),%rdi
call   1030 <fatalf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"digitsBaseTen: negative argument %d\00"
define i32 @digitsBaseTen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @fatalf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
store i32 1, i32* %3
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 10
br i1 %12, label %13, label %19
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 10
store i32 %16, i32* %2
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %10
19: ; preds = %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [36 x i8] c"digitsBaseTen: negative argument %d\00"
define i32 @digitsBaseTen(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @fatalf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %13
5: ; preds = %1
%6 = icmp ugt i32 %0, 9
br i1 %6, label %7, label %13
7: ; preds = %5, %7
%8 = phi i32 [ %11, %7 ], [ 1, %5 ]
%9 = phi i32 [ %10, %7 ], [ %0, %5 ]
%10 = udiv i32 %9, 10
%11 = add nuw nsw i32 %8, 1
%12 = icmp ugt i32 %9, 99
br i1 %12, label %7, label %13
13: ; preds = %7, %3, %5
%14 = phi i32 [ 1, %5 ], [ 1, %3 ], [ %11, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ query;

/* Variables and functions */
char runResultlessQuery(char *, int);
char incrementLastReviewTime() {
  char query[] = "UPDATE GLOBAL SET lastReviewed = lastReviewed+1";
  return runResultlessQuery(query, sizeof(query));
}


x86 assembly (clang, -O0):
<incrementLastReviewTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x30,%esi
call   1040 <runResultlessQuery@plt>
movsbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incrementLastReviewTime>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x30,%esi
call   1030 <runResultlessQuery@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.incrementLastReviewTime.query = [48 x i8] c"UPDATE GLOBAL SET lastReviewed = lastReviewed+1\00"
define signext i8 @incrementLastReviewTime() {
%1 = alloca [48 x i8]
%2 = bitcast [48 x i8]* %1 to i8*
%3 = getelementptr inbounds [48 x i8], [48 x i8]* %1, i64 0, i64 0
%4 = call signext i8 @runResultlessQuery(i8* %3, i32 48)
ret i8 %4
}

LLVM IR (-O2):
@__const.incrementLastReviewTime.query = [48 x i8] c"UPDATE GLOBAL SET lastReviewed = lastReviewed+1\00"
define signext i8 @incrementLastReviewTime() {
%1 = alloca [48 x i8]
%2 = getelementptr inbounds [48 x i8], [48 x i8]* %1, i64 0, i64 0
%3 = call signext i8 @runResultlessQuery(i8* %2, i32 48)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *xmalloc(size_t sz) {
  void *x = malloc(sz);
  if (!x)
    err(1, "malloc()");
  return x;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xmalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"malloc()\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"malloc()\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void integrator_ias15_synchronize(void) {}


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

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

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

LLVM IR (-O2):
define void @integrator_ias15_synchronize() {
ret void
}
int hashfunc(int value) { return value % 10; }


x86 assembly (clang, -O0):
<hashfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfunc>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashfunc(i32 %0) {
%2 = srem i32 %0, 10
ret i32 %2
}
/* Type definitions */
struct sg_io_hdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sg_io_hdr *);
void destroy_io_hdr(struct sg_io_hdr *p_hdr) {
  if (p_hdr) {
    free(p_hdr);
  }
}


x86 assembly (clang, -O0):
<destroy_io_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <destroy_io_hdr+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_io_hdr>:
test   %rdi,%rdi
je     111a <destroy_io_hdr+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.sg_io_hdr = type { i32 }
define void @destroy_io_hdr(%struct.sg_io_hdr* %0) {
%2 = alloca %struct.sg_io_hdr*
store %struct.sg_io_hdr* %0, %struct.sg_io_hdr** %2
%3 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%4 = icmp ne %struct.sg_io_hdr* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%7 = call i32 @free(%struct.sg_io_hdr* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.sg_io_hdr = type { i32 }
define void @destroy_io_hdr(%struct.sg_io_hdr* %0) {
%2 = icmp eq %struct.sg_io_hdr* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.sg_io_hdr* %0)
br label %5
5: ; preds = %3, %1
ret void
}
__attribute__((always_)) int
memmap_valid_within(unsigned long pfn, struct page *page, struct zone *zone) {
  return 1;
}


x86 assembly (clang, -O0):
<memmap_valid_within>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.page = type opaque
%struct.zone = type opaque
define i32 @memmap_valid_within(i64 %0, %struct.page* %1, %struct.zone* %2) {
%4 = alloca i64
%5 = alloca %struct.page*
%6 = alloca %struct.zone*
store i64 %0, i64* %4
store %struct.page* %1, %struct.page** %5
store %struct.zone* %2, %struct.zone** %6
ret i32 1
}

LLVM IR (-O2):
%struct.page = type opaque
%struct.zone = type opaque
define i32 @memmap_valid_within(i64 %0, %struct.page* nocapture readnone %1, %struct.zone* nocapture readnone %2) {
ret i32 1
}
/* Variables and functions */
int rand();
int randIntervalle(int deb, int fin) {
  return (rand() % (fin - deb + 1) + deb);
}


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

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

LLVM IR (-O0):
define i32 @randIntervalle(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 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randIntervalle(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cblByteOrderSwap32(int /*<<< orphan*/);
uint32_t cblByteOrderSwap32HostToBig(uint32_t swap) {
  return cblByteOrderSwap32(swap);
}


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

x86 assembly (clang, -O2):
<cblByteOrderSwap32HostToBig>:
jmp    1030 <cblByteOrderSwap32@plt>

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

LLVM IR (-O2):
define i32 @cblByteOrderSwap32HostToBig(i32 %0) {
%2 = tail call i32 @cblByteOrderSwap32(i32 %0)
ret i32 %2
}
unsigned xrop3_3_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T | S;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_3_1_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    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_3_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
void pobierz_dane(int *a, int *b, int *c) { scanf("%d %d %d", a, b, c); }


x86 assembly (clang, -O0):
<pobierz_dane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
call   1030 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pobierz_dane>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <scanf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define void @pobierz_dane(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1, i32* %2)
ret void
}
float clear_traces_f(float a, float b, float c, float d, float e, float f,
                     float g, float h, float i, float j, float k, float l,
                     float m, float n, float o, float p) {
  return 0.0;
}


x86 assembly (clang, -O0):
<clear_traces_f>:
push   %rbp
mov    %rsp,%rbp
movss  0x48(%rbp),%xmm8
movss  0x40(%rbp),%xmm8
movss  0x38(%rbp),%xmm8
movss  0x30(%rbp),%xmm8
movss  0x28(%rbp),%xmm8
movss  0x20(%rbp),%xmm8
movss  0x18(%rbp),%xmm8
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_traces_f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @clear_traces_f(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13, float %14, float %15) {
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
%31 = alloca float
%32 = alloca float
store float %0, float* %17
store float %1, float* %18
store float %2, float* %19
store float %3, float* %20
store float %4, float* %21
store float %5, float* %22
store float %6, float* %23
store float %7, float* %24
store float %8, float* %25
store float %9, float* %26
store float %10, float* %27
store float %11, float* %28
store float %12, float* %29
store float %13, float* %30
store float %14, float* %31
store float %15, float* %32
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @clear_traces_f(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13, float %14, float %15) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ cleanup(int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void ensure(int test, const char *message) {
  if (!test) {
    fputs(message, stderr);
    cleanup(-1);
  }
}


x86 assembly (clang, -O0):
<ensure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1155 <ensure+0x35>
mov    -0x10(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0xffffffff,%edi
call   1040 <cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure>:
test   %edi,%edi
je     1125 <ensure+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1040 <cleanup@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @ensure(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* %8, i32 %9)
%11 = call i32 @cleanup(i32 -1)
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @ensure(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* %1, i32 %5)
%7 = tail call i32 @cleanup(i32 -1)
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int f();
test() { short(**x)[][f()]; }


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

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca [0 x i16]**
%3 = call i32 (...) @f()
%4 = zext i32 %3 to i64
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @f()
ret i32 undef
}
void glutEntryFunc(void (*func)(int state)) {}


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

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

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

LLVM IR (-O2):
define void @glutEntryFunc(void (i32)* nocapture %0) {
ret void
}
short dfn_rs() { return 2; }


x86 assembly (clang, -O0):
<dfn_rs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfn_rs>:
mov    $0x2,%ax
ret

LLVM IR (-O0):
define signext i16 @dfn_rs() {
ret i16 2
}

LLVM IR (-O2):
define signext i16 @dfn_rs() {
ret i16 2
}
/* Variables and functions */
int solve_degree_3(double const *, double *);
int polynomial_solve_degree_3(const double *c, double *x) {
  return solve_degree_3(c, x);
}


x86 assembly (clang, -O0):
<polynomial_solve_degree_3>:
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 <solve_degree_3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polynomial_solve_degree_3>:
jmp    1030 <solve_degree_3@plt>

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

LLVM IR (-O2):
define i32 @polynomial_solve_degree_3(double* %0, double* %1) {
%3 = tail call i32 @solve_degree_3(double* %0, double* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo(int);
int main() {
  if (foo(1) != 0x1.fffep31)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeba(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    115b <main+0x3b>
jp     115b <main+0x3b>
jmp    1162 <main+0x42>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0xffff0000,%ecx
cmp    %rcx,%rax
jne    1139 <main+0x19>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(i32 1)
%3 = sitofp i64 %2 to double
%4 = fcmp une double %3, 0x41EFFFE000000000
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 1)
%2 = icmp eq i64 %1, 4294901760
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}