xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ doubleValue();
long longValue() { return (long)doubleValue(); }


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

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

LLVM IR (-O0):
define i64 @longValue() {
%1 = call i64 (...) @doubleValue()
ret i64 %1
}

LLVM IR (-O2):
define i64 @longValue() {
%1 = tail call i64 (...) @doubleValue()
ret i64 %1
}
/* Type definitions */
struct Cyc_CfFlowInfo_FlowEnv {
  int dummy;
};

/* Variables and functions */
void *Cyc_CfFlowInfo_i_typ_to_absrval(struct Cyc_CfFlowInfo_FlowEnv *, int, int,
                                      void *, void *);
void *Cyc_CfFlowInfo_typ_to_absrval(struct Cyc_CfFlowInfo_FlowEnv *fenv,
                                    void *t, int no_init_bits_only,
                                    void *leafval) {
  void *_T0;
  _T0 = Cyc_CfFlowInfo_i_typ_to_absrval(fenv, 1, no_init_bits_only, t, leafval);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_CfFlowInfo_typ_to_absrval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%esi
call   1030 <Cyc_CfFlowInfo_i_typ_to_absrval@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_CfFlowInfo_typ_to_absrval>:
mov    %rcx,%r8
mov    %rsi,%rcx
mov    $0x1,%esi
jmp    1030 <Cyc_CfFlowInfo_i_typ_to_absrval@plt>

LLVM IR (-O0):
%struct.Cyc_CfFlowInfo_FlowEnv = type { i32 }
define i8* @Cyc_CfFlowInfo_typ_to_absrval(%struct.Cyc_CfFlowInfo_FlowEnv* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca %struct.Cyc_CfFlowInfo_FlowEnv*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store %struct.Cyc_CfFlowInfo_FlowEnv* %0, %struct.Cyc_CfFlowInfo_FlowEnv** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load %struct.Cyc_CfFlowInfo_FlowEnv*, %struct.Cyc_CfFlowInfo_FlowEnv** %5
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = load i8*, i8** %8
%14 = call i8* @Cyc_CfFlowInfo_i_typ_to_absrval(%struct.Cyc_CfFlowInfo_FlowEnv* %10, i32 1, i32 %11, i8* %12, i8* %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
ret i8* %15
}

LLVM IR (-O2):
%struct.Cyc_CfFlowInfo_FlowEnv = type { i32 }
define i8* @Cyc_CfFlowInfo_typ_to_absrval(%struct.Cyc_CfFlowInfo_FlowEnv* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i8* @Cyc_CfFlowInfo_i_typ_to_absrval(%struct.Cyc_CfFlowInfo_FlowEnv* %0, i32 1, i32 %2, i8* %1, i8* %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ glinject_handle_x11_event(int /*<<< orphan*/ *);
int glinject_real_XWindowEvent(int /*<<< orphan*/ *, int /*<<< orphan*/, long,
                               int /*<<< orphan*/ *);
int XWindowEvent(Display *dpy, Window w, long mask, XEvent *event) {
  int return_val;
  do {
    return_val = glinject_real_XWindowEvent(dpy, w, mask, event);
  } while (glinject_handle_x11_event(event));
  return return_val;
}


x86 assembly (clang, -O0):
<XWindowEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <glinject_real_XWindowEvent@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <glinject_handle_x11_event@plt>
cmp    $0x0,%rax
jne    1137 <XWindowEvent+0x17>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XWindowEvent>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <glinject_real_XWindowEvent@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <glinject_handle_x11_event@plt>
test   %rax,%rax
jne    1140 <XWindowEvent+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @XWindowEvent(i32* %0, i32 %1, i64 %2, i32* %3) {
br label %5
5: ; preds = %5, %4
%6 = tail call i32 @glinject_real_XWindowEvent(i32* %0, i32 %1, i64 %2, i32* %3)
%7 = tail call i64 @glinject_handle_x11_event(i32* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void startInteractive(void) { printf("Entering interactive mode.\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"Entering interactive mode.\00"
define void @startInteractive() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
void test_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @test_setup() {
ret void
}
int date(year, month, week, wday)
int year;
int month;
int week;
int wday;
{
  setmonth(year, month);
  return (getdate(week, wday));
}


x86 assembly (clang, -O0):
<date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <setmonth@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1040 <getdate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
xor    %eax,%eax
call   1030 <setmonth@plt>
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <getdate@plt>

LLVM IR (-O0):
define i32 @date(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @setmonth to i32 (i32, i32, ...)*)(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @getdate to i32 (i32, i32, ...)*)(i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @date(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @setmonth to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @getdate to i32 (i32, i32, ...)*)(i32 %2, i32 %3)
ret i32 %6
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int FTW_NS;
int failedStatType(const struct dirent *sBuf) { return FTW_NS; }


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

x86 assembly (clang, -O2):
<failedStatType>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@FTW_NS = global i32 0
define i32 @failedStatType(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load i32, i32* @FTW_NS
ret i32 %3
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@FTW_NS = global i32 0
define i32 @failedStatType(%struct.dirent* nocapture readnone %0) {
%2 = load i32, i32* @FTW_NS
ret i32 %2
}
int example_dll_function(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @example_dll_function() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: roll dice-spec [dice-spec ..]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: roll dice-spec [dice-spec ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"Usage: roll dice-spec [dice-spec ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void b(int i) {}


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

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

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

LLVM IR (-O2):
define void @b(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void idiv_reg32(unsigned long reg32) {
  put8(0xF7);
  put8(0xF8 + reg32);
}


x86 assembly (clang, -O0):
<idiv_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
add    $0xf8,%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idiv_reg32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xf8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @idiv_reg32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 247)
%4 = load i64, i64* %2
%5 = add i64 248, %4
%6 = trunc i64 %5 to i32
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @idiv_reg32(i64 %0) {
%2 = tail call i32 @put8(i32 247)
%3 = trunc i64 %0 to i32
%4 = add i32 %3, 248
%5 = tail call i32 @put8(i32 %4)
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
scalar_t__ times(struct tms *);
int bar(void) {
  struct tms buf;
  clock_t ticks = times(&buf);
  return ticks == 0 && time(NULL) == 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <times@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1158 <bar+0x38>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    %rsp,%rdi
call   1040 <times@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <bar+0x15>
pop    %rcx
ret
xor    %edi,%edi
call   1030 <time@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @bar() {
%1 = alloca %struct.tms
%2 = alloca i64
%3 = call i64 @times(%struct.tms* %1)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i64 @time(i32* null)
%8 = icmp eq i64 %7, 0
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @bar() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i64 @times(%struct.tms* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = tail call i64 @time(i32* null)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %0
%10 = phi i32 [ 0, %0 ], [ %8, %5 ]
ret i32 %10
}
int test_isNonNegative(int x) { return x >= 0; }


x86 assembly (clang, -O0):
<test_isNonNegative>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isNonNegative>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test_isNonNegative(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_isNonNegative(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
void av_dynarray2_add() {}


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

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

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

LLVM IR (-O2):
define void @av_dynarray2_add() {
ret void
}
/* Variables and functions */
double scs_cos_rd(double);
double cos_rd(double x) { return scs_cos_rd(x); }


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

x86 assembly (clang, -O2):
<cos_rd>:
jmp    1030 <scs_cos_rd@plt>

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

LLVM IR (-O2):
define double @cos_rd(double %0) {
%2 = tail call double @scs_cos_rd(double %0)
ret double %2
}
void d2i_ECPrivateKey_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ECPrivateKey_bio() {
ret void
}
xrealloc(ptr, size) int ptr, size;
{
  register int value = realloc(ptr, size);
  if (value == 0)
    fatal("Virtual memory full.");
  return value;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rdi
movslq -0x8(%rbp),%rsi
call   1030 <realloc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1156 <xrealloc+0x36>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
movslq %edi,%rdi
movslq %esi,%rsi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %ebx,%ebx
jne    1141 <xrealloc+0x21>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Virtual memory full.\00"
define i32 @xrealloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = call i8* @realloc(i8* %8, i64 %10)
%12 = ptrtoint i8* %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@.str = [21 x i8] c"Virtual memory full.\00"
define i32 @xrealloc(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %1 to i64
%6 = tail call i8* @realloc(i8* %4, i64 %5)
%7 = ptrtoint i8* %6 to i64
%8 = trunc i64 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret i32 %8
}
unsigned SetRed(const unsigned int color, const unsigned int red) {
  return ((color & 0xFF00FFFF) | (red << 16));
}


x86 assembly (clang, -O0):
<SetRed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ffff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetRed>:
mov    %esi,%eax
and    $0xff00ffff,%edi
shl    $0x10,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @SetRed(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 = and i32 %5, -16711681
%7 = load i32, i32* %4
%8 = shl i32 %7, 16
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @SetRed(i32 %0, i32 %1) {
%3 = and i32 %0, -16711681
%4 = shl i32 %1, 16
%5 = or i32 %4, %3
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ same_screen;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
int get_XLeaveWindowEvent_same_screen(void *_p) {
  return (int)((XLeaveWindowEvent *)_p)->same_screen;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XLeaveWindowEvent_same_screen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XLeaveWindowEvent_same_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
long long int gcd(long long int a, long long int b) {
  int t;
  while (b != 0) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <gcd+0x39>
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x10(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
jne    1120 <gcd+0x20>
ret
nopl   0x0(%rax)
cqto
idiv   %rsi
movslq %esi,%rax
mov    %rdx,%rsi
test   %rdx,%rdx
je     1108 <gcd+0x8>
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <gcd+0x15>

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = srem i64 %5, %6
%8 = shl i64 %6, 32
%9 = ashr exact i64 %8, 32
%10 = icmp eq i64 %7, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i64 [ %0, %2 ], [ %9, %4 ]
ret i64 %12
}
/* Variables and functions */
size_t ROUND_UP(size_t x, size_t r) {
  r--;
  return (x + r) & ~r;
}


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

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

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

LLVM IR (-O2):
define i64 @ROUND_UP(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
int atexit(void (*func)()) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @atexit(void (...)* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bwarn(char *);
size_t strlcat(char *, char const *, size_t);
size_t strlwcat(char *dst, const char *src, size_t siz) {
  size_t len;
  len = strlcat(dst, src, siz);
  if (len >= siz) {
    bwarn("strlwcat: ENAMETOOLONG");
  }
  return len;
}


x86 assembly (clang, -O0):
<strlwcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strlcat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1163 <strlwcat+0x43>
lea    0xea2(%rip),%rdi
call   1030 <bwarn@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwcat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <strlcat@plt>
mov    %rax,%r14
cmp    %rbx,%rax
jb     1140 <strlwcat+0x20>
lea    0xec5(%rip),%rdi
call   1030 <bwarn@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"strlwcat: ENAMETOOLONG\00"
define i64 @strlwcat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @strlcat(i8* %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp uge i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @bwarn(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
%18 = load i64, i64* %7
ret i64 %18
}

LLVM IR (-O2):
@.str = [23 x i8] c"strlwcat: ENAMETOOLONG\00"
define i64 @strlwcat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlcat(i8* %0, i8* %1, i64 %2)
%5 = icmp ult i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @bwarn(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
scalar_t__ tan(float);
float tanf(float x) { return (float)tan(x); }


x86 assembly (clang, -O0):
<tanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tan@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanf>:
push   %rax
call   1030 <tan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @tan(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @tanf(float %0) {
%2 = tail call i64 @tan(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: now +N[dw]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Usage: now +N[dw]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"Usage: now +N[dw]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void on_keyboardinterrupt(int signal) { printf("keyboardinterrupt!\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"keyboardinterrupt!\0A\00"
define void @on_keyboardinterrupt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"keyboardinterrupt!\00"
define void @on_keyboardinterrupt(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int symlink(char const *, char const *);
int iposix_file_link(const char *src, const char *dst) {
  if (symlink(src, dst) == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<iposix_file_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <symlink@plt>
cmp    $0xffffffff,%eax
jne    1142 <iposix_file_link+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <iposix_file_link+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iposix_file_link>:
push   %rax
call   1030 <symlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @iposix_file_link(i8* %0, i8* %1) {
%3 = tail call i32 @symlink(i8* %0, i8* %1)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
int FUNC3(int d, int e, int f) { return 300 + d + e + f; }


x86 assembly (clang, -O0):
<FUNC3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x12c,%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FUNC3>:
add    %esi,%edi
lea    (%rdx,%rdi,1),%eax
add    $0x12c,%eax
ret

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

LLVM IR (-O2):
define i32 @FUNC3(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 300
%5 = add nsw i32 %4, %1
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ v3_logout();
void ctrl_c(int signum) {
  printf("disconnecting... ");
  v3_logout();
  printf("done\n");
  exit(0);
}


x86 assembly (clang, -O0):
<ctrl_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <v3_logout@plt>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ctrl_c>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <v3_logout@plt>
lea    0xeb7(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"disconnecting... \00"
@.str.1 = [6 x i8] c"done\0A\00"
define void @ctrl_c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @v3_logout()
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"disconnecting... \00"
@str = [5 x i8] c"done\00"
define void @ctrl_c(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @v3_logout()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
int hledej_tecku(const char *radek, int pokud) {
  register int i;
  for (i = pokud - 1; i > 0; i--)
    if (radek[i] == '.')
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<hledej_tecku>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1151 <hledej_tecku+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    113e <hledej_tecku+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <hledej_tecku+0x58>
jmp    1143 <hledej_tecku+0x43>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <hledej_tecku+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hledej_tecku>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x2,%eax
jl     1122 <hledej_tecku+0x22>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmpb   $0x2e,(%rdi,%rcx,1)
jne    1110 <hledej_tecku+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @hledej_tecku(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = and i64 %6, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 46
br i1 %13, label %14, label %4
14: ; preds = %9
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %4, %14
%17 = phi i32 [ %15, %14 ], [ -1, %4 ]
ret i32 %17
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint64_t __SMLALDX(uint32_t x, uint32_t y,
                                            uint64_t sum) {
  return ((uint64_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y) >> 16)) +
                     ((((int32_t)x) >> 16) * (((int32_t)y << 16) >> 16)) +
                     (((uint64_t)sum))));
}


x86 assembly (clang, -O0):
<__SMLALDX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
shl    $0x10,%edx
sar    $0x10,%edx
imul   %edx,%ecx
add    %ecx,%eax
cltq
add    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMLALDX>:
movswl %di,%eax
movswl %si,%ecx
sar    $0x10,%esi
imul   %eax,%esi
sar    $0x10,%edi
imul   %edi,%ecx
add    %esi,%ecx
movslq %ecx,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @__SMLALDX(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
%13 = ashr i32 %12, 16
%14 = mul nsw i32 %10, %13
%15 = load i64, i64* %4
%16 = trunc i64 %15 to i32
%17 = ashr i32 %16, 16
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 16
%21 = ashr i32 %20, 16
%22 = mul nsw i32 %17, %21
%23 = add nsw i32 %14, %22
%24 = sext i32 %23 to i64
%25 = load i64, i64* %6
%26 = add nsw i64 %24, %25
ret i64 %26
}

LLVM IR (-O2):
define i64 @__SMLALDX(i64 %0, i64 %1, i64 %2) {
%4 = trunc i64 %0 to i32
%5 = shl i32 %4, 16
%6 = ashr exact i32 %5, 16
%7 = trunc i64 %1 to i32
%8 = ashr i32 %7, 16
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %4, 16
%11 = shl i32 %7, 16
%12 = ashr exact i32 %11, 16
%13 = mul nsw i32 %12, %10
%14 = add nsw i32 %13, %9
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %2
ret i64 %16
}
/* Variables and functions */
double rint(double);
double c_rint(double arg0) { return rint(arg0); }


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

x86 assembly (clang, -O2):
<c_rint>:
jmp    1030 <rint@plt>

LLVM IR (-O0):
define double @c_rint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.rint.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @c_rint(double %0) {
%2 = tail call double @llvm.rint.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ irmo_alloc_fail(size_t);
void *realloc(void *, size_t);
void *irmo_realloc(void *ptr, size_t bytes) {
  void *result;
  result = realloc(ptr, bytes);
  if (result == NULL) {
    irmo_alloc_fail(bytes);
  }
  return result;
}


x86 assembly (clang, -O0):
<irmo_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <irmo_realloc+0x35>
mov    -0x10(%rbp),%rdi
call   1040 <irmo_alloc_fail@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irmo_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <irmo_realloc+0x1c>
mov    %r14,%rdi
call   1040 <irmo_alloc_fail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @irmo_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @irmo_alloc_fail(i64 %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @irmo_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @irmo_alloc_fail(i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
size_t itoa_recursion(char *, int, int);
void itoa(char string[], int number) {
  int element = 0;
  if (number < 0) {
    string[element++] = '-';
    number = -number;
  }
  string[itoa_recursion(string, element, number)] = '\0';
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114e <itoa+0x3e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movb   $0x2d,(%rax,%rcx,1)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <itoa_recursion@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
xor    %esi,%esi
test   %edx,%edx
jns    1126 <itoa+0x16>
movb   $0x2d,(%rbx)
neg    %edx
mov    $0x1,%esi
mov    %rbx,%rdi
call   1030 <itoa_recursion@plt>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @itoa(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
store i8 45, i8* %0
%5 = sub nsw i32 0, %1
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
%8 = phi i32 [ 1, %4 ], [ 0, %2 ]
%9 = tail call i64 @itoa_recursion(i8* %0, i32 %8, i32 %7)
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_DrawBigString(int, int, int /*<<< orphan*/, float);
int /*<<< orphan*/ CG_TranslateString(char *);
void CG_DrawSpectator(void) {
  CG_DrawBigString(320 - 9 * 8, 440, CG_TranslateString("SPECTATOR"), 1.f);
}


x86 assembly (clang, -O0):
<CG_DrawSpectator>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1030 <CG_TranslateString@plt>
mov    %eax,%edx
mov    $0xf8,%edi
mov    $0x1b8,%esi
movss  0xebc(%rip),%xmm0
call   1040 <CG_DrawBigString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_DrawSpectator>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <CG_TranslateString@plt>
movss  0xecb(%rip),%xmm0
mov    $0xf8,%edi
mov    $0x1b8,%esi
mov    %eax,%edx
pop    %rax
jmp    1040 <CG_DrawBigString@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"SPECTATOR\00"
define void @CG_DrawSpectator() {
%1 = call i32 @CG_TranslateString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @CG_DrawBigString(i32 248, i32 440, i32 %1, float 1.000000e+00)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"SPECTATOR\00"
define void @CG_DrawSpectator() {
%1 = tail call i32 @CG_TranslateString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @CG_DrawBigString(i32 248, i32 440, i32 %1, float 1.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: testskew [-vqm] freq ival\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: testskew [-vqm] freq ival\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: testskew [-vqm] freq ival\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ date_to_timer(long, long);
long timer_to_gmdate(int /*<<< orphan*/);
long timer_to_gmtime(int /*<<< orphan*/);
void local_to_gmt(long date, long time, long *gmt_date, long *gmt_time) {
  time_t time_value;
  time_value = date_to_timer(date, time);
  *gmt_date = timer_to_gmdate(time_value);
  *gmt_time = timer_to_gmtime(time_value);
}


x86 assembly (clang, -O0):
<local_to_gmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <date_to_timer@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1040 <timer_to_gmdate@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x24(%rbp),%edi
call   1030 <timer_to_gmtime@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_to_gmt>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
call   1050 <date_to_timer@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <timer_to_gmdate@plt>
mov    %rax,(%rbx)
mov    %ebp,%edi
call   1030 <timer_to_gmtime@plt>
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @local_to_gmt(i64 %0, i64 %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = call i32 @date_to_timer(i64 %10, i64 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = call i64 @timer_to_gmdate(i32 %13)
%15 = load i64*, i64** %7
store i64 %14, i64* %15
%16 = load i32, i32* %9
%17 = call i64 @timer_to_gmtime(i32 %16)
%18 = load i64*, i64** %8
store i64 %17, i64* %18
ret void
}

LLVM IR (-O2):
define void @local_to_gmt(i64 %0, i64 %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3) {
%5 = tail call i32 @date_to_timer(i64 %0, i64 %1)
%6 = tail call i64 @timer_to_gmdate(i32 %5)
store i64 %6, i64* %2
%7 = tail call i64 @timer_to_gmtime(i32 %5)
store i64 %7, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void cmp_reg32_imm8(int reg32, unsigned char imm8) {
  put8(0x83);
  put8(0xF8 + reg32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<cmp_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x83,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xf8,%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_reg32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x83,%edi
call   1030 <put8@plt>
add    $0xf8,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -125)
%6 = load i32, i32* %3
%7 = add nsw i32 248, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @cmp_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -125)
%4 = trunc i32 %0 to i8
%5 = add i8 %4, -8
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}