xunge/DecIR huggingface dataset:
/* Variables and functions */
int Accept(int);
int UnAccept(int listenfd) { return Accept(listenfd); }


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

x86 assembly (clang, -O2):
<UnAccept>:
jmp    1030 <Accept@plt>

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

LLVM IR (-O2):
define i32 @UnAccept(i32 %0) {
%2 = tail call i32 @Accept(i32 %0)
ret i32 %2
}
double f4_sum_pre_double_double_double_double_int(double v0, double v1,
                                                  double v2, double v3, int v) {
  return v0 + v1 + v2 + v3 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_double_double_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_double_double_int>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_double_double_int(double %0, double %1, double %2, double %3, i32 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = load double, double* %9
%17 = fadd double %15, %16
%18 = load i32, i32* %10
%19 = sitofp i32 %18 to double
%20 = fadd double %17, %19
ret double %20
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_double_double_int(double %0, double %1, double %2, double %3, i32 %4) {
%6 = fadd double %0, %1
%7 = fadd double %6, %2
%8 = fadd double %7, %3
%9 = sitofp i32 %4 to double
%10 = fadd double %8, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _poweroff_usage(void) {
  fputs("Usage: "
        "poweroff"
        "\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_poweroff_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_poweroff_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Usage: poweroff\0A\00"
@stderr = global i32 0
define i32 @_poweroff_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"Usage: poweroff\0A\00"
@stderr = global i32 0
define i32 @_poweroff_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
double libballistics_computeWindage(double windVelocity,
                                    double projectileVelocity, double range,
                                    double time) {
  double Vw = windVelocity * 17.60;
  return (Vw * (time - range / projectileVelocity));
}


x86 assembly (clang, -O0):
<libballistics_computeWindage>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xee0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
divsd  -0x10(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<libballistics_computeWindage>:
mulsd  0xef8(%rip),%xmm0
divsd  %xmm1,%xmm2
subsd  %xmm2,%xmm3
mulsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @libballistics_computeWindage(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %5
%11 = fmul double %10, 1.760000e+01
store double %11, double* %9
%12 = load double, double* %9
%13 = load double, double* %8
%14 = load double, double* %7
%15 = load double, double* %6
%16 = fdiv double %14, %15
%17 = fsub double %13, %16
%18 = fmul double %12, %17
ret double %18
}

LLVM IR (-O2):
define double @libballistics_computeWindage(double %0, double %1, double %2, double %3) {
%5 = fmul double %0, 1.760000e+01
%6 = fdiv double %2, %1
%7 = fsub double %3, %6
%8 = fmul double %5, %7
ret double %8
}
/* Type definitions */
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_buf_append_byte(struct cbor_buf *, int);
bool cbor_add_array_start(struct cbor_buf *buf) {
  return cbor_buf_append_byte(buf, 0x9f);
}


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

x86 assembly (clang, -O2):
<cbor_add_array_start>:
mov    $0x9f,%esi
jmp    1030 <cbor_buf_append_byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_array_start(%struct.cbor_buf* %0) {
%2 = alloca %struct.cbor_buf*
store %struct.cbor_buf* %0, %struct.cbor_buf** %2
%3 = load %struct.cbor_buf*, %struct.cbor_buf** %2
%4 = call i32 @cbor_buf_append_byte(%struct.cbor_buf* %3, i32 159)
ret i32 %4
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_array_start(%struct.cbor_buf* %0) {
%2 = tail call i32 @cbor_buf_append_byte(%struct.cbor_buf* %0, i32 159)
ret i32 %2
}
void sha_init(int *hash) {
  hash[0] = 0x67452301;
  hash[1] = 0xefcdab89;
  hash[2] = 0x98badcfe;
  hash[3] = 0x10325476;
  hash[4] = 0xc3d2e1f0;
}


x86 assembly (clang, -O0):
<sha_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x67452301,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xefcdab89,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x98badcfe,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x10325476,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc3d2e1f0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha_init>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0xc3d2e1f0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @sha_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1732584193, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 -271733879, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 -1732584194, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 271733878, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 -1009589776, i32* %12
ret void
}

LLVM IR (-O2):
define void @sha_init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1732584193, i32 -271733879, i32 -1732584194, i32 271733878>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 -1009589776, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void getId(char *id) {
  printf("Enter ID: ");
  scanf("%s", id);
  return;
}


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

x86 assembly (clang, -O2):
<getId>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Enter ID: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @getId(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Enter ID: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @getId(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wr_cmd(unsigned char);
void GLCD_WrCmd(unsigned char cmd) { wr_cmd(cmd); }


x86 assembly (clang, -O0):
<GLCD_WrCmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <wr_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLCD_WrCmd>:
jmp    1030 <wr_cmd@plt>

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

LLVM IR (-O2):
define void @GLCD_WrCmd(i8 zeroext %0) {
%2 = tail call i32 @wr_cmd(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ converttofixed(int);
int fsubb(int, int /*<<< orphan*/);
int fsubbm(int x, int n) { return fsubb(x, converttofixed(n)); }


x86 assembly (clang, -O0):
<fsubbm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <converttofixed@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <fsubb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsubbm>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <converttofixed@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <fsubb@plt>

LLVM IR (-O0):
define i32 @fsubbm(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 = call i32 @converttofixed(i32 %6)
%8 = call i32 @fsubb(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @fsubbm(i32 %0, i32 %1) {
%3 = tail call i32 @converttofixed(i32 %1)
%4 = tail call i32 @fsubb(i32 %0, i32 %3)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xcreatewindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcreatewindow_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcreatewindow.window = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcreatewindow_window>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcreatewindow_window(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcreatewindow_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open(char *, long);
__attribute__((no)) void myopen(char *name, long flags) { open(name, flags); }


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

x86 assembly (clang, -O2):
<myopen>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define void @myopen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @open(i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @myopen(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @open(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
size_t AbsDiff(size_t x, size_t y) {
  if (x > y)
    return x - y;
  else
    return y - x;
}


x86 assembly (clang, -O0):
<AbsDiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    112b <AbsDiff+0x2b>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <AbsDiff+0x37>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbsDiff>:
mov    %rsi,%rax
sub    %rdi,%rax
neg    %rax
sub    %rdi,%rsi
cmovae %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @AbsDiff(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = sub i64 %0, %1
%5 = sub i64 %1, %0
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ drawFastHLine(short, short, short, short);
void writeFastHLine(short x, short y, short w, short color) {
  drawFastHLine(x, y, w, color);
}


x86 assembly (clang, -O0):
<writeFastHLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movswl %dx,%edi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x8(%rbp),%ecx
call   1030 <drawFastHLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFastHLine>:
jmp    1030 <drawFastHLine@plt>

LLVM IR (-O0):
define void @writeFastHLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %7
%12 = load i16, i16* %8
%13 = call i32 @drawFastHLine(i16 signext %9, i16 signext %10, i16 signext %11, i16 signext %12)
ret void
}

LLVM IR (-O2):
define void @writeFastHLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = tail call i32 @drawFastHLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: tracepath6 [-n] [-b] <destination>[/<port>]\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    $0xffffffff,%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    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: tracepath6 [-n] [-b] <destination>[/<port>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: tracepath6 [-n] [-b] <destination>[/<port>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void Kit_TruthXorBit(unsigned *p, int Bit) { p[Bit >> 5] ^= (1 << (Bit & 31)); }


x86 assembly (clang, -O0):
<Kit_TruthXorBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_TruthXorBit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x5,%ecx
movslq %ecx,%rcx
xor    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @Kit_TruthXorBit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 1, %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
%14 = xor i32 %13, %7
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @Kit_TruthXorBit(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = ashr i32 %1, 5
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = xor i32 %8, %4
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_write_quaddobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(391, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_write_quaddobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x187,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_write_quaddobl_solutions>:
mov    $0x187,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_write_quaddobl_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 391, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_write_quaddobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 391, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fmaxf(float, float);
float fminf(int /*<<< orphan*/, float);
float fclampf(float x, float a, float b) { return fminf(fmaxf(x, a), b); }


x86 assembly (clang, -O0):
<fclampf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <fmaxf@plt>
mov    %eax,%edi
movss  -0xc(%rbp),%xmm0
call   1030 <fminf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclampf>:
push   %rax
movss  %xmm2,0x4(%rsp)
call   1040 <fmaxf@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <fminf@plt>

LLVM IR (-O0):
define float @fclampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call i32 @fmaxf(float %7, float %8)
%10 = load float, float* %6
%11 = call float @fminf(i32 %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @fclampf(float %0, float %1, float %2) {
%4 = tail call i32 @fmaxf(float %0, float %1)
%5 = tail call float @fminf(i32 %4, float %2)
ret float %5
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int32_t SASR_L(int32_t x, int16_t by) {
  if (x >= 0)
    return x >> by;
  return ~((~x) >> by);
}


x86 assembly (clang, -O0):
<SASR_L>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1124 <SASR_L+0x24>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <SASR_L+0x35>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SASR_L>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @SASR_L(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
void topicDecodeUInt256(void) {}


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

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

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

LLVM IR (-O2):
define void @topicDecodeUInt256() {
ret void
}
/* Type definitions */
struct obstack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ obstack_free(struct obstack *, void *);
__attribute__((__weak__, __always___)) void
softboundcets_obstack_free(struct obstack *obj, void *object) {
  obstack_free(obj, object);
}


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

x86 assembly (clang, -O2):
<softboundcets_obstack_free>:
jmp    1030 <obstack_free@plt>

LLVM IR (-O0):
%struct.obstack = type { i32 }
define weak void @softboundcets_obstack_free(%struct.obstack* %0, i8* %1) {
%3 = alloca %struct.obstack*
%4 = alloca i8*
store %struct.obstack* %0, %struct.obstack** %3
store i8* %1, i8** %4
%5 = load %struct.obstack*, %struct.obstack** %3
%6 = load i8*, i8** %4
%7 = call i32 @obstack_free(%struct.obstack* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.obstack = type { i32 }
define weak void @softboundcets_obstack_free(%struct.obstack* %0, i8* %1) {
%3 = tail call i32 @obstack_free(%struct.obstack* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  while (i < 5) {
    printf("The current value of i is %d\n", i);
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"The current value of i is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mallocTest();
int main() { mallocTest(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <mallocTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @mallocTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mallocTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ KDebug_Alert(char *);
void KLog(char *text) {
  if (*text == 0)
    KDebug_Alert(" ");
  else
    KDebug_Alert(text);
}


x86 assembly (clang, -O0):
<KLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <KLog+0x2d>
lea    0xecd(%rip),%rdi
call   1030 <KDebug_Alert@plt>
jmp    1146 <KLog+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <KDebug_Alert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KLog>:
cmpb   $0x0,(%rdi)
je     111a <KLog+0xa>
jmp    1030 <KDebug_Alert@plt>
lea    0xedf(%rip),%rdi
jmp    1030 <KDebug_Alert@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @KLog(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @KDebug_Alert(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @KDebug_Alert(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
int drmp3_have_simd(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @drmp3_have_simd() {
ret i32 1
}

LLVM IR (-O2):
define i32 @drmp3_have_simd() {
ret i32 1
}
int utilities_random_integer(int from, int to, unsigned int *seed_ptr) {
  assert(to > from);
  assert(seed_ptr);
  return rand_r(seed_ptr) % (to - from) + from;
}


x86 assembly (clang, -O0):
<utilities_random_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <rand_r@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilities_random_integer>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
sub    %ebx,%ebp
setg   %dil
xor    %eax,%eax
call   1040 <assert@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <rand_r@plt>
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @utilities_random_integer(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* %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %10)
%12 = load i32*, i32** %6
%13 = call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %12)
%14 = load i32*, i32** %6
%15 = call i32 (i32*, ...) bitcast (i32 (...)* @rand_r to i32 (i32*, ...)*)(i32* %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
%19 = srem i32 %15, %18
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @utilities_random_integer(i32 %0, i32 %1, i32* %2) {
%4 = icmp sgt i32 %1, %0
%5 = zext i1 %4 to i32
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = tail call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %2)
%8 = tail call i32 (i32*, ...) bitcast (i32 (...)* @rand_r to i32 (i32*, ...)*)(i32* %2)
%9 = sub nsw i32 %1, %0
%10 = srem i32 %8, %9
%11 = add nsw i32 %10, %0
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ g();
int /*<<< orphan*/ h();
void f(int a, int b, int c) {
  if (a && b && c) {
    g();
  } else {
    h();
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115b <f+0x3b>
cmpl   $0x0,-0x8(%rbp)
je     115b <f+0x3b>
cmpl   $0x0,-0xc(%rbp)
je     115b <f+0x3b>
mov    $0x0,%al
call   1040 <g@plt>
jmp    1162 <f+0x42>
mov    $0x0,%al
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     1133 <f+0x13>
test   %esi,%esi
je     1133 <f+0x13>
test   %edx,%edx
je     1133 <f+0x13>
xor    %eax,%eax
jmp    1040 <g@plt>
xor    %eax,%eax
jmp    1030 <h@plt>

LLVM IR (-O0):
define void @f(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 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (...) @g()
br label %19
17: ; preds = %12, %9, %3
%18 = call i32 (...) @h()
br label %19
19: ; preds = %17, %15
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 0
%5 = icmp ne i32 %1, 0
%6 = and i1 %4, %5
%7 = icmp ne i32 %2, 0
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @g()
br label %13
11: ; preds = %3
%12 = tail call i32 (...) @h()
br label %13
13: ; preds = %11, %9
ret void
}
void g_arith_sqrt_f(void *s, void *d, void *o) {}


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

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

LLVM IR (-O0):
define void @g_arith_sqrt_f(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_arith_sqrt_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct sched_param {
  int sched_priority;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int sched_getparam(int /*<<< orphan*/, struct sched_param *);
int get_my_prio(void) {
  struct sched_param sp;
  if (sched_getparam(0, &sp) == -1) {
    perror("sched_getparam()");
    return -1;
  }
  return sp.sched_priority;
}


x86 assembly (clang, -O0):
<get_my_prio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <sched_getparam@plt>
cmp    $0xffffffff,%eax
jne    1154 <get_my_prio+0x34>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <get_my_prio+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_my_prio>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <sched_getparam@plt>
cmp    $0xffffffff,%eax
je     1135 <get_my_prio+0x15>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xec4(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@.str = [17 x i8] c"sched_getparam()\00"
define i32 @get_my_prio() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = call i32 @sched_getparam(i32 0, %struct.sched_param* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
%9 = load i32, i32* %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ -1, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fd_ssd1315_write_command(int);
void fd_ssd1315_display_on(void) { fd_ssd1315_write_command(0xaf); }


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

x86 assembly (clang, -O2):
<fd_ssd1315_display_on>:
mov    $0xaf,%edi
jmp    1030 <fd_ssd1315_write_command@plt>

LLVM IR (-O0):
define void @fd_ssd1315_display_on() {
%1 = call i32 @fd_ssd1315_write_command(i32 175)
ret void
}

LLVM IR (-O2):
define void @fd_ssd1315_display_on() {
%1 = tail call i32 @fd_ssd1315_write_command(i32 175)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(float, float, float, float);
void setup() { glClearColor(1.0f, 0.0f, 0.0f, 1.0f); }


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
movss  0xee4(%rip),%xmm3
xorps  %xmm2,%xmm2
movaps %xmm3,%xmm0
movaps %xmm2,%xmm1
call   1030 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
movss  0xee8(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
jmp    1030 <glClearColor@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 @glClearColor(float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 @glClearColor(float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
ret void
}
int myisupper(int c) {
  if (c >= 'A' && c <= 'Z')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<myisupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <myisupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <myisupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <myisupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myisupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @myisupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ splitStr(char **, char *);
void simpleParse(char **cmd, char *str) { splitStr(cmd, str); }


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

x86 assembly (clang, -O2):
<simpleParse>:
jmp    1030 <splitStr@plt>

LLVM IR (-O0):
define void @simpleParse(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 i32 @splitStr(i8** %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @simpleParse(i8** %0, i8* %1) {
%3 = tail call i32 @splitStr(i8** %0, i8* %1)
ret void
}
/* Variables and functions */
size_t address_to_frame(void *);
void *get_next_available_frame();
void *allocate_frame() {
  void *frame = get_next_available_frame();
  unsigned char *frames_ptr = 0xC1400000;
  frames_ptr[address_to_frame(frame)] = 1;
  return frame;
}


x86 assembly (clang, -O0):
<allocate_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <get_next_available_frame@plt>
mov    %rax,-0x8(%rbp)
mov    $0xc1400000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <address_to_frame@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_frame>:
push   %rbx
xor    %eax,%eax
call   1030 <get_next_available_frame@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <address_to_frame@plt>
mov    $0xc1400000,%ecx
movb   $0x1,(%rax,%rcx,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @allocate_frame() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @get_next_available_frame()
store i8* %3, i8** %1
store i8* inttoptr (i64 3242196992 to i8*), i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %1
%6 = call i64 @address_to_frame(i8* %5)
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 1, i8* %7
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
define i8* @allocate_frame() {
%1 = tail call i8* (...) @get_next_available_frame()
%2 = tail call i64 @address_to_frame(i8* %1)
%3 = getelementptr inbounds i8, i8* inttoptr (i64 3242196992 to i8*), i64 %2
store i8 1, i8* %3
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ do_char(char);
int do_tab(void) {
  do_char('\t');
  return 1;
}


x86 assembly (clang, -O0):
<do_tab>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1030 <do_char@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_tab>:
push   %rax
mov    $0x9,%edi
call   1030 <do_char@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @do_tab() {
%1 = call i32 @do_char(i8 signext 9)
ret i32 1
}

LLVM IR (-O2):
define i32 @do_tab() {
%1 = tail call i32 @do_char(i8 signext 9)
ret i32 1
}
void ff_hevc_put_hevc_uni_epel_v12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v12_12_sse4() {
ret void
}
char *append(char *op, const char *ip) {
  char c;
  while ((c = *ip++) != 0)
    *op++ = c;
  return op;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1145 <append+0x45>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <append+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <append+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <append+0x10>
ret

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

LLVM IR (-O2):
define i8* @append(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __kill(int /*<<< orphan*/, int, int /*<<< orphan*/);
int kill(pid_t pid, int sig) { return __kill(pid, sig, 0); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <__kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
xor    %edx,%edx
jmp    1030 <__kill@plt>

LLVM IR (-O0):
define i32 @kill(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 = call i32 @__kill(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @__kill(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AESSetAuthLength(uint32_t length) {
  (*((volatile unsigned long *)(0x40024000 + 0x0000055C))) = length;
}


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

x86 assembly (clang, -O2):
<AESSetAuthLength>:
mov    %rdi,0x4002455c
40
ret

LLVM IR (-O0):
define void @AESSetAuthLength(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1073890652 to i64*)
ret void
}

LLVM IR (-O2):
define void @AESSetAuthLength(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1073890652 to i64*)
ret void
}
int conv_pos(long *latitude, long *longitude) {
  if (*latitude & 0x4000000) {
    *latitude = 0x8000000 - *latitude;
    *latitude *= -1;
  }
  if (*longitude & 0x8000000) {
    *longitude = 0x10000000 - *longitude;
    *longitude *= -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<conv_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x4000000,%rax
cmp    $0x0,%rax
je     1141 <conv_pos+0x41>
mov    -0x8(%rbp),%rax
mov    $0x8000000,%ecx
sub    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
imul   $0xffffffffffffffff,(%rax),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0x8000000,%rax
cmp    $0x0,%rax
je     1176 <conv_pos+0x76>
mov    -0x10(%rbp),%rax
mov    $0x10000000,%ecx
sub    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
imul   $0xffffffffffffffff,(%rax),%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_pos>:
mov    (%rdi),%rax
test   $0x4000000,%eax
je     1113 <conv_pos+0x13>
add    $0xfffffffff8000000,%rax
mov    %rax,(%rdi)
mov    (%rsi),%rax
test   $0x8000000,%eax
je     1126 <conv_pos+0x26>
add    $0xfffffffff0000000,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @conv_pos(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = and i64 %6, 67108864
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i64*, i64** %3
%11 = load i64, i64* %10
%12 = sub nsw i64 134217728, %11
%13 = load i64*, i64** %3
store i64 %12, i64* %13
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = mul nsw i64 %15, -1
store i64 %16, i64* %14
br label %17
17: ; preds = %9, %2
%18 = load i64*, i64** %4
%19 = load i64, i64* %18
%20 = and i64 %19, 134217728
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %17
%23 = load i64*, i64** %4
%24 = load i64, i64* %23
%25 = sub nsw i64 268435456, %24
%26 = load i64*, i64** %4
store i64 %25, i64* %26
%27 = load i64*, i64** %4
%28 = load i64, i64* %27
%29 = mul nsw i64 %28, -1
store i64 %29, i64* %27
br label %30
30: ; preds = %22, %17
ret i32 0
}

LLVM IR (-O2):
define i32 @conv_pos(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = and i64 %3, 67108864
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = add i64 %3, -134217728
store i64 %7, i64* %0
br label %8
8: ; preds = %6, %2
%9 = load i64, i64* %1
%10 = and i64 %9, 134217728
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = add i64 %9, -268435456
store i64 %13, i64* %1
br label %14
14: ; preds = %12, %8
ret i32 0
}
int iommu_group_unregister_notifier(struct iommu_group *group,
                                    struct notifier_block *nb) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.iommu_group = type opaque
%struct.notifier_block = type opaque
define i32 @iommu_group_unregister_notifier(%struct.iommu_group* %0, %struct.notifier_block* %1) {
%3 = alloca %struct.iommu_group*
%4 = alloca %struct.notifier_block*
store %struct.iommu_group* %0, %struct.iommu_group** %3
store %struct.notifier_block* %1, %struct.notifier_block** %4
ret i32 0
}

LLVM IR (-O2):
%struct.iommu_group = type opaque
%struct.notifier_block = type opaque
define i32 @iommu_group_unregister_notifier(%struct.iommu_group* nocapture readnone %0, %struct.notifier_block* nocapture readnone %1) {
ret i32 0
}