xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, int);
void *celt_alloc_scratch(int size) { return calloc(size, 1); }


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

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

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

LLVM IR (-O2):
define noalias i8* @celt_alloc_scratch(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
scalar_t__ fmodf(float, float);
int /*<<< orphan*/ link_failure_fmodf();
void test_fmodf(float f1, float f2) {
  if (fmodf(f1, f2) != fmodf(f1, f2))
    link_failure_fmodf();
}


x86 assembly (clang, -O0):
<test_fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmodf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmodf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_fmodf+0x4b>
mov    $0x0,%al
call   1040 <link_failure_fmodf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmodf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <fmodf@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <fmodf@plt>
cmp    %rax,%rbx
jne    1155 <test_fmodf+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_fmodf@plt>

LLVM IR (-O0):
define void @test_fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @fmodf(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call i64 @fmodf(float %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_fmodf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_fmodf(float %0, float %1) {
%3 = tail call i64 @fmodf(float %0, float %1)
%4 = tail call i64 @fmodf(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_fmodf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initgui_(int *, int *, int *, int *, int *, char *);
void initgui(int *model, int *debug, int *lats, int *mrpid, int *mrnum,
             char *plan) {
  initgui_(model, debug, lats, mrpid, mrnum, plan);
}


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

x86 assembly (clang, -O2):
<initgui>:
jmp    1030 <initgui_@plt>

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

LLVM IR (-O2):
define void @initgui(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i8* %5) {
%7 = tail call i32 @initgui_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i8* %5)
ret void
}
void foo275(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo275(i32 %0) {
ret void
}
int test_imm_56uint8_mem(unsigned char *val) {
  return ((*val) & (-0x56 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_56uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -86
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
unsigned int load_runtime_reg(unsigned int, int);
int /*<<< orphan*/ store_runtime_reg(unsigned int, int, unsigned int);
void I2OFIFOOverflowIntEnable(unsigned int eumbbar) {
  unsigned int val = load_runtime_reg(eumbbar, 0x0104);
  val &= 0xfffffe7f;
  store_runtime_reg(eumbbar, 0x0104, val);
}


x86 assembly (clang, -O0):
<I2OFIFOOverflowIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x104,%esi
call   1040 <load_runtime_reg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffe7f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x104,%esi
call   1030 <store_runtime_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2OFIFOOverflowIntEnable>:
push   %rbx
mov    %edi,%ebx
mov    $0x104,%esi
call   1040 <load_runtime_reg@plt>
and    $0xfffffe7f,%eax
mov    %ebx,%edi
mov    $0x104,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <store_runtime_reg@plt>

LLVM IR (-O0):
define void @I2OFIFOOverflowIntEnable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @load_runtime_reg(i32 %4, i32 260)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, -385
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @store_runtime_reg(i32 %8, i32 260, i32 %9)
ret void
}

LLVM IR (-O2):
define void @I2OFIFOOverflowIntEnable(i32 %0) {
%2 = tail call i32 @load_runtime_reg(i32 %0, i32 260)
%3 = and i32 %2, -385
%4 = tail call i32 @store_runtime_reg(i32 %0, i32 260, i32 %3)
ret void
}
int fn5(event)
struct _XEvent *event;
{
  fn3(0, 0, 0);
}


x86 assembly (clang, -O0):
<fn5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
mov    $0x0,%al
call   1030 <fn3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn5>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <fn3@plt>

LLVM IR (-O0):
%struct._XEvent = type opaque
define i32 @fn5(%struct._XEvent* %0) {
%2 = alloca i32
%3 = alloca %struct._XEvent*
store %struct._XEvent* %0, %struct._XEvent** %3
%4 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @fn3 to i32 (i32, i32, i32, ...)*)(i32 0, i32 0, i32 0)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
%struct._XEvent = type opaque
define i32 @fn5(%struct._XEvent* nocapture readnone %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @fn3 to i32 (i32, i32, i32, ...)*)(i32 0, i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *nmalloc(size_t);
char *measured_copy(const char *string, size_t count) {
  char *thecopy = nmalloc(count + 1);
  memcpy(thecopy, string, count);
  thecopy[count] = '\0';
  return thecopy;
}


x86 assembly (clang, -O0):
<measured_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <nmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measured_copy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1030 <nmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @measured_copy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @nmalloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @measured_copy(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @nmalloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}
spc() {}


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

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

LLVM IR (-O0):
define i32 @spc() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @spc() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Write_LCD(int, char *, int);
void Disable_Pixel(int fd, int x, int y) {
  char cmd[] = {254, 113, 0, 0, 253};
  cmd[2] = (char)x;
  cmd[3] = (char)y;
  Write_LCD(fd, cmd, 5);
}


x86 assembly (clang, -O0):
<Disable_Pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xed4(%rip),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xf(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x5,%edx
call   1030 <Write_LCD@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Disable_Pixel>:
push   %rax
movl   $0x71fe,(%rsp)
movb   $0xfd,0x4(%rsp)
mov    %sil,0x2(%rsp)
mov    %dl,0x3(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edx
call   1030 <Write_LCD@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.Disable_Pixel.cmd = [5 x i8] c"\FEq\00\00\FD"
define void @Disable_Pixel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast [5 x i8]* %7 to i8*
%9 = load i32, i32* %5
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 2
store i8 %10, i8* %11
%12 = load i32, i32* %6
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 3
store i8 %13, i8* %14
%15 = load i32, i32* %4
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%17 = call i32 @Write_LCD(i32 %15, i8* %16, i32 5)
ret void
}

LLVM IR (-O2):
@__const.Disable_Pixel.cmd = [5 x i8] c"\FEq\00\00\FD"
define void @Disable_Pixel(i32 %0, i32 %1, i32 %2) {
%4 = alloca [5 x i8]
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%6 = trunc i32 %1 to i8
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 2
store i8 %6, i8* %7
%8 = trunc i32 %2 to i8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 3
store i8 %8, i8* %9
%10 = call i32 @Write_LCD(i32 %0, i8* %5, i32 5)
ret void
}
float SteamAPI_vr_IVRCompositor_GetGamma(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
  return 0;
}


x86 assembly (clang, -O0):
<SteamAPI_vr_IVRCompositor_GetGamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_vr_IVRCompositor_GetGamma>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
call   1030 <xlogf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_GetGamma = [35 x i8] c"SteamAPI_vr_IVRCompositor_GetGamma\00"
define float @SteamAPI_vr_IVRCompositor_GetGamma(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRCompositor_GetGamma, i64 0, i64 0), i8* %3)
ret float 0.000000e+00
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_GetGamma = [35 x i8] c"SteamAPI_vr_IVRCompositor_GetGamma\00"
define float @SteamAPI_vr_IVRCompositor_GetGamma(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRCompositor_GetGamma, i64 0, i64 0), i8* %0)
ret float 0.000000e+00
}
const char *get_asm_type(int size) {
  switch (size) {
  case 1:
    return "BYTE";
  case 2:
    return "WORD";
  case 4:
    return "DWORD";
  default:
    return "XXX";
  }
}


x86 assembly (clang, -O0):
<get_asm_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113d <get_asm_type+0x3d>
jmp    111b <get_asm_type+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114d <get_asm_type+0x4d>
jmp    112c <get_asm_type+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     115d <get_asm_type+0x5d>
jmp    116d <get_asm_type+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <get_asm_type+0x78>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <get_asm_type+0x78>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <get_asm_type+0x78>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_asm_type>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     111a <get_asm_type+0x1a>
movslq %edi,%rax
lea    0xefe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xeea(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"BYTE\00"
@.str.1 = [5 x i8] c"WORD\00"
@.str.2 = [6 x i8] c"DWORD\00"
@.str.3 = [4 x i8] c"XXX\00"
define i8* @get_asm_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 4, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"BYTE\00"
@.str.1 = [5 x i8] c"WORD\00"
@.str.2 = [6 x i8] c"DWORD\00"
@.str.3 = [4 x i8] c"XXX\00"
@reltable.get_asm_type = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.get_asm_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.get_asm_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.get_asm_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.get_asm_type to i64)) to i32)]
define i8* @get_asm_type(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.get_asm_type to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int FUTEX_CMP_REQUEUE_PI;
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int, int,
            int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_cmp_requeue_pi(u_int32_t *uaddr, u_int32_t val, u_int32_t *uaddr2,
                         int nr_requeue, int opflags) {
  return syscall(SYS_futex, uaddr, FUTEX_CMP_REQUEUE_PI | opflags, 1,
                 nr_requeue, uaddr2, val);
}


x86 assembly (clang, -O0):
<futex_cmp_requeue_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
or     -0x20(%rbp),%edx
mov    -0x1c(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    -0xc(%rbp),%eax
mov    $0x1,%ecx
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_cmp_requeue_pi>:
push   %rax
mov    %ecx,%eax
mov    %rdx,%r9
mov    %rdi,%rcx
mov    0x2eb8(%rip),%rdx
mov    (%rdx),%edi
mov    0x2ebf(%rip),%rdx
or     (%rdx),%r8d
mov    %esi,(%rsp)
mov    %rcx,%rsi
mov    %r8d,%edx
mov    $0x1,%ecx
mov    %eax,%r8d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
@FUTEX_CMP_REQUEUE_PI = global i32 0
define i32 @futex_cmp_requeue_pi(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* @SYS_futex
%12 = load i32*, i32** %6
%13 = load i32, i32* @FUTEX_CMP_REQUEUE_PI
%14 = load i32, i32* %10
%15 = or i32 %13, %14
%16 = load i32, i32* %9
%17 = load i32*, i32** %8
%18 = load i32, i32* %7
%19 = call i32 @syscall(i32 %11, i32* %12, i32 %15, i32 1, i32 %16, i32* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
@SYS_futex = global i32 0
@FUTEX_CMP_REQUEUE_PI = global i32 0
define i32 @futex_cmp_requeue_pi(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = load i32, i32* @SYS_futex
%7 = load i32, i32* @FUTEX_CMP_REQUEUE_PI
%8 = or i32 %7, %4
%9 = tail call i32 @syscall(i32 %6, i32* %0, i32 %8, i32 1, i32 %3, i32* %2, i32 %1)
ret i32 %9
}
/* Variables and functions */
int count_chars(char, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int RightJust_int(char *fmt_str, int from_int, char *to_str) {
  int num_of_D = count_chars('D', fmt_str);
  sprintf(to_str, "%*d", num_of_D, from_int);
  return num_of_D;
}


x86 assembly (clang, -O0):
<RightJust_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x44,%edi
call   1030 <count_chars@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RightJust_int>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rsi
mov    $0x44,%edi
call   1030 <count_chars@plt>
mov    %eax,%ebp
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
mov    %r14d,%ecx
call   1040 <sprintf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%*d\00"
define i32 @RightJust_int(i8* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @count_chars(i8 signext 68, i8* %0)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret i32 %4
}
int integer_size(const char *size) { return 1024 * 512; }


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

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

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

LLVM IR (-O2):
define i32 @integer_size(i8* nocapture readnone %0) {
ret i32 524288
}
unsigned char _hex_nibble(unsigned char c) {
  if (c <= 9)
    return '0' + c;
  else if (c <= 15)
    return 'a' + (c - 10);
  else
    return '?';
}


x86 assembly (clang, -O0):
<_hex_nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jg     1126 <_hex_nibble+0x26>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <_hex_nibble+0x49>
movzbl -0x2(%rbp),%eax
cmp    $0xf,%eax
jg     1145 <_hex_nibble+0x45>
movzbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <_hex_nibble+0x49>
movb   $0x3f,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hex_nibble>:
lea    0x30(%rdi),%eax
lea    0x57(%rdi),%ecx
cmp    $0x10,%dil
movzbl %cl,%ecx
mov    $0x3f,%edx
cmovb  %ecx,%edx
cmp    $0xa,%dil
movzbl %al,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @_hex_nibble(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sle i32 %5, 9
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = add nsw i32 48, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %23
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 15
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = sub nsw i32 %18, 10
%20 = add nsw i32 97, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %23
22: ; preds = %12
store i8 63, i8* %2
br label %23
23: ; preds = %22, %16, %7
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @_hex_nibble(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = add i8 %0, 48
%4 = icmp ult i8 %0, 16
%5 = add i8 %0, 87
%6 = select i1 %4, i8 %5, i8 63
%7 = select i1 %2, i8 %3, i8 %6
ret i8 %7
}
int write_in_charp(char *here, const int maxlen) {
  char *there = "28G11AC10T32";
  int i;
  for (i = 0; i < maxlen; ++i) {
    *(here + i) = *(there + i);
  }
  return 1;
}


x86 assembly (clang, -O0):
<write_in_charp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114d <write_in_charp+0x4d>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <write_in_charp+0x1d>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_in_charp>:
test   %esi,%esi
jle    1127 <write_in_charp+0x17>
push   %rax
mov    %esi,%edx
lea    0xee2(%rip),%rsi
call   1030 <memcpy@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"28G11AC10T32\00"
define i32 @write_in_charp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = load i8*, i8** %3
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %11
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %7
24: ; preds = %7
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"28G11AC10T32\00"
define i32 @write_in_charp(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret i32 1
}
int test_imm_C1int64_lowword_mem(long long *val) {
  return ((*val) & (0xC1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C1int64_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, 193
%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_C1int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 193
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ __builtin_lceil(double);
int /*<<< orphan*/ link_failure_builtin_lceil();
void test_builtin_lceil(double d) {
  if (__builtin_lceil(d) != __builtin_lceil(d))
    link_failure_builtin_lceil();
}


x86 assembly (clang, -O0):
<test_builtin_lceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_lceil@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_lceil@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_lceil+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_lceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_lceil>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <__builtin_lceil@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <__builtin_lceil@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_lceil+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_lceil@plt>

LLVM IR (-O0):
define void @test_builtin_lceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_lceil(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_lceil(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_lceil()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_lceil(double %0) {
%2 = tail call i64 @__builtin_lceil(double %0)
%3 = tail call i64 @__builtin_lceil(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_lceil()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __might_sleep(char *, int);
void(down)(struct semaphore *sem) {
  {
    while (1) {
      __might_sleep("include//*asm*//semaphore.h", 102);
      while (1) {
        break;
      }
      break;
    };
    return;
  }
}


x86 assembly (clang, -O0):
<down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x66,%esi
call   1030 <__might_sleep@plt>
jmp    1132 <down+0x22>
jmp    1137 <down+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<down>:
lea    0xee9(%rip),%rdi
mov    $0x66,%esi
jmp    1030 <__might_sleep@plt>

LLVM IR (-O0):
%struct.semaphore = type { i32 }
@.str = [28 x i8] c"include//*asm*//semaphore.h\00"
define void @down(%struct.semaphore* %0) {
%2 = alloca %struct.semaphore*
store %struct.semaphore* %0, %struct.semaphore** %2
br label %3
3: ; preds = %1
%4 = call i32 @__might_sleep(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 102)
br label %5
5: ; preds = %3
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.semaphore = type { i32 }
@.str = [28 x i8] c"include//*asm*//semaphore.h\00"
define void @down(%struct.semaphore* nocapture readnone %0) {
%2 = tail call i32 @__might_sleep(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 102)
ret void
}
int test_imm_54uint32_reg(unsigned int val) {
  return ((val) & (0x54 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_54uint32_reg(i32 %0) {
%2 = and i32 %0, 84
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
struct running_checksum *priv_to_rc(struct murmur3_running_checksum *priv) {
  return (struct running_checksum *)priv;
}


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

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

LLVM IR (-O0):
%struct.running_checksum = type opaque
%struct.murmur3_running_checksum = type opaque
define %struct.running_checksum* @priv_to_rc(%struct.murmur3_running_checksum* %0) {
%2 = alloca %struct.murmur3_running_checksum*
store %struct.murmur3_running_checksum* %0, %struct.murmur3_running_checksum** %2
%3 = load %struct.murmur3_running_checksum*, %struct.murmur3_running_checksum** %2
%4 = bitcast %struct.murmur3_running_checksum* %3 to %struct.running_checksum*
ret %struct.running_checksum* %4
}

LLVM IR (-O2):
%struct.running_checksum = type opaque
%struct.murmur3_running_checksum = type opaque
define %struct.running_checksum* @priv_to_rc(%struct.murmur3_running_checksum* readnone %0) {
%2 = bitcast %struct.murmur3_running_checksum* %0 to %struct.running_checksum*
ret %struct.running_checksum* %2
}
int tamAI(unsigned int ninodos) {
  return (ninodos * 128) % 1024 ? ((ninodos * 128) / 1024) + 1
                                : ((ninodos * 128) / 1024);
}


x86 assembly (clang, -O0):
<tamAI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
and    $0x3ff,%eax
cmp    $0x0,%eax
je     112f <tamAI+0x2f>
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
shr    $0xa,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <tamAI+0x3b>
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
shr    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tamAI>:
mov    %edi,%eax
mov    %edi,%ecx
and    $0x7,%ecx
shr    $0x3,%eax
and    $0x3fffff,%eax
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @tamAI(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 128
%5 = urem i32 %4, 1024
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = mul i32 %8, 128
%10 = udiv i32 %9, 1024
%11 = add i32 %10, 1
br label %16
12: ; preds = %1
%13 = load i32, i32* %2
%14 = mul i32 %13, 128
%15 = udiv i32 %14, 1024
br label %16
16: ; preds = %12, %7
%17 = phi i32 [ %11, %7 ], [ %15, %12 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @tamAI(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp ne i32 %2, 0
%4 = lshr i32 %0, 3
%5 = and i32 %4, 4194303
%6 = zext i1 %3 to i32
%7 = add nuw nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef size_t uint64_t;

/* Variables and functions */
uint64_t to_uint64(const uint8_t *x) {
  uint64_t result = 0L;
  for (size_t i = 0; i < 8; ++i) {
    result |= (uint64_t)x[i] << (i * 8);
  }
  return result;
}


x86 assembly (clang, -O0):
<to_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    1153 <to_uint64+0x53>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
shl    %cl,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <to_uint64+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_uint64>:
mov    0x8(%rdi),%rcx
mov    0x10(%rdi),%rax
shl    $0x8,%rcx
or     (%rdi),%rcx
shl    $0x10,%rax
mov    0x18(%rdi),%rdx
shl    $0x18,%rdx
or     %rax,%rdx
mov    0x20(%rdi),%rax
shl    $0x20,%rax
or     %rdx,%rax
mov    0x28(%rdi),%rdx
shl    $0x28,%rdx
or     %rax,%rdx
mov    0x30(%rdi),%rsi
shl    $0x30,%rsi
or     %rdx,%rsi
mov    0x38(%rdi),%rax
shl    $0x38,%rax
or     %rsi,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @to_uint64(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
store i64 0, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %18, %1
%6 = load i64, i64* %4
%7 = icmp ult i64 %6, 8
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i64*, i64** %2
%10 = load i64, i64* %4
%11 = getelementptr inbounds i64, i64* %9, i64 %10
%12 = load i64, i64* %11
%13 = load i64, i64* %4
%14 = mul i64 %13, 8
%15 = shl i64 %12, %14
%16 = load i64, i64* %3
%17 = or i64 %16, %15
store i64 %17, i64* %3
br label %18
18: ; preds = %8
%19 = load i64, i64* %4
%20 = add i64 %19, 1
store i64 %20, i64* %4
br label %5
21: ; preds = %5
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @to_uint64(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = getelementptr inbounds i64, i64* %0, i64 1
%4 = load i64, i64* %3
%5 = shl i64 %4, 8
%6 = or i64 %5, %2
%7 = getelementptr inbounds i64, i64* %0, i64 2
%8 = load i64, i64* %7
%9 = shl i64 %8, 16
%10 = or i64 %9, %6
%11 = getelementptr inbounds i64, i64* %0, i64 3
%12 = load i64, i64* %11
%13 = shl i64 %12, 24
%14 = or i64 %13, %10
%15 = getelementptr inbounds i64, i64* %0, i64 4
%16 = load i64, i64* %15
%17 = shl i64 %16, 32
%18 = or i64 %17, %14
%19 = getelementptr inbounds i64, i64* %0, i64 5
%20 = load i64, i64* %19
%21 = shl i64 %20, 40
%22 = or i64 %21, %18
%23 = getelementptr inbounds i64, i64* %0, i64 6
%24 = load i64, i64* %23
%25 = shl i64 %24, 48
%26 = or i64 %25, %22
%27 = getelementptr inbounds i64, i64* %0, i64 7
%28 = load i64, i64* %27
%29 = shl i64 %28, 56
%30 = or i64 %29, %26
ret i64 %30
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ sha1_test();
int main() {
  printf("SHA1 tests: %s\n", sha1_test() ? "SUCCEEDED" : "FAILED");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <sha1_test@plt>
mov    %rax,%rcx
lea    0xeda(%rip),%rsi
lea    0xec9(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sha1_test@plt>
test   %rax,%rax
lea    0xee8(%rip),%rax
lea    0xed7(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"SHA1 tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @sha1_test()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"SHA1 tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = tail call i64 (...) @sha1_test()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("This program converts image in GIF format to BMP format.\n"
         "Usage: ./gif2bmp [-i ifile] [-o ofile] [-l logfile] | -h\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 = [115 x i8] c"This program converts image in GIF format to BMP format.\0AUsage: ./gif2bmp [-i ifile] [-o ofile] [-l logfile] | -h\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [114 x i8] c"This program converts image in GIF format to BMP format.\0AUsage: ./gif2bmp [-i ifile] [-o ofile] [-l logfile] | -h\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @str, i64 0, i64 0))
ret void
}
void integrator_leapfrog_synchronize(void) {}


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

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

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

LLVM IR (-O2):
define void @integrator_leapfrog_synchronize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func4();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from subdir2/subdir3/subdir4/prog4.c\n");
  func4();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <func4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [44 x i8] c"Hello from subdir2/subdir3/subdir4/prog4.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @func4()
ret i32 0
}

LLVM IR (-O2):
@str = [43 x i8] c"Hello from subdir2/subdir3/subdir4/prog4.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func4()
ret i32 0
}
/* Variables and functions */
unsigned int GET32(int);
unsigned int uart_lcr(void) { return (GET32(0x20215054)); }


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

x86 assembly (clang, -O2):
<uart_lcr>:
mov    $0x20215054,%edi
jmp    1030 <GET32@plt>

LLVM IR (-O0):
define i32 @uart_lcr() {
%1 = call i32 @GET32(i32 539054164)
ret i32 %1
}

LLVM IR (-O2):
define i32 @uart_lcr() {
%1 = tail call i32 @GET32(i32 539054164)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_fflush(FILE *stream) {
  return fflush(stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_fflush>:
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_fflush(i32* %0) {
%2 = tail call i32 @fflush(i32* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ isalnum(char);
int chrIsalm(char cvalue) { return (isalnum(cvalue) || cvalue == '_'); }


x86 assembly (clang, -O0):
<chrIsalm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <chrIsalm+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrIsalm>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chrIsalm(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @chrIsalm(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void ftnstop(const char *msg) {
  if (msg != NULL)
    fprintf(stderr, "%s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<ftnstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <ftnstop+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ftnstop>:
push   %rax
test   %rdi,%rdi
je     113e <ftnstop+0x1e>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ftnstop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ftnstop(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @exit(i32 0)
unreachable
}
int compare(int array1[], int array2[], int col) {
  int result = 1;
  int c;
  for (c = 0; c < col; c++) {
    if (array1[c] != array2[c]) {
      result = 0;
      return result;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    116a <compare+0x6a>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1157 <compare+0x57>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <compare+0x70>
jmp    115c <compare+0x5c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111d <compare+0x1d>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    $0x1,%eax
test   %edx,%edx
jle    1121 <compare+0x21>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <compare+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <compare+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @compare(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** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 1, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %29, %3
%11 = load i32, i32* %9
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %32
14: ; preds = %10
%15 = load i32*, i32** %5
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = icmp ne i32 %19, %24
br i1 %25, label %26, label %28
26: ; preds = %14
store i32 0, i32* %8
%27 = load i32, i32* %8
store i32 %27, i32* %4
br label %34
28: ; preds = %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %10
32: ; preds = %10
%33 = load i32, i32* %8
store i32 %33, i32* %4
br label %34
34: ; preds = %32, %26
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @compare(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}