xunge/DecIR huggingface dataset:
void rmv2s_(dx, dy) short *dx, *dy;
{ rmv2((float)*dx, (float)*dy); }


x86 assembly (clang, -O0):
<rmv2s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rmv2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmv2s_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
mov    $0x2,%al
jmp    1030 <rmv2@plt>

LLVM IR (-O0):
define void @rmv2s_(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = fpext float %7 to double
%9 = load i16*, i16** %4
%10 = load i16, i16* %9
%11 = sitofp i16 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @rmv2 to i32 (double, double, ...)*)(double %8, double %12)
ret void
}

LLVM IR (-O2):
define void @rmv2s_(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = sitofp i16 %3 to double
%5 = load i16, i16* %1
%6 = sitofp i16 %5 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rmv2 to i32 (double, double, ...)*)(double %4, double %6)
ret void
}
/* Variables and functions */
unsigned char TstActMov(int);
unsigned char RunHea(void) {
  unsigned char UcRst;
  UcRst = 0x02;
  UcRst |= TstActMov(0x00);
  UcRst |= TstActMov(0x01);
  return (UcRst);
}


x86 assembly (clang, -O0):
<RunHea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x2,-0x1(%rbp)
xor    %edi,%edi
call   1030 <TstActMov@plt>
movzbl %al,%ecx
movzbl -0x1(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <TstActMov@plt>
movzbl %al,%ecx
movzbl -0x1(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RunHea>:
push   %rbx
xor    %edi,%edi
call   1030 <TstActMov@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <TstActMov@plt>
or     %bl,%al
or     $0x2,%al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @RunHea() {
%1 = alloca i8
store i8 2, i8* %1
%2 = call zeroext i8 @TstActMov(i32 0)
%3 = zext i8 %2 to i32
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = or i32 %5, %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
%8 = call zeroext i8 @TstActMov(i32 1)
%9 = zext i8 %8 to i32
%10 = load i8, i8* %1
%11 = zext i8 %10 to i32
%12 = or i32 %11, %9
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @RunHea() {
%1 = tail call zeroext i8 @TstActMov(i32 0)
%2 = tail call zeroext i8 @TstActMov(i32 1)
%3 = or i8 %1, %2
%4 = or i8 %3, 2
ret i8 %4
}
int test_imm_5Cuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x5C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Cuint64_highword_reg>:
movabs $0x5c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Cuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 395136991232
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned char answer_2(unsigned char arg0) { return 0; }


x86 assembly (clang, -O0):
<answer_2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @answer_2(i8 zeroext %0) {
ret i8 0
}
void mr97311_setquality(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @mr97311_setquality(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
float FastAtan(float);
float atan2(float, float);
float FastAtan2(float y, float x) {
  if (x > 0)
    return FastAtan(y / x);
  return atan2(y, x);
}


x86 assembly (clang, -O0):
<FastAtan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    115c <FastAtan2+0x3c>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
call   1040 <FastAtan@plt>
movss  %xmm0,-0x4(%rbp)
jmp    1170 <FastAtan2+0x50>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <atan2@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastAtan2>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    1131 <FastAtan2+0x11>
divss  %xmm1,%xmm0
jmp    1040 <FastAtan@plt>
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define float @FastAtan2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp ogt float %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fdiv float %9, %10
%12 = call float @FastAtan(float %11)
store float %12, float* %3
br label %17
13: ; preds = %2
%14 = load float, float* %4
%15 = load float, float* %5
%16 = call float @atan2(float %14, float %15)
store float %16, float* %3
br label %17
17: ; preds = %13, %8
%18 = load float, float* %3
ret float %18
}

LLVM IR (-O2):
define float @FastAtan2(float %0, float %1) {
%3 = fcmp ogt float %1, 0.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = fdiv float %0, %1
%6 = tail call float @FastAtan(float %5)
br label %9
7: ; preds = %2
%8 = tail call float @atan2(float %0, float %1)
br label %9
9: ; preds = %7, %4
%10 = phi float [ %6, %4 ], [ %8, %7 ]
ret float %10
}
void X509_PUBKEY_get(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_PUBKEY_get() {
ret void
}
int test_imm_64int8_mem(signed char *val) {
  return ((*val) & (-0x64 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_64int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -100
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(char *, char *, char *);
int co_version(int argc, char *argv[]) {
  lprintf("\n sim1750 version %s (%s)\n", "2.3c", "2017-09-19");
  return (0);
}


x86 assembly (clang, -O0):
<co_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xeec(%rip),%rdx
call   1030 <lprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_version>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xefc(%rip),%rsi
lea    0xefa(%rip),%rdx
call   1030 <lprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0A sim1750 version %s (%s)\0A\00"
@.str.1 = [5 x i8] c"2.3c\00"
@.str.2 = [11 x i8] c"2017-09-19\00"
define i32 @co_version(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @lprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A sim1750 version %s (%s)\0A\00"
@.str.1 = [5 x i8] c"2.3c\00"
@.str.2 = [11 x i8] c"2017-09-19\00"
define i32 @co_version(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @lprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int do_468() { return 468; }


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

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

LLVM IR (-O0):
define i32 @do_468() {
ret i32 468
}

LLVM IR (-O2):
define i32 @do_468() {
ret i32 468
}
void foo327(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo327(i32 %0) {
ret void
}
void handler(int sig) { panic(__FUNCTION__, "IO op too long"); }


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

x86 assembly (clang, -O2):
<handler>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
xor    %eax,%eax
jmp    1030 <panic@plt>

LLVM IR (-O0):
@__FUNCTION__.handler = [8 x i8] c"handler\00"
@.str = [15 x i8] c"IO op too long\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.handler, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.handler = [8 x i8] c"handler\00"
@.str = [15 x i8] c"IO op too long\00"
define void @handler(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.handler, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cMLeftTrim(char *);
char *cMRightTrim(int /*<<< orphan*/);
char *cMTrim(char *str) { return cMRightTrim(cMLeftTrim(str)); }


x86 assembly (clang, -O0):
<cMTrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cMLeftTrim@plt>
mov    %eax,%edi
call   1040 <cMRightTrim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cMTrim>:
push   %rax
call   1030 <cMLeftTrim@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cMRightTrim@plt>

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

LLVM IR (-O2):
define i8* @cMTrim(i8* %0) {
%2 = tail call i32 @cMLeftTrim(i8* %0)
%3 = tail call i8* @cMRightTrim(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  printf("%s %s\n", "Hola a", "todos");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [7 x i8] c"Hola a\00"
@.str.2 = [6 x i8] c"todos\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [7 x i8] c"Hola a\00"
@.str.2 = [6 x i8] c"todos\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int zserver_monitor_unix(char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @zserver_monitor_unix(i8* nocapture readnone %0) {
ret i32 0
}
void Net_HttpServerInit(void) {}


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

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

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

LLVM IR (-O2):
define void @Net_HttpServerInit() {
ret void
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, int, int);
int shim_dup3(int oldfd, int newfd, int flags) {
  return shim_enosys(0, oldfd, newfd, flags);
}


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

x86 assembly (clang, -O2):
<shim_dup3>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_dup3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double approx_pi(int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int z;
  scanf("%d", &z);
  printf("%.6f", approx_pi(z));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <approx_pi@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <approx_pi@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%.6f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call double @approx_pi(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%.6f\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call double @approx_pi(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_getstacksize(int /*<<< orphan*/ *, size_t *);
int my_pthread_attr_getstacksize(pthread_attr_t const *__attr,
                                 size_t *stack_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_attr_getstacksize(realattr, stack_size);
}


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

x86 assembly (clang, -O2):
<my_pthread_attr_getstacksize>:
mov    (%rdi),%edi
jmp    1030 <pthread_attr_getstacksize@plt>

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

LLVM IR (-O2):
define i32 @my_pthread_attr_getstacksize(i32* nocapture %0, i64* %1) {
%3 = load i32, i32* %0
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_getstacksize(i32* %5, i64* %1)
ret i32 %6
}
/* Variables and functions */
int xbp_access(char const *, int);
int __wrap_access(const char *path, int mode) { return xbp_access(path, mode); }


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

x86 assembly (clang, -O2):
<__wrap_access>:
jmp    1030 <xbp_access@plt>

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

LLVM IR (-O2):
define i32 @__wrap_access(i8* %0, i32 %1) {
%3 = tail call i32 @xbp_access(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *strtok(char *, char *);
char *get_chrom(char *line) {
  char *tok;
  tok = strtok(line, "\t");
  tok = strtok(NULL, "\t");
  tok = strtok(NULL, "\t");
  return tok;
}


x86 assembly (clang, -O0):
<get_chrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xec5(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb1(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_chrom>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strtok@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
define i8* @get_chrom(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %3
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
define i8* @get_chrom(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
long long cron_count_diff_msec(long long was, long long is) {
  return (is - was) * 2;
}


x86 assembly (clang, -O0):
<cron_count_diff_msec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cron_count_diff_msec>:
sub    %rdi,%rsi
lea    (%rsi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @cron_count_diff_msec(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 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = mul nsw i64 %7, 2
ret i64 %8
}

LLVM IR (-O2):
define i64 @cron_count_diff_msec(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl nsw i64 %3, 1
ret i64 %4
}
void DS1302(unsigned char ds1302_bit, unsigned int logical_value) {
  if (!logical_value)
    *((volatile unsigned char *)(0x10000000 + 0x1c9)) =
        *((volatile unsigned char *)(0x10000000 + 0x1c9)) & (0xff - ds1302_bit);
  else
    *((volatile unsigned char *)(0x10000000 + 0x1c9)) =
        *((volatile unsigned char *)(0x10000000 + 0x1c9)) | ds1302_bit;
}


x86 assembly (clang, -O0):
<DS1302>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113c <DS1302+0x3c>
mov    $0x100001c9,%eax
mov    (%rax),%al
movzbl %al,%eax
movzbl -0x1(%rbp),%edx
mov    $0xff,%ecx
sub    %edx,%ecx
and    %ecx,%eax
mov    %al,%cl
mov    $0x100001c9,%eax
mov    %cl,(%rax)
jmp    1155 <DS1302+0x55>
mov    $0x100001c9,%eax
mov    (%rax),%al
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %al,%cl
mov    $0x100001c9,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS1302>:
mov    0x100001c9,%al
mov    %eax,%ecx
or     %dil,%cl
not    %dil
and    %al,%dil
test   %esi,%esi
movzbl %cl,%eax
movzbl %dil,%ecx
cmovne %eax,%ecx
mov    %cl,0x100001c9
ret

LLVM IR (-O0):
define void @DS1302(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %2
%8 = load volatile i8, i8* inttoptr (i64 268435913 to i8*)
%9 = zext i8 %8 to i32
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = sub nsw i32 255, %11
%13 = and i32 %9, %12
%14 = trunc i32 %13 to i8
store volatile i8 %14, i8* inttoptr (i64 268435913 to i8*)
br label %22
15: ; preds = %2
%16 = load volatile i8, i8* inttoptr (i64 268435913 to i8*)
%17 = zext i8 %16 to i32
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store volatile i8 %21, i8* inttoptr (i64 268435913 to i8*)
br label %22
22: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @DS1302(i8 zeroext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load volatile i8, i8* inttoptr (i64 268435913 to i8*)
%5 = or i8 %4, %0
%6 = xor i8 %0, -1
%7 = and i8 %4, %6
%8 = select i1 %3, i8 %7, i8 %5
store volatile i8 %8, i8* inttoptr (i64 268435913 to i8*)
ret void
}
/* Variables and functions */
long atol(int /*<<< orphan*/);
int /*<<< orphan*/ option(char *, char *, char *);
long option_long(char *opt, char *dflt, char *descr) {
  return atol(option(opt, dflt, descr));
}


x86 assembly (clang, -O0):
<option_long>:
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   1030 <option@plt>
mov    %eax,%edi
call   1040 <atol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<option_long>:
push   %rax
call   1030 <option@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <atol@plt>

LLVM IR (-O0):
define i64 @option_long(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @option(i8* %7, i8* %8, i8* %9)
%11 = call i64 @atol(i32 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @option_long(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @option(i8* %0, i8* %1, i8* %2)
%5 = tail call i64 @atol(i32 %4)
ret i64 %5
}
/* Variables and functions */
int memcmp(char const *, char const *, size_t);
size_t min(size_t, size_t);
int hash_key_cmp(const char *key1, size_t size1, const char *key2,
                 size_t size2) {
  int rc;
  size_t size;
  size = min(size1, size2);
  rc = memcmp(key1, key2, size);
  if (rc != 0)
    return rc;
  return (int)(size1 - size2);
}


x86 assembly (clang, -O0):
<hash_key_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <min@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1040 <memcmp@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1172 <hash_key_cmp+0x52>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <hash_key_cmp+0x5d>
mov    -0x18(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key_cmp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rsi,%rdi
mov    %rcx,%rsi
call   1030 <min@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <memcmp@plt>
sub    %r15d,%ebx
test   %eax,%eax
cmove  %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @hash_key_cmp(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%12 = load i64, i64* %7
%13 = load i64, i64* %9
%14 = call i64 @min(i64 %12, i64 %13)
store i64 %14, i64* %11
%15 = load i8*, i8** %6
%16 = load i8*, i8** %8
%17 = load i64, i64* %11
%18 = call i32 @memcmp(i8* %15, i8* %16, i64 %17)
store i32 %18, i32* %10
%19 = load i32, i32* %10
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %4
%22 = load i32, i32* %10
store i32 %22, i32* %5
br label %28
23: ; preds = %4
%24 = load i64, i64* %7
%25 = load i64, i64* %9
%26 = sub i64 %24, %25
%27 = trunc i64 %26 to i32
store i32 %27, i32* %5
br label %28
28: ; preds = %23, %21
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @hash_key_cmp(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i64 @min(i64 %1, i64 %3)
%6 = tail call i32 @memcmp(i8* %0, i8* %2, i64 %5)
%7 = icmp eq i32 %6, 0
%8 = sub i64 %1, %3
%9 = trunc i64 %8 to i32
%10 = select i1 %7, i32 %9, i32 %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ run_tests();
int main() {
  run_tests();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_tests()
ret i32 0
}
void strswp(char *target, char oldchar, char newchar) {
  char *index;
  for (index = target; *index; index++) {
    if (*index == oldchar) {
      *index = newchar;
    }
  }
}


x86 assembly (clang, -O0):
<strswp>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strswp+0x5a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <strswp+0x44>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1149 <strswp+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <strswp+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strswp>:
mov    (%rdi),%al
test   %al,%al
je     1125 <strswp+0x25>
add    $0x1,%rdi
jmp    111b <strswp+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <strswp+0x25>
cmp    %sil,%al
jne    1110 <strswp+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <strswp+0x10>
ret

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

LLVM IR (-O2):
define void @strswp(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Variables and functions */
double drand2();
int /*<<< orphan*/ fatalx(char *, double);
int prob1(double p) {
  double z;
  if ((p < 0) || (p > 1))
    fatalx("bad p %12.6f\n", p);
  z = (drand2());
  if (z < p)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<prob1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1152 <prob1+0x32>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1163 <prob1+0x43>
movsd  -0x10(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <fatalx@plt>
mov    $0x0,%al
call   1040 <drand2@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    118f <prob1+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1196 <prob1+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prob1>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
ja     113a <prob1+0x1a>
ucomisd 0xec8(%rip),%xmm0
jbe    1146 <prob1+0x26>
lea    0xec7(%rip),%rdi
call   1030 <fatalx@plt>
xor    %eax,%eax
call   1040 <drand2@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"bad p %12.6f\0A\00"
define i32 @prob1(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %7, %1
%11 = load double, double* %3
%12 = call i32 @fatalx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %11)
br label %13
13: ; preds = %10, %7
%14 = call double (...) @drand2()
store double %14, double* %4
%15 = load double, double* %4
%16 = load double, double* %3
%17 = fcmp olt double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %2
br label %20
19: ; preds = %13
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [14 x i8] c"bad p %12.6f\0A\00"
define i32 @prob1(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 1.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @fatalx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %0)
br label %7
7: ; preds = %1, %5
%8 = tail call double (...) @drand2()
%9 = fcmp olt double %8, %0
%10 = zext i1 %9 to i32
ret i32 %10
}
extern void dataquay_v_0_9_present(void) {}


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

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

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

LLVM IR (-O2):
define void @dataquay_v_0_9_present() {
ret void
}
pause() {
  int i;
  for (i = 0; i < 9999; i++)
    ;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x270f,-0x8(%rbp)
jge    112b <pause+0x2b>
jmp    111d <pause+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <pause+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pause() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 9999
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @pause() {
ret i32 undef
}
long long int longlongint_ignoring_longlong(long long int x, long long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_longlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_longlong(i64 returned %0, i64 %1) {
ret i64 %0
}
void FanIntEnable(unsigned long ulBase, unsigned long ulFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000090))) |= ulFlags;
}


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

x86 assembly (clang, -O2):
<FanIntEnable>:
or     %rsi,0x90(%rdi)
ret

LLVM IR (-O0):
define void @FanIntEnable(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 = load i64, i64* %3
%7 = add i64 %6, 144
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @FanIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 144
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
extern unsigned long get_fs() {
  unsigned short _v;
  __asm__("mov %%fs,%%ax" : "=a"(_v) :);
  return _v;
}


x86 assembly (clang, -O0):
<get_fs>:
push   %rbp
mov    %rsp,%rbp
mov    %fs,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs>:
mov    %fs,%ax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i64 @get_fs() {
%1 = alloca i16
%2 = call i16 asm "mov %fs,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = zext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_fs() {
%1 = tail call i16 asm "mov %fs,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = zext i16 %1 to i64
ret i64 %2
}
long int random_number(long *idum) {
  long k;
  k = (*idum) / 127773;
  *idum = 16807 * (*idum - k * 127773) - 2836 * k;
  if (*idum < 0)
    *idum += 2147483647;
  return *idum;
}


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
imul   $0x1f31d,-0x10(%rbp),%rcx
sub    %rcx,%rax
imul   $0x41a7,%rax,%rcx
imul   $0xb14,-0x10(%rbp),%rax
sub    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jge    1167 <random_number+0x67>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x7fffffff,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
mov    (%rdi),%rcx
movabs $0x41a705af1fe3fb79,%rdx
05 a7 41
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xf,%rdx
add    %rax,%rdx
imul   $0xfffffffffffe0ce3,%rdx,%rax
add    %rcx,%rax
imul   $0x41a7,%rax,%rcx
imul   $0xfffffffffffff4ec,%rdx,%rdx
lea    (%rcx,%rdx,1),%rax
add    $0x7fffffff,%rax
add    %rdx,%rcx
cmovns %rcx,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define i64 @random_number(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = sdiv i64 %5, 127773
store i64 %6, i64* %3
%7 = load i64*, i64** %2
%8 = load i64, i64* %7
%9 = load i64, i64* %3
%10 = mul nsw i64 %9, 127773
%11 = sub nsw i64 %8, %10
%12 = mul nsw i64 16807, %11
%13 = load i64, i64* %3
%14 = mul nsw i64 2836, %13
%15 = sub nsw i64 %12, %14
%16 = load i64*, i64** %2
store i64 %15, i64* %16
%17 = load i64*, i64** %2
%18 = load i64, i64* %17
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %1
%21 = load i64*, i64** %2
%22 = load i64, i64* %21
%23 = add nsw i64 %22, 2147483647
store i64 %23, i64* %21
br label %24
24: ; preds = %20, %1
%25 = load i64*, i64** %2
%26 = load i64, i64* %25
ret i64 %26
}

LLVM IR (-O2):
define i64 @random_number(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = sdiv i64 %2, 127773
%4 = mul nsw i64 %3, -127773
%5 = add i64 %4, %2
%6 = mul nsw i64 %5, 16807
%7 = mul nsw i64 %3, -2836
%8 = add i64 %6, %7
%9 = icmp slt i64 %8, 0
%10 = add nsw i64 %8, 2147483647
%11 = select i1 %9, i64 %10, i64 %8
store i64 %11, i64* %0
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ u8_strlen(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *u8_strncat(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                               int /*<<< orphan*/);
u_int32_t *u8_strcat(u_int32_t *dest, const u_int32_t *src) {
  return u8_strncat(dest, src, u8_strlen(src));
}


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

x86 assembly (clang, -O2):
<u8_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <u8_strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <u8_strncat@plt>

LLVM IR (-O0):
define i32* @u8_strcat(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 = load i32*, i32** %4
%8 = call i32 @u8_strlen(i32* %7)
%9 = call i32* @u8_strncat(i32* %5, i32* %6, i32 %8)
ret i32* %9
}

LLVM IR (-O2):
define i32* @u8_strcat(i32* %0, i32* %1) {
%3 = tail call i32 @u8_strlen(i32* %1)
%4 = tail call i32* @u8_strncat(i32* %0, i32* %1, i32 %3)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int main() {
  void *v = malloc(1);
  free(v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void sleep_err(char *errmess) {
  fprintf(stderr, "%s", errmess);
  exit(1);
}


x86 assembly (clang, -O0):
<sleep_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sleep_err>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @sleep_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @sleep_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, ...);
int otherFormatting() {
  int favNum = 90;
  char myChar = 'i';
  printf("My favorite %c is %d.\n", myChar, favNum);
  printf("%f", 8.9);
  return 0;
}


x86 assembly (clang, -O0):
<otherFormatting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5a,-0x4(%rbp)
movb   $0x69,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x4(%rbp),%esi
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
movsd  0xeb5(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<otherFormatting>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x5a,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
movsd  0xecd(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"My favorite %c is %d.\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @otherFormatting() {
%1 = alloca i32
%2 = alloca i8
store i32 90, i32* %1
store i8 105, i8* %2
%3 = load i8, i8* %2
%4 = sitofp i8 %3 to double
%5 = load i32, i32* %1
%6 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %4, i32 %5)
%7 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double 8.900000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"My favorite %c is %d.\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @otherFormatting() {
%1 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double 1.050000e+02, i32 90)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double 8.900000e+00)
ret i32 0
}
/* Type definitions */
struct FindjoB {
  int dummy;
};

/* Variables and functions */
int Findjob_set_prop_filter(struct FindjoB *, int, int, int /*<<< orphan*/);
int Findjob_set_acl_filter(struct FindjoB *o, int value, int flag) {
  int ret;
  ret = Findjob_set_prop_filter(o, 5, value, 0);
  return (ret);
}


x86 assembly (clang, -O0):
<Findjob_set_acl_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x5,%esi
xor    %ecx,%ecx
call   1030 <Findjob_set_prop_filter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Findjob_set_acl_filter>:
mov    %esi,%edx
mov    $0x5,%esi
xor    %ecx,%ecx
jmp    1030 <Findjob_set_prop_filter@plt>

LLVM IR (-O0):
%struct.FindjoB = type { i32 }
define i32 @Findjob_set_acl_filter(%struct.FindjoB* %0, i32 %1, i32 %2) {
%4 = alloca %struct.FindjoB*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.FindjoB* %0, %struct.FindjoB** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.FindjoB*, %struct.FindjoB** %4
%9 = load i32, i32* %5
%10 = call i32 @Findjob_set_prop_filter(%struct.FindjoB* %8, i32 5, i32 %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
%struct.FindjoB = type { i32 }
define i32 @Findjob_set_acl_filter(%struct.FindjoB* %0, i32 %1, i32 %2) {
%4 = tail call i32 @Findjob_set_prop_filter(%struct.FindjoB* %0, i32 5, i32 %1, i32 0)
ret i32 %4
}