xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dump_indent(int depth) {
  int i;
  for (i = 0; i < depth; ++i) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<dump_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <dump_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <dump_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <dump_indent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <dump_indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @dump_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
__attribute__((__nothrow__)) atoi(__const char *__nptr) {}


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

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

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int readReg(int);
int /*<<< orphan*/ writeReg(int, int);
void setMode(int mode) { writeReg(0x01, (readReg(0x01) & 0xE3) | mode); }


x86 assembly (clang, -O0):
<setMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <readReg@plt>
mov    %eax,%esi
and    $0xe3,%esi
or     -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <writeReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMode>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <readReg@plt>
and    $0xe3,%eax
or     %eax,%ebx
mov    $0x1,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <writeReg@plt>

LLVM IR (-O0):
define void @setMode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @readReg(i32 1)
%4 = and i32 %3, 227
%5 = load i32, i32* %2
%6 = or i32 %4, %5
%7 = call i32 @writeReg(i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @setMode(i32 %0) {
%2 = tail call i32 @readReg(i32 1)
%3 = and i32 %2, 227
%4 = or i32 %3, %0
%5 = tail call i32 @writeReg(i32 1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ safeWrite(int const, unsigned char *const,
                             unsigned int const);
void WriteBytes(int const fd, unsigned char *const buf,
                unsigned int const nbyte) {
  safeWrite(fd, buf, nbyte);
}


x86 assembly (clang, -O0):
<WriteBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <safeWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteBytes>:
jmp    1030 <safeWrite@plt>

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

LLVM IR (-O2):
define void @WriteBytes(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @safeWrite(i32 %0, i8* %1, i32 %2)
ret void
}
short foo_short(_Complex short x) { return __real__ x; }


x86 assembly (clang, -O0):
<foo_short>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movswl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_short>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @foo_short(i32 %0) {
%2 = alloca { i16, i16 }
%3 = bitcast { i16, i16 }* %2 to i32*
store i32 %0, i32* %3
%4 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %2, i32 0, i32 0
%5 = load i16, i16* %4
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @foo_short(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
void rsp_release(struct rsp_dis *dis) {}


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

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

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

LLVM IR (-O2):
%struct.rsp_dis = type opaque
define void @rsp_release(%struct.rsp_dis* nocapture %0) {
ret void
}
/* Variables and functions */
int log10(int);
float watt_a_dB(float watt) {
  if (watt > 0.0)
    return 10 * log10(1000 * watt);
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<watt_a_dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <watt_a_dB+0x4a>
movss  0xec5(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <log10@plt>
imul   $0xa,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1162 <watt_a_dB+0x52>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<watt_a_dB>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    113a <watt_a_dB+0x2a>
push   %rax
mulss  0xedf(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1030 <log10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
add    $0x8,%rsp
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @watt_a_dB(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load float, float* %3
%9 = fmul float 1.000000e+03, %8
%10 = fptosi float %9 to i32
%11 = call i32 @log10(i32 %10)
%12 = mul nsw i32 10, %11
%13 = sitofp i32 %12 to float
store float %13, float* %2
br label %15
14: ; preds = %1
store float 0.000000e+00, float* %2
br label %15
15: ; preds = %14, %7
%16 = load float, float* %2
ret float %16
}

LLVM IR (-O2):
define float @watt_a_dB(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fmul float %0, 1.000000e+03
%5 = fptosi float %4 to i32
%6 = tail call i32 @log10(i32 %5)
%7 = mul nsw i32 %6, 10
%8 = sitofp i32 %7 to float
br label %9
9: ; preds = %1, %3
%10 = phi float [ %8, %3 ], [ 0.000000e+00, %1 ]
ret float %10
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t signum_u16(uint16_t i) {
  if (i > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<signum_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1120 <signum_u16+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1128 <signum_u16+0x28>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_u16>:
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i64 @signum_u16(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %8
7: ; preds = %1
store i64 0, i64* %2
br label %8
8: ; preds = %7, %6
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @signum_u16(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ bme_bf_addr(int /*<<< orphan*/ volatile *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
volatile uint8_t *bme_bitfield8(volatile uint8_t *ptr, uint8_t bit,
                                uint8_t width) {
  return (volatile uint8_t *)(bme_bf_addr(ptr, bit, width));
}


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

x86 assembly (clang, -O2):
<bme_bitfield8>:
jmp    1030 <bme_bf_addr@plt>

LLVM IR (-O0):
define i32* @bme_bitfield8(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @bme_bf_addr(i32* %7, i32 %8, i32 %9)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define i32* @bme_bitfield8(i32* %0, i32 %1, i32 %2) {
%4 = tail call i64 @bme_bf_addr(i32* %0, i32 %1, i32 %2)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int smack_label_fd(int fd, const char *label) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smack_label_fd(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *stdin;
void *scalanative_libc_stdin() { return stdin; }


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

x86 assembly (clang, -O2):
<scalanative_libc_stdin>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdin = global i8* null
define i8* @scalanative_libc_stdin() {
%1 = load i8*, i8** @stdin
ret i8* %1
}

LLVM IR (-O2):
@stdin = global i8* null
define i8* @scalanative_libc_stdin() {
%1 = load i8*, i8** @stdin
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void square2(int i) { printf("The square of %d is %d\n", i, i * i); }


x86 assembly (clang, -O0):
<square2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square2>:
mov    %edi,%edx
imul   %edi,%edx
lea    0xee4(%rip),%rax
mov    %edi,%esi
mov    %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"The square of %d is %d\0A\00"
define void @square2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"The square of %d is %d\0A\00"
define void @square2(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
void setKey(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               125, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<setKey>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x7d,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setKey>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x7d,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.setKey = [7 x i8] c"setKey\00"
define void @setKey() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.setKey, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.setKey = [7 x i8] c"setKey\00"
define void @setKey() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.setKey, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void HTfree(void *ptr, unsigned long size) {
  if (size > 0)
    free(ptr);
}


x86 assembly (clang, -O0):
<HTfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1134 <HTfree+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @HTfree(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_trivial_box();
int /*<<< orphan*/ decr();
int /*<<< orphan*/ incr();
void test3() {
  create_trivial_box();
  incr();
  incr();
  decr();
  decr();
  decr();
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <create_trivial_box@plt>
mov    $0x0,%al
call   1050 <incr@plt>
mov    $0x0,%al
call   1050 <incr@plt>
mov    $0x0,%al
call   1030 <decr@plt>
mov    $0x0,%al
call   1030 <decr@plt>
mov    $0x0,%al
call   1030 <decr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rax
xor    %eax,%eax
call   1040 <create_trivial_box@plt>
xor    %eax,%eax
call   1050 <incr@plt>
xor    %eax,%eax
call   1050 <incr@plt>
xor    %eax,%eax
call   1030 <decr@plt>
xor    %eax,%eax
call   1030 <decr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <decr@plt>

LLVM IR (-O0):
define void @test3() {
%1 = call i32 (...) @create_trivial_box()
%2 = call i32 (...) @incr()
%3 = call i32 (...) @incr()
%4 = call i32 (...) @decr()
%5 = call i32 (...) @decr()
%6 = call i32 (...) @decr()
ret void
}

LLVM IR (-O2):
define void @test3() {
%1 = tail call i32 (...) @create_trivial_box()
%2 = tail call i32 (...) @incr()
%3 = tail call i32 (...) @incr()
%4 = tail call i32 (...) @decr()
%5 = tail call i32 (...) @decr()
%6 = tail call i32 (...) @decr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void Rankings_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/cut_frame");
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @Rankings_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @Rankings_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t UINT_MAX;
int /*<<< orphan*/ calloc(size_t, size_t);
void null_test(void) {
  calloc(0, 0);
  calloc(0, UINT_MAX);
  calloc(UINT_MAX, 0);
  calloc(0, ~((size_t)0));
  calloc(~((size_t)0), 0);
}


x86 assembly (clang, -O0):
<null_test>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <calloc@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <calloc@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <calloc@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <calloc@plt>
mov    $0xffffffffffffffff,%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <calloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_test>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <calloc@plt>
mov    0x2ec7(%rip),%rbx
mov    (%rbx),%rsi
xor    %edi,%edi
call   1030 <calloc@plt>
mov    (%rbx),%rdi
xor    %esi,%esi
call   1030 <calloc@plt>
xor    %edi,%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <calloc@plt>
mov    $0xffffffffffffffff,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <calloc@plt>

LLVM IR (-O0):
@UINT_MAX = global i64 0
define void @null_test() {
%1 = call i32 @calloc(i64 0, i64 0)
%2 = load i64, i64* @UINT_MAX
%3 = call i32 @calloc(i64 0, i64 %2)
%4 = load i64, i64* @UINT_MAX
%5 = call i32 @calloc(i64 %4, i64 0)
%6 = call i32 @calloc(i64 0, i64 -1)
%7 = call i32 @calloc(i64 -1, i64 0)
ret void
}

LLVM IR (-O2):
@UINT_MAX = global i64 0
define void @null_test() {
%1 = tail call i32 @calloc(i64 0, i64 0)
%2 = load i64, i64* @UINT_MAX
%3 = tail call i32 @calloc(i64 0, i64 %2)
%4 = load i64, i64* @UINT_MAX
%5 = tail call i32 @calloc(i64 %4, i64 0)
%6 = tail call i32 @calloc(i64 0, i64 -1)
%7 = tail call i32 @calloc(i64 -1, i64 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void c_perror(const char *arg0) { perror(arg0); }


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

x86 assembly (clang, -O2):
<c_perror>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @c_perror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ invalidCoordinatesConvertedToNanString();
int /*<<< orphan*/ invalidStringsConvertedToNullCoord();
int /*<<< orphan*/ longStringChompedInBoardCoordString();
int /*<<< orphan*/ validCoordinatesConvertedToCoordString();
int /*<<< orphan*/ validStringCopiedToBoardCoordString();
int /*<<< orphan*/ validStringsConvertedToBoardCoord();
void testBoardCoordString(void) {
  validStringCopiedToBoardCoordString();
  longStringChompedInBoardCoordString();
  validStringsConvertedToBoardCoord();
  invalidStringsConvertedToNullCoord();
  validCoordinatesConvertedToCoordString();
  invalidCoordinatesConvertedToNanString();
}


x86 assembly (clang, -O0):
<testBoardCoordString>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <validStringCopiedToBoardCoordString@plt>
mov    $0x0,%al
call   1030 <longStringChompedInBoardCoordString@plt>
mov    $0x0,%al
call   1060 <validStringsConvertedToBoardCoord@plt>
mov    $0x0,%al
call   1070 <invalidStringsConvertedToNullCoord@plt>
mov    $0x0,%al
call   1080 <validCoordinatesConvertedToCoordString@plt>
mov    $0x0,%al
call   1040 <invalidCoordinatesConvertedToNanString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBoardCoordString>:
push   %rax
xor    %eax,%eax
call   1050 <validStringCopiedToBoardCoordString@plt>
xor    %eax,%eax
call   1030 <longStringChompedInBoardCoordString@plt>
xor    %eax,%eax
call   1060 <validStringsConvertedToBoardCoord@plt>
xor    %eax,%eax
call   1070 <invalidStringsConvertedToNullCoord@plt>
xor    %eax,%eax
call   1080 <validCoordinatesConvertedToCoordString@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <invalidCoordinatesConvertedToNanString@plt>

LLVM IR (-O0):
define void @testBoardCoordString() {
%1 = call i32 (...) @validStringCopiedToBoardCoordString()
%2 = call i32 (...) @longStringChompedInBoardCoordString()
%3 = call i32 (...) @validStringsConvertedToBoardCoord()
%4 = call i32 (...) @invalidStringsConvertedToNullCoord()
%5 = call i32 (...) @validCoordinatesConvertedToCoordString()
%6 = call i32 (...) @invalidCoordinatesConvertedToNanString()
ret void
}

LLVM IR (-O2):
define void @testBoardCoordString() {
%1 = tail call i32 (...) @validStringCopiedToBoardCoordString()
%2 = tail call i32 (...) @longStringChompedInBoardCoordString()
%3 = tail call i32 (...) @validStringsConvertedToBoardCoord()
%4 = tail call i32 (...) @invalidStringsConvertedToNullCoord()
%5 = tail call i32 (...) @validCoordinatesConvertedToCoordString()
%6 = tail call i32 (...) @invalidCoordinatesConvertedToNanString()
ret void
}
/* Variables and functions */
unsigned int ascii_length(char *);
unsigned int ascii_lengthz(char *in) { return ascii_length(in) + 1; }


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

x86 assembly (clang, -O2):
<ascii_lengthz>:
push   %rax
call   1030 <ascii_length@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ascii_lengthz(i8* %0) {
%2 = tail call i32 @ascii_length(i8* %0)
%3 = add i32 %2, 1
ret i32 %3
}
void _printf() {
  asm volatile("movq $0x20, %%rdi\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r15, %%rsp\n\t"
               "callq *%%r12\n\t"
               "movq %%rsp, %%r15\n\t"
               "movq %%r13, %%rsp\n\t"
               "addq $0x8, %%rsp\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<_printf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_printf>:
mov    $0x20,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @_printf() {
tail call void asm sideeffect "movq $$0x20, %rdi\0A\09movq %rsp, %r13\0A\09movq %r15, %rsp\0A\09callq *%r12\0A\09movq %rsp, %r15\0A\09movq %r13, %rsp\0A\09addq $$0x8, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void instruc_7() {}


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

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

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

LLVM IR (-O2):
define void @instruc_7() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int spets(int);
int main() { printf("%d\n", spets(-3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffd,%edi
call   1040 <spets@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffd,%edi
call   1040 <spets@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @spets(i32 -3)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @spets(i32 -3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t a52e_get_acmod(const uint8_t *p_a52) { return (p_a52[4] & 0xe) >> 1; }


x86 assembly (clang, -O0):
<a52e_get_acmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0xe,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_get_acmod>:
mov    0x10(%rdi),%eax
shr    %eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @a52e_get_acmod(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 14
%7 = ashr i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @a52e_get_acmod(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 7
ret i32 %5
}
int test_imm_57int8_mem(signed char *val) {
  return ((*val) & (-0x57 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_57int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -87
%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_57int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -87
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t encode_packchar(int c) {
  if (c < 'A') {
    return 27;
  }
  if (c >= 'a') {
    return (uint32_t)(c - 'a' + 1);
  }
  return (uint32_t)(c - 'A' + 1);
}


x86 assembly (clang, -O0):
<encode_packchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jge    111d <encode_packchar+0x1d>
movl   $0x1b,-0x4(%rbp)
jmp    1144 <encode_packchar+0x44>
cmpl   $0x61,-0x8(%rbp)
jl     1138 <encode_packchar+0x38>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <encode_packchar+0x44>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_packchar>:
mov    $0x1b,%eax
cmp    $0x41,%edi
jl     1119 <encode_packchar+0x19>
cmp    $0x61,%edi
jb     1114 <encode_packchar+0x14>
add    $0xffffffa0,%edi
jmp    1117 <encode_packchar+0x17>
add    $0xffffffc0,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @encode_packchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 65
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 27, i32* %2
br label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 97
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %18
14: ; preds = %7
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 65
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %18
18: ; preds = %14, %10, %6
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @encode_packchar(i32 %0) {
%2 = icmp slt i32 %0, 65
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 96
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nsw i32 %0, -96
br label %9
7: ; preds = %3
%8 = add nsw i32 %0, -64
br label %9
9: ; preds = %1, %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ], [ 27, %1 ]
ret i32 %10
}
void smal_collect_after_sweep() {}


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

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

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

LLVM IR (-O2):
define void @smal_collect_after_sweep() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void i8042_write_data(int val) { outb(val, 0x60); }


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

x86 assembly (clang, -O2):
<i8042_write_data>:
mov    $0x60,%esi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @i8042_write_data(i32 %0) {
%2 = tail call i32 @outb(i32 %0, i32 96)
ret void
}
int max(int i, int j) { return (i >= j ? i : j); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
struct String {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ string_concat_to(struct String *, struct String *);
struct String *string_copy_heap(struct String *);
struct String *string_concat_heap(struct String *a, struct String *b) {
  struct String *temp = string_copy_heap(a);
  string_concat_to(temp, b);
  return temp;
}


x86 assembly (clang, -O0):
<string_concat_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_copy_heap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <string_concat_to@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_concat_heap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <string_copy_heap@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <string_concat_to@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.String = type { i32 }
define %struct.String* @string_concat_heap(%struct.String* %0, %struct.String* %1) {
%3 = alloca %struct.String*
%4 = alloca %struct.String*
%5 = alloca %struct.String*
store %struct.String* %0, %struct.String** %3
store %struct.String* %1, %struct.String** %4
%6 = load %struct.String*, %struct.String** %3
%7 = call %struct.String* @string_copy_heap(%struct.String* %6)
store %struct.String* %7, %struct.String** %5
%8 = load %struct.String*, %struct.String** %5
%9 = load %struct.String*, %struct.String** %4
%10 = call i32 @string_concat_to(%struct.String* %8, %struct.String* %9)
%11 = load %struct.String*, %struct.String** %5
ret %struct.String* %11
}

LLVM IR (-O2):
%struct.String = type { i32 }
define %struct.String* @string_concat_heap(%struct.String* %0, %struct.String* %1) {
%3 = tail call %struct.String* @string_copy_heap(%struct.String* %0)
%4 = tail call i32 @string_concat_to(%struct.String* %3, %struct.String* %1)
ret %struct.String* %3
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int longueurChaine(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char chaineUs[256];
  fgets(chaineUs, 256, stdin);
  int strlen = longueurChaine(chaineUs);
  printf("%d\n", strlen);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
lea    -0x110(%rbp),%rdi
call   1050 <longueurChaine@plt>
mov    %eax,-0x114(%rbp)
mov    -0x114(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <longueurChaine@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 256, i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = call i32 @longueurChaine(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 256, i32 %3)
%5 = call i32 @longueurChaine(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
float log10f(float);
float powf(int, float);
float exponential_custom_io(float step, float max_steps, float max_val) {
  float R = max_steps * log10f(2) / log10f(max_val);
  return powf(2, (step / R)) - 1;
}


x86 assembly (clang, -O0):
<exponential_custom_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xebb(%rip),%xmm0
call   1040 <log10f@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <log10f@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
movss  0xe6a(%rip),%xmm1
subss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential_custom_io>:
push   %rax
movss  %xmm0,0x4(%rsp)
mulss  0xed1(%rip),%xmm1
movss  %xmm1,(%rsp)
movaps %xmm2,%xmm0
call   1040 <log10f@plt>
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
addss  0xea3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @exponential_custom_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %5
%9 = call float @log10f(float 2.000000e+00)
%10 = fmul float %8, %9
%11 = load float, float* %6
%12 = call float @log10f(float %11)
%13 = fdiv float %10, %12
store float %13, float* %7
%14 = load float, float* %4
%15 = load float, float* %7
%16 = fdiv float %14, %15
%17 = call float @powf(i32 2, float %16)
%18 = fsub float %17, 1.000000e+00
ret float %18
}

LLVM IR (-O2):
define float @exponential_custom_io(float %0, float %1, float %2) {
%4 = fmul float %1, 0x3FD3441360000000
%5 = tail call float @log10f(float %2)
%6 = fdiv float %4, %5
%7 = fdiv float %0, %6
%8 = tail call float @powf(i32 2, float %7)
%9 = fadd float %8, -1.000000e+00
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ INT32_MAX;
int /*<<< orphan*/ INT32_MIN;
int /*<<< orphan*/ xsd_integer_value(char const *, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int32_t xsd_int32_value(const char *literal) {
  return (int32_t)xsd_integer_value(literal, INT32_MIN, INT32_MAX);
}


x86 assembly (clang, -O0):
<xsd_int32_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
call   1030 <xsd_integer_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsd_int32_value>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <xsd_integer_value@plt>

LLVM IR (-O0):
@INT32_MIN = global i32 0
@INT32_MAX = global i32 0
define i32 @xsd_int32_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @INT32_MIN
%5 = load i32, i32* @INT32_MAX
%6 = call i32 @xsd_integer_value(i8* %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@INT32_MIN = global i32 0
@INT32_MAX = global i32 0
define i32 @xsd_int32_value(i8* %0) {
%2 = load i32, i32* @INT32_MIN
%3 = load i32, i32* @INT32_MAX
%4 = tail call i32 @xsd_integer_value(i8* %0, i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_byte(uint32_t *acc, uint8_t pos, uint8_t byte) {
  *acc |= (uint32_t)(byte << (pos * 8));
}


x86 assembly (clang, -O0):
<set_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_byte>:
lea    0x0(,%rsi,8),%ecx
shl    %cl,%edx
or     %edx,(%rdi)
ret

LLVM IR (-O0):
define void @set_byte(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 8
%10 = shl i32 %7, %9
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = or i32 %12, %10
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @set_byte(i32* nocapture %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 3
%5 = shl i32 %2, %4
%6 = load i32, i32* %0
%7 = or i32 %6, %5
store i32 %7, i32* %0
ret void
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void lf_to_cr(char *line, ssize_t linelen, FILE *output_stream) {
  if (linelen >= 1 && line[linelen - 1] == '\n') {
    line[linelen - 1] = '\r';
  }
  fputs(line, output_stream);
}


x86 assembly (clang, -O0):
<lf_to_cr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1158 <lf_to_cr+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1158 <lf_to_cr+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0xd,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lf_to_cr>:
test   %esi,%esi
jle    1121 <lf_to_cr+0x11>
add    $0xffffffff,%esi
cmpb   $0xa,(%rdi,%rsi,1)
jne    1121 <lf_to_cr+0x11>
movb   $0xd,(%rdi,%rsi,1)
mov    %rdx,%rsi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
define void @lf_to_cr(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = add nsw i32 %1, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %5
store i8 13, i8* %8
br label %12
12: ; preds = %11, %5, %3
%13 = tail call i32 @fputs(i8* %0, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void read_data(int *a, int size) {
  int i;
  for (i = 1; i <= size; ++i)
    scanf("%d", a + i);
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     115b <read_data+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <read_data+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <read_data+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
add    $0x4,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <read_data+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read_data(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret void
}
/* Variables and functions */
scalar_t__ CStrings__cmp(char *, char *);
int CStrings__eq(char *A, char *B) {
  return (CStrings__cmp(A, B) == 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<CStrings__eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <CStrings__cmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CStrings__eq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @CStrings__cmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @CStrings__eq(i8* %0, i8* %1) {
%3 = tail call i64 @CStrings__cmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_real_timestamp() {
  char *str = "1446253798.912215022";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1446253798 && (dest % 1000000000) == 912215022);
}


x86 assembly (clang, -O0):
<test_real_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x563414e6,%ecx
mov    %al,-0xd(%rbp)
jne    1175 <test_real_timestamp+0x55>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x365f4bee,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_real_timestamp>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"1446253798.912215022\00"
define void @test_real_timestamp() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1446253798
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 912215022
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"1446253798.912215022\00"
define void @test_real_timestamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}