xunge/DecIR huggingface dataset:
int pow2m1(int n) {
  if (n == 0)
    return 0;
  return 2 * pow2m1(n - 1) + 1;
}


x86 assembly (clang, -O0):
<pow2m1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <pow2m1+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1145 <pow2m1+0x35>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <pow2m1@plt>
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2m1>:
test   %edi,%edi
je     1127 <pow2m1+0x17>
push   %rax
add    $0xffffffff,%edi
call   1030 <pow2m1@plt>
add    %eax,%eax
add    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pow2m1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %9, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @pow2m1(i32 %6)
%8 = shl nsw i32 %7, 1
%9 = or i32 %8, 1
br label %3
}
FNIEMOP_DEF(iemOp_ud2) {
  IEMOP_MNEMONIC("ud2");
  return IEMOP_RAISE_INVALID_OPCODE();
}


x86 assembly (clang, -O0):
<FNIEMOP_DEF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <IEMOP_MNEMONIC@plt>
mov    $0x0,%al
call   1030 <IEMOP_RAISE_INVALID_OPCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"ud2\00"
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @IEMOP_MNEMONIC to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"ud2\00"
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @IEMOP_MNEMONIC to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndirectE0(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op92E0M1(void) { STA8(DirectIndirectE0(2)); }


x86 assembly (clang, -O0):
<Op92E0M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <DirectIndirectE0@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op92E0M1>:
push   %rax
mov    $0x2,%edi
call   1030 <DirectIndirectE0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op92E0M1() {
%1 = call i32 @DirectIndirectE0(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op92E0M1() {
%1 = tail call i32 @DirectIndirectE0(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p;
  if ((p = malloc(size)) == NULL)
    err(1, "malloc(%zu)", size);
  return p;
}


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)
cmp    $0x0,%rax
jne    1158 <xmalloc+0x38>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xead(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <xmalloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x1,%edi
mov    %r14,%rdx
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"malloc(%zu)\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 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"malloc(%zu)\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 ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sceDisplaySetFrameBuf(void *, int, int, int);
int /*<<< orphan*/ sceDisplaySetMode(int /*<<< orphan*/, int, int);
scalar_t__ sceGeEdramGetAddr();
void display_init() {
  void *vram = (void *)(0x40000000 | (unsigned int)sceGeEdramGetAddr());
  sceDisplaySetMode(0, 480, 272);
  sceDisplaySetFrameBuf(vram, 512, 3, 1);
}


x86 assembly (clang, -O0):
<display_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <sceGeEdramGetAddr@plt>
or     $0x40000000,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1e0,%esi
mov    $0x110,%edx
call   1040 <sceDisplaySetMode@plt>
mov    -0x8(%rbp),%rdi
mov    $0x200,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
call   1030 <sceDisplaySetFrameBuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_init>:
push   %rbx
xor    %eax,%eax
call   1050 <sceGeEdramGetAddr@plt>
mov    %rax,%rbx
or     $0x40000000,%ebx
xor    %edi,%edi
mov    $0x1e0,%esi
mov    $0x110,%edx
call   1040 <sceDisplaySetMode@plt>
mov    %rbx,%rdi
mov    $0x200,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
pop    %rbx
jmp    1030 <sceDisplaySetFrameBuf@plt>

LLVM IR (-O0):
define void @display_init() {
%1 = alloca i8*
%2 = call i64 (...) @sceGeEdramGetAddr()
%3 = trunc i64 %2 to i32
%4 = or i32 1073741824, %3
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %1
%7 = call i32 @sceDisplaySetMode(i32 0, i32 480, i32 272)
%8 = load i8*, i8** %1
%9 = call i32 @sceDisplaySetFrameBuf(i8* %8, i32 512, i32 3, i32 1)
ret void
}

LLVM IR (-O2):
define void @display_init() {
%1 = tail call i64 (...) @sceGeEdramGetAddr()
%2 = and i64 %1, 3221225471
%3 = or i64 %2, 1073741824
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @sceDisplaySetMode(i32 0, i32 480, i32 272)
%6 = tail call i32 @sceDisplaySetFrameBuf(i8* %4, i32 512, i32 3, i32 1)
ret void
}
int f_ble_rm1(float a1, float *a2) { return (__builtin_islessequal(a1, *a2)); }


x86 assembly (clang, -O0):
<f_ble_rm1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ble_rm1>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @f_ble_rm1(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 = load float, float* %6
%8 = fcmp ole float %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_ble_rm1(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp oge float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_57uint8_reg(unsigned char val) {
  return ((val) & (0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x57,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_57uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 87
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t reg32_read(volatile uint32_t *reg) { return *reg; }


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

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

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

LLVM IR (-O2):
define i32 @reg32_read(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pic_enableirq(int);
void uart_setup(void) { pic_enableirq((1 << 1)); }


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

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

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

LLVM IR (-O2):
define void @uart_setup() {
%1 = tail call i32 @pic_enableirq(i32 2)
ret void
}
float sqrtf(float x) {
  long double t;
  __asm__("fsqrt" : "=t"(t) : "0"(x));
  return (float)t;
}


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
flds   -0x4(%rbp)
fsqrt
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstps  -0x24(%rbp)
movss  -0x24(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fsqrt
fstps  -0x8(%rsp)
movss  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
%3 = alloca x86_fp80
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to x86_fp80
%6 = call x86_fp80 asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %5)
store x86_fp80 %6, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %3
%8 = fptrunc x86_fp80 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = fpext float %0 to x86_fp80
%3 = tail call x86_fp80 asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %2)
%4 = fptrunc x86_fp80 %3 to float
ret float %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_peer_get_unit(int fd,
                                                            char **unit) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_peer_get_unit>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_peer_get_unit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_peer_get_unit(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_init(pthread_mutexattr_t *a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_init(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_proxy {
  int dummy;
};
struct wl_data_source {
  int dummy;
};
struct wl_data_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int,
                                    struct wl_data_source *,
                                    int /*<<< orphan*/);
void wl_data_device_set_selection(struct wl_data_device *wl_data_device,
                                  struct wl_data_source *source,
                                  uint32_t serial) {
  wl_proxy_marshal((struct wl_proxy *)wl_data_device, 1, source, serial);
}


x86 assembly (clang, -O0):
<wl_data_device_set_selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_data_device_set_selection>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_data_device = type { i32 }
%struct.wl_data_source = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_device_set_selection(%struct.wl_data_device* %0, %struct.wl_data_source* %1, i32 %2) {
%4 = alloca %struct.wl_data_device*
%5 = alloca %struct.wl_data_source*
%6 = alloca i32
store %struct.wl_data_device* %0, %struct.wl_data_device** %4
store %struct.wl_data_source* %1, %struct.wl_data_source** %5
store i32 %2, i32* %6
%7 = load %struct.wl_data_device*, %struct.wl_data_device** %4
%8 = bitcast %struct.wl_data_device* %7 to %struct.wl_proxy*
%9 = load %struct.wl_data_source*, %struct.wl_data_source** %5
%10 = load i32, i32* %6
%11 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %8, i32 1, %struct.wl_data_source* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.wl_data_device = type { i32 }
%struct.wl_data_source = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_device_set_selection(%struct.wl_data_device* %0, %struct.wl_data_source* %1, i32 %2) {
%4 = bitcast %struct.wl_data_device* %0 to %struct.wl_proxy*
%5 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 1, %struct.wl_data_source* %1, i32 %2)
ret void
}
int test_imm_3Cint8_reg(signed char val) {
  return ((val) & (0x3C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Cint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Cint8_reg(i8 signext %0) {
%2 = and i8 %0, 60
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _IMS_printf() {}


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

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

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

LLVM IR (-O2):
define i32 @_IMS_printf() {
ret i32 undef
}
double _hrs(double n) { return (n / 3600.); }


x86 assembly (clang, -O0):
<_hrs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hrs>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_hrs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.600000e+03
ret double %4
}

LLVM IR (-O2):
define double @_hrs(double %0) {
%2 = fdiv double %0, 3.600000e+03
ret double %2
}
/* Variables and functions */
char *strchr(char *, char);
void stripClusterName(char *str) {
  char *p;
  if ((p = strchr(str, '@')) == NULL) {
    return;
  }
  str[p - str] = '\0';
  return;
}


x86 assembly (clang, -O0):
<stripClusterName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    113d <stripClusterName+0x2d>
jmp    1150 <stripClusterName+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripClusterName>:
push   %rax
mov    $0x40,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <stripClusterName+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @stripClusterName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 64)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
br label %16
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = getelementptr inbounds i8, i8* %9, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @stripClusterName(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %1, %4
ret void
}
/* Variables and functions */
int FreeCPP();
int FreeScanner(void) { return (FreeCPP()); }


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

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

LLVM IR (-O0):
define i32 @FreeScanner() {
%1 = call i32 (...) @FreeCPP()
ret i32 %1
}

LLVM IR (-O2):
define i32 @FreeScanner() {
%1 = tail call i32 (...) @FreeCPP()
ret i32 %1
}
char *hash_plugin_detailed(void) {
  return ("mscash2 - Domain cached credentials v2 plugin\n"
          "------------------------\n"
          "Use this module to crack Domain cached credentials v2 hashes\n"
          "Input should be in form: \'user:hash\''\n"
          "Known software that uses this password hashing method:\n"
          "Microsoft Windows\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [289 x i8] c"mscash2 - Domain cached credentials v2 plugin\0A------------------------\0AUse this module to crack Domain cached credentials v2 hashes\0AInput should be in form: 'user:hash''\0AKnown software that uses this password hashing method:\0AMicrosoft Windows\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [289 x i8] c"mscash2 - Domain cached credentials v2 plugin\0A------------------------\0AUse this module to crack Domain cached credentials v2 hashes\0AInput should be in form: 'user:hash''\0AKnown software that uses this password hashing method:\0AMicrosoft Windows\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void info(void) {
  printf("c2html v."
         "0.0.5"
         " ("
         "07:35:07"
         " "
         "Mar 16 2022"
         ") by gynvael.coldwind//vx\n"
         "  Desc: converts a c/cpp file into a html document with"
         " colored syntax\n"
         "  Usage: c2html infile [outfile] [--with-header]\n"
         "    infile        - input file to color\n"
         "    outfile       - output file (default: infile.html)\n"
         "    --with-header - add html header with styles\n\n"
         "  Example: c2html main.c main_c.html --with-header\n");
}


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

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

LLVM IR (-O0):
@.str = [378 x i8] c"c2html v.0.0.5 (07:35:07 Mar 16 2022) by gynvael.coldwind//vx\0A Desc: converts a c/cpp file into a html document with colored syntax\0A Usage: c2html infile [outfile] [--with-header]\0A infile - input file to color\0A outfile - output file (default: infile.html)\0A --with-header - add html header with styles\0A\0A Example: c2html main.c main_c.html --with-header\0A\00"
define void @info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [377 x i8] c"c2html v.0.0.5 (07:35:07 Mar 16 2022) by gynvael.coldwind//vx\0A Desc: converts a c/cpp file into a html document with colored syntax\0A Usage: c2html infile [outfile] [--with-header]\0A infile - input file to color\0A outfile - output file (default: infile.html)\0A --with-header - add html header with styles\0A\0A Example: c2html main.c main_c.html --with-header\00"
define void @info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([377 x i8], [377 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn5() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn5");
  return result;
}


x86 assembly (clang, -O0):
<fn5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn5>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"fn5\00"
define i8* @fn5() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"fn5\00"
define i8* @fn5() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int fn2(int i) {
  return ({ i + 1; }) != ({ i + 1; });
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0xc(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp ne i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn2(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *ret = strdup(s);
  if (ret == NULL)
    err(1, "strdup() failed");
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xstrdup+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):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xstrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"strdup() failed\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 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 = [16 x i8] c"strdup() failed\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void errorp(char *mesg) { printf("\e[1;31m[e] %s\e[0m\n", mesg); }


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

x86 assembly (clang, -O2):
<errorp>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[1;31m[e] %s\1B[0m\0A\00"
define void @errorp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[1;31m[e] %s\1B[0m\0A\00"
define void @errorp(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int Postgresql() {
  char x;
  return ((((&x) != ((void *)0)) ? (*(&x) = ((char)1)) : (void)((void *)0)),
          (unsigned long)((void *)0));
}


x86 assembly (clang, -O0):
<Postgresql>:
push   %rbp
mov    %rsp,%rbp
movb   $0x1,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Postgresql() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t f_read(int /*<<< orphan*/ *, void *, size_t);
int /*<<< orphan*/ swap16(int /*<<< orphan*/ *);
size_t f_read16(FILE *f, void *buf, size_t size) {
  size_t ret = 0;
  if (buf) {
    ret = f_read(f, buf, size);
    swap16((int16_t *)buf);
  }
  return ret;
}


x86 assembly (clang, -O0):
<f_read16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <f_read16+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <f_read@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <swap16@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_read16>:
test   %rsi,%rsi
je     1147 <f_read16+0x27>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <f_read@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <swap16@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @f_read16(i32* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i64 @f_read(i32* %0, i8* %1, i64 %2)
%7 = bitcast i8* %1 to i32*
%8 = tail call i32 @swap16(i32* %7)
br label %9
9: ; preds = %5, %3
%10 = phi i64 [ %6, %5 ], [ 0, %3 ]
ret i64 %10
}
int main() { return 100l; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 100
}
/* Variables and functions */
int /*<<< orphan*/ xlfail(char *);
checkizero(long int iarg) {
  if (iarg == 0)
    xlfail("division by zero");
}


x86 assembly (clang, -O0):
<checkizero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <checkizero+0x23>
lea    0xed2(%rip),%rdi
call   1030 <xlfail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkizero>:
test   %rdi,%rdi
je     1116 <checkizero+0x6>
ret
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <xlfail@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"division by zero\00"
define i32 @checkizero(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @xlfail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"division by zero\00"
define i32 @checkizero(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @xlfail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 undef
}
long str(data, maxl, rcp)
char *data;
long maxl;
struct res *rcp;
{
  char *lp, *getline();
  char *datap = data;
  char *outp(), *outs(), *outl(), *outc();
  if ((lp = getline()) == 0)
    fatal("missing string");
  datap = outp(datap, lp, &maxl, 1);
  return (datap - data);
}


x86 assembly (clang, -O0):
<str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <getline@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    116f <str+0x3f>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1050 <fatal@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <outp@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,(%rsp)
xor    %eax,%eax
call   1040 <getline@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <str+0x28>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <fatal@plt>
mov    %rsp,%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <outp@plt>
sub    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.res = type opaque
@.str = [15 x i8] c"missing string\00"
define i64 @str(i8* %0, i64 %1, %struct.res* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.res*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store %struct.res* %2, %struct.res** %6
%9 = load i8*, i8** %4
store i8* %9, i8** %8
%10 = call i8* (...) @getline()
store i8* %10, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
%15 = load i8*, i8** %8
%16 = load i8*, i8** %7
%17 = call i8* (i8*, i8*, i64*, i32, ...) bitcast (i8* (...)* @outp to i8* (i8*, i8*, i64*, i32, ...)*)(i8* %15, i8* %16, i64* %5, i32 1)
store i8* %17, i8** %8
%18 = load i8*, i8** %8
%19 = load i8*, i8** %4
%20 = ptrtoint i8* %18 to i64
%21 = ptrtoint i8* %19 to i64
%22 = sub i64 %20, %21
ret i64 %22
}

LLVM IR (-O2):
%struct.res = type opaque
@.str = [15 x i8] c"missing string\00"
define i64 @str(i8* %0, i64 %1, %struct.res* nocapture readnone %2) {
%4 = alloca i64
store i64 %1, i64* %4
%5 = tail call i8* (...) @getline()
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = call i8* (i8*, i8*, i64*, i32, ...) bitcast (i8* (...)* @outp to i8* (i8*, i8*, i64*, i32, ...)*)(i8* %0, i8* %5, i64* %4, i32 1)
%11 = ptrtoint i8* %10 to i64
%12 = ptrtoint i8* %0 to i64
%13 = sub i64 %11, %12
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fn2() { printf("fn2\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"fn2\00"
define void @fn2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
GET_PROMPT_BOOL(r, s) int *r;
char *s;
{
  puts((char *)s);
  GET_BOOL(r);
}


x86 assembly (clang, -O0):
<GET_PROMPT_BOOL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <GET_BOOL@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_PROMPT_BOOL>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <GET_BOOL@plt>

LLVM IR (-O0):
define i32 @GET_PROMPT_BOOL(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @GET_BOOL to i32 (i32*, ...)*)(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @GET_PROMPT_BOOL(i32* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %1)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @GET_BOOL to i32 (i32*, ...)*)(i32* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ initial_burst();
int /*<<< orphan*/ steady_state();
void simulate(void) {
  initial_burst();
  steady_state();
}


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

x86 assembly (clang, -O2):
<simulate>:
push   %rax
xor    %eax,%eax
call   1030 <initial_burst@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <steady_state@plt>

LLVM IR (-O0):
define void @simulate() {
%1 = call i32 (...) @initial_burst()
%2 = call i32 (...) @steady_state()
ret void
}

LLVM IR (-O2):
define void @simulate() {
%1 = tail call i32 (...) @initial_burst()
%2 = tail call i32 (...) @steady_state()
ret void
}
/* Variables and functions */
double ln_get_lunar_earth_dist(double);
double lunar_distance(double jd, double *arg) {
  return ln_get_lunar_earth_dist(jd);
}


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

x86 assembly (clang, -O2):
<lunar_distance>:
jmp    1030 <ln_get_lunar_earth_dist@plt>

LLVM IR (-O0):
define double @lunar_distance(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 = call double @ln_get_lunar_earth_dist(double %5)
ret double %6
}

LLVM IR (-O2):
define double @lunar_distance(double %0, double* nocapture readnone %1) {
%3 = tail call double @ln_get_lunar_earth_dist(double %0)
ret double %3
}
/* Variables and functions */
unsigned long getTick();
void waitTick(unsigned long tick) {
  unsigned long start;
  start = getTick();
  while ((getTick() - start) < tick)
    ;
}


x86 assembly (clang, -O0):
<waitTick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getTick@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getTick@plt>
sub    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1141 <waitTick+0x31>
jmp    1127 <waitTick+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitTick>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getTick@plt>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getTick@plt>
sub    %rbx,%rax
cmp    %r14,%rax
jb     1130 <waitTick+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @waitTick(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 (...) @getTick()
store i64 %4, i64* %3
br label %5
5: ; preds = %11, %1
%6 = call i64 (...) @getTick()
%7 = load i64, i64* %3
%8 = sub i64 %6, %7
%9 = load i64, i64* %2
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @waitTick(i64 %0) {
%2 = tail call i64 (...) @getTick()
br label %3
3: ; preds = %3, %1
%4 = tail call i64 (...) @getTick()
%5 = sub i64 %4, %2
%6 = icmp ult i64 %5, %0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ current_view();
int /*<<< orphan*/ cursor_right(int /*<<< orphan*/);
void right_action() { cursor_right(current_view()); }


x86 assembly (clang, -O0):
<right_action>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <current_view@plt>
mov    %eax,%edi
call   1040 <cursor_right@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_action>:
push   %rax
xor    %eax,%eax
call   1030 <current_view@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cursor_right@plt>

LLVM IR (-O0):
define void @right_action() {
%1 = call i32 (...) @current_view()
%2 = call i32 @cursor_right(i32 %1)
ret void
}

LLVM IR (-O2):
define void @right_action() {
%1 = tail call i32 (...) @current_view()
%2 = tail call i32 @cursor_right(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ tgl_out_cstring(char *, int);
int /*<<< orphan*/ tglt_secure_random(char *, int);
void out_random(int n) {
  assert(n <= 32);
  static char buf[32];
  tglt_secure_random(buf, n);
  tgl_out_cstring(buf, n);
}


x86 assembly (clang, -O0):
<out_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%esi
lea    0x2efa(%rip),%rdi
call   1050 <tglt_secure_random@plt>
mov    -0x4(%rbp),%esi
lea    0x2eeb(%rip),%rdi
call   1030 <tgl_out_cstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_random>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x21,%ebx
setl   %dil
call   1040 <assert@plt>
lea    0x2f05(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <tglt_secure_random@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <tgl_out_cstring@plt>

LLVM IR (-O0):
@out_random.buf = internal global [32 x i8] zeroinitializer
define void @out_random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 32
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @tglt_secure_random(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @out_random.buf, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @tgl_out_cstring(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @out_random.buf, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@out_random.buf = internal global [32 x i8] zeroinitializer
define void @out_random(i32 %0) {
%2 = icmp slt i32 %0, 33
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @tglt_secure_random(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @out_random.buf, i64 0, i64 0), i32 %0)
%6 = tail call i32 @tgl_out_cstring(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @out_random.buf, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ remove(char const *);
int32_t fsfat_test_delete(const char *filename) {
  do {
  } while (0);
  return remove(filename);
}


x86 assembly (clang, -O0):
<fsfat_test_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <fsfat_test_delete+0x11>
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsfat_test_delete>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
define i32 @fsfat_test_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i8*, i8** %2
%6 = call i32 @remove(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @fsfat_test_delete(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
void m3_PrintProfilerInfo() {}


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

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

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

LLVM IR (-O2):
define void @m3_PrintProfilerInfo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_vector(double *v) {
  if (v) {
    free(v);
  }
}


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

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

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

LLVM IR (-O2):
define void @free_vector(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int g_DUMMY_menu_append_floating_button(int menu_id, char *label, int return_id,
                                        float vp_x, float vp_y) {
  menu_id = menu_id;
  label = label;
  return_id = return_id;
  vp_x = vp_x;
  vp_y = vp_y;
  return -1;
}


x86 assembly (clang, -O0):
<g_DUMMY_menu_append_floating_button>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
movss  %xmm1,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_append_floating_button(i32 %0, i8* nocapture readnone %1, i32 %2, float %3, float %4) {
ret i32 -1
}