xunge/DecIR huggingface dataset:
int f1(int x, unsigned y) {
  int a = x + y;
  return a - x;
}


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

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef unsigned short uint16_t;

/* Variables and functions */
void I2SSampleStampOutConfigure(uint32_t ui32Base, uint16_t ui16TrigValue) {
  ;
  (*((volatile unsigned short *)(0x40021000 + 0x0000004C))) = ui16TrigValue;
}


x86 assembly (clang, -O0):
<I2SSampleStampOutConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%cx
mov    $0x4002104c,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SSampleStampOutConfigure>:
mov    %si,0x4002104c
40
ret

LLVM IR (-O0):
define void @I2SSampleStampOutConfigure(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
store volatile i16 %5, i16* inttoptr (i64 1073877068 to i16*)
ret void
}

LLVM IR (-O2):
define void @I2SSampleStampOutConfigure(i32 %0, i16 zeroext %1) {
store volatile i16 %1, i16* inttoptr (i64 1073877068 to i16*)
ret void
}
int isleapyear(int year) {
  return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
}


x86 assembly (clang, -O0):
<isleapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <isleapyear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <isleapyear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleapyear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isleapyear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isleapyear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isleapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isleapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct rtas_ibmsp_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_ibmsp_scn *rtas_get_ibm_sp_scn(struct rtas_event *re) {
  return (struct rtas_ibmsp_scn *)get_re_scn(re, 9);
}


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

x86 assembly (clang, -O2):
<rtas_get_ibm_sp_scn>:
mov    $0x9,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_ibmsp_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_ibmsp_scn* @rtas_get_ibm_sp_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 9)
%5 = inttoptr i64 %4 to %struct.rtas_ibmsp_scn*
ret %struct.rtas_ibmsp_scn* %5
}

LLVM IR (-O2):
%struct.rtas_ibmsp_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_ibmsp_scn* @rtas_get_ibm_sp_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 9)
%3 = inttoptr i64 %2 to %struct.rtas_ibmsp_scn*
ret %struct.rtas_ibmsp_scn* %3
}
void TimerHalEnableSelectedClockSource(unsigned int timerClockControlRegister) {
  (*((volatile unsigned int *)(((0x44E00000) + 0) +
                               timerClockControlRegister))) |= 0x2;
  while (((*((volatile unsigned int *)(((0x44E00000) + 0) +
                                       timerClockControlRegister))) &
          0x2) != 0x2)
    ;
}


x86 assembly (clang, -O0):
<TimerHalEnableSelectedClockSource>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x44e00000,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44e00000,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x2,%eax
je     1135 <TimerHalEnableSelectedClockSource+0x35>
jmp    1118 <TimerHalEnableSelectedClockSource+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerHalEnableSelectedClockSource>:
add    $0x44e00000,%edi
orl    $0x2,(%rdi)
nopl   0x0(%rax)
testl  $0x2,(%rdi)
je     1110 <TimerHalEnableSelectedClockSource+0x10>
ret

LLVM IR (-O0):
define void @TimerHalEnableSelectedClockSource(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 1155530752, %3
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
br label %9
9: ; preds = %17, %1
%10 = load i32, i32* %2
%11 = add i32 1155530752, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 2
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @TimerHalEnableSelectedClockSource(i32 %0) {
%2 = add i32 %0, 1155530752
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
br label %7
7: ; preds = %7, %1
%8 = load volatile i32, i32* %4
%9 = and i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
ret void
}
/* Variables and functions */
float __builtin_copysignf(float, float);
float barf(float, float);
float f12(float x) {
  float tmp1 = 7.5f;
  float tmp2 = __builtin_copysignf(2.0f, x);
  return barf(tmp1 * tmp2, tmp2);
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xefb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeca(%rip),%xmm1
pand   %xmm1,%xmm0
movaps 0xecf(%rip),%xmm1
por    %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <barf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12>:
andps  0xee9(%rip),%xmm0
orps   0xef2(%rip),%xmm0
movaps %xmm0,%xmm2
mulss  0xef7(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm0
jmp    1030 <barf@plt>

LLVM IR (-O0):
define float @f12(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
store float 7.500000e+00, float* %3
%5 = load float, float* %2
%6 = call float @llvm.copysign.f32(float 2.000000e+00, float %5)
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = load float, float* %4
%11 = call float @barf(float %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @f12(float %0) {
%2 = tail call float @llvm.copysign.f32(float 2.000000e+00, float %0)
%3 = fmul float %2, 7.500000e+00
%4 = tail call float @barf(float %3, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanup(int /*<<< orphan*/);
int /*<<< orphan*/ errx(int, char *, char const *);
void upchuck(const char *message) {
  cleanup(0);
  errx(1, "fatal error during execution: %s", message);
}


x86 assembly (clang, -O0):
<upchuck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <cleanup@plt>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xebd(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upchuck>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <cleanup@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"fatal error during execution: %s\00"
define void @upchuck(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @cleanup(i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"fatal error during execution: %s\00"
define void @upchuck(i8* %0) {
%2 = tail call i32 @cleanup(i32 0)
%3 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int is_target(char *line) { return NULL == strchr(line, ':') ? 0 : 1; }


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

x86 assembly (clang, -O2):
<is_target>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_target(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @strchr(i8* %3, i8 signext 58)
%5 = icmp eq i32* null, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_target(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 58)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ XNVCTRLQueryTargetBinaryData(int /*<<< orphan*/ *,
                                                int /*<<< orphan*/, int,
                                                unsigned int, unsigned int,
                                                unsigned char **, int *);
Bool XNVCTRLQueryBinaryData(Display *dpy, int screen, unsigned int display_mask,
                            unsigned int attribute, unsigned char **ptr,
                            int *len) {
  return XNVCTRLQueryTargetBinaryData(dpy, 0, screen, display_mask, attribute,
                                      ptr, len);
}


x86 assembly (clang, -O0):
<XNVCTRLQueryBinaryData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%rax
xor    %esi,%esi
mov    %rax,(%rsp)
call   1030 <XNVCTRLQueryTargetBinaryData@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XNVCTRLQueryBinaryData>:
push   %rax
mov    %r8,%rax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %r9,(%rsp)
xor    %esi,%esi
mov    %rax,%r9
call   1030 <XNVCTRLQueryTargetBinaryData@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @XNVCTRLQueryBinaryData(i32* %0, i32 %1, i32 %2, i32 %3, i8** %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32*
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8** %4, i8*** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i8**, i8*** %11
%18 = load i32*, i32** %12
%19 = call i32 @XNVCTRLQueryTargetBinaryData(i32* %13, i32 0, i32 %14, i32 %15, i32 %16, i8** %17, i32* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @XNVCTRLQueryBinaryData(i32* %0, i32 %1, i32 %2, i32 %3, i8** %4, i32* %5) {
%7 = tail call i32 @XNVCTRLQueryTargetBinaryData(i32* %0, i32 0, i32 %1, i32 %2, i32 %3, i8** %4, i32* %5)
ret i32 %7
}
/* Variables and functions */
double strtod(char const *, char **);
double __strtod(const char *nptr, char **endptr) {
  return strtod(nptr, endptr);
}


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

x86 assembly (clang, -O2):
<__strtod>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @__strtod(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 double @strtod(i8* %5, i8** %6)
ret double %7
}

LLVM IR (-O2):
define double @__strtod(i8* %0, i8** nocapture %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
ret double %3
}
/* Variables and functions */
int check_days(int, int);
int check_remaining_days(int year, int month, int day) {
  int days_in_month = check_days(year, month);
  return (days_in_month - day);
}


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

x86 assembly (clang, -O2):
<check_remaining_days>:
push   %rbx
mov    %edx,%ebx
call   1030 <check_days@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_remaining_days(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @check_days(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @check_remaining_days(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @check_days(i32 %0, i32 %1)
%5 = sub nsw i32 %4, %2
ret i32 %5
}
void vga_vsync() {
  asm volatile("mov   $0x03DA, %%dx\n"
               "current%=:"
               "in    %%dx, %%al\n"
               "and   $0x8, %%al\n"
               "jnz   current%=\n"
               "restart%=:"
               "in    %%dx, %%al\n"
               "and   $0x8, %%al\n"
               "jz    restart%=\n"
               :
               :
               : "al", "dx");
}


x86 assembly (clang, -O0):
<vga_vsync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3da,%dx

x86 assembly (clang, -O2):
<vga_vsync>:
mov    $0x3da,%dx

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

LLVM IR (-O2):
define void @vga_vsync() {
tail call void asm sideeffect "mov $$0x03DA, %dx\0Acurrent${:uid}:in %dx, %al\0Aand $$0x8, %al\0Ajnz current${:uid}\0Arestart${:uid}:in %dx, %al\0Aand $$0x8, %al\0Ajz restart${:uid}\0A", "~{al},~{dx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ min(float const, float const);
float saturate(int /*<<< orphan*/);
float CalcRangeFog(const float flProjPosZ, const float flFogStartOverRange,
                   const float flFogMaxDensity, const float flFogOORange) {
  return saturate(
      min(flFogMaxDensity, (flProjPosZ * flFogOORange) - flFogStartOverRange));
}


x86 assembly (clang, -O0):
<CalcRangeFog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
call   1030 <min@plt>
mov    %eax,%edi
call   1040 <saturate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcRangeFog>:
push   %rax
movaps %xmm0,%xmm4
mulss  %xmm3,%xmm4
subss  %xmm1,%xmm4
movaps %xmm2,%xmm0
movaps %xmm4,%xmm1
call   1030 <min@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <saturate@plt>

LLVM IR (-O0):
define float @CalcRangeFog(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = load float, float* %8
%12 = load float, float* %6
%13 = fneg float %12
%14 = call float @llvm.fmuladd.f32(float %10, float %11, float %13)
%15 = call i32 @min(float %9, float %14)
%16 = call float @saturate(i32 %15)
ret float %16
}

LLVM IR (-O2):
define float @CalcRangeFog(float %0, float %1, float %2, float %3) {
%5 = fneg float %1
%6 = tail call float @llvm.fmuladd.f32(float %0, float %3, float %5)
%7 = tail call i32 @min(float %2, float %6)
%8 = tail call float @saturate(i32 %7)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ioline_close() {
  printf("NOT IMPLEMENTED:"
         "pa_ioline_close"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_ioline_close\0A\00"
define i32 @pa_ioline_close() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_ioline_close\00"
define i32 @pa_ioline_close() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ logger(char *);
void printUsage() {
  logger("Usage: safefreeze TimeoutInSeconds MountPoint1 [MountPoint2 "
         "[MountPoint3 [..]]]\n");
}


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

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

LLVM IR (-O0):
@.str = [81 x i8] c"Usage: safefreeze TimeoutInSeconds MountPoint1 [MountPoint2 [MountPoint3 [..]]]\0A\00"
define void @printUsage() {
%1 = call i32 @logger(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [81 x i8] c"Usage: safefreeze TimeoutInSeconds MountPoint1 [MountPoint2 [MountPoint3 [..]]]\0A\00"
define void @printUsage() {
%1 = tail call i32 @logger(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void set_tcp_nodelay(int fd) {
  int flag = 1;
  setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int));
}


x86 assembly (clang, -O0):
<set_tcp_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tcp_nodelay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define void @set_tcp_nodelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define void @set_tcp_nodelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
void setSensorVal() {}


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

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

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

LLVM IR (-O2):
define void @setSensorVal() {
ret void
}
int xcmp(str1, str2)
register const char *str1, *str2;
{
  while (*str1 == *str2++)
    if (!*str1++)
      return 0;
  return (*(const unsigned char *)str1 - *(const unsigned char *)(str2 - 1));
}


x86 assembly (clang, -O0):
<xcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1156 <xcmp+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1151 <xcmp+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116a <xcmp+0x6a>
jmp    110c <xcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <xcmp+0x27>
add    $0x1,%rcx
test   %eax,%eax
jne    1110 <xcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @xcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = zext i8 %6 to i32
%15 = zext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ address;

/* Variables and functions */
unsigned int getUInt16(unsigned char *);
int /*<<< orphan*/ sciprintf(char *, int /*<<< orphan*/);
unsigned int getHeapUInt16(unsigned char *base, int address) {
  if (address & 1)
    sciprintf("Warning: Unaligned unsigned read from %04x\n", (address)&0xffff);
  return getUInt16(base + address);
}


x86 assembly (clang, -O0):
<getHeapUInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1153 <getHeapUInt16+0x33>
mov    -0xc(%rbp),%esi
and    $0xffff,%esi
lea    0xeb2(%rip),%rdi
call   1030 <sciprintf@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
call   1040 <getUInt16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHeapUInt16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   $0x1,%bpl
je     113d <getHeapUInt16+0x1d>
movzwl %bp,%esi
lea    0xec8(%rip),%rdi
call   1030 <sciprintf@plt>
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <getUInt16@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Warning: Unaligned unsigned read from %04x\0A\00"
define i32 @getHeapUInt16(i8* %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 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = and i32 %9, 65535
%11 = call i32 @sciprintf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = call i32 @getUInt16(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [44 x i8] c"Warning: Unaligned unsigned read from %04x\0A\00"
define i32 @getHeapUInt16(i8* %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = and i32 %1, 65535
%7 = tail call i32 @sciprintf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %2
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = tail call i32 @getUInt16(i8* %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ aligned_free(void *);
void mem_unmanaged_free(void *memory) { aligned_free(memory); }


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

x86 assembly (clang, -O2):
<mem_unmanaged_free>:
jmp    1030 <aligned_free@plt>

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

LLVM IR (-O2):
define void @mem_unmanaged_free(i8* %0) {
%2 = tail call i32 @aligned_free(i8* %0)
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double fma(double x, double y, double z) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<fma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call double (...) @__infer_nondet_double()
ret double %7
}

LLVM IR (-O2):
define double @fma(double %0, double %1, double %2) {
%4 = tail call double (...) @__infer_nondet_double()
ret double %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int numbtrop_dobldobl_clear(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(727, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_dobldobl_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_dobldobl_clear>:
mov    $0x2d7,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @numbtrop_dobldobl_clear() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 727, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void h(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @h(i8* nocapture %0, ...) {
ret void
}
int main(int argc, char **argv) {
  char pass[32] = {0};
  char hash[] = {"32B>I8[(R[B.X9E"};
  decript(hash, pass);
  printf("Password Decriptado: %s\n", pass);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    0xea3(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1050 <decript@plt>
lea    -0x30(%rbp),%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <decript@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.hash = [16 x i8] c"32B>I8[(R[B.X9E\00"
@.str = [25 x i8] c"Password Decriptado: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i8]
%7 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [32 x i8]* %6 to i8*
%9 = bitcast [16 x i8]* %7 to i8*
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @decript to i32 (i8*, i8*, ...)*)(i8* %10, i8* %11)
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.hash = [16 x i8] c"32B>I8[(R[B.X9E\00"
@.str = [25 x i8] c"Password Decriptado: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @decript to i32 (i8*, i8*, ...)*)(i8* %6, i8* %5)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
char *getPermutation(int, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  for (int i = 1; i <= 120; i++)
    printf("%d:\t%s\n", i, getPermutation(5, i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x78,-0x8(%rbp)
jg     1173 <main+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x5,%edi
call   1040 <getPermutation@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    $0x5,%edi
mov    %ebx,%esi
call   1040 <getPermutation@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x79,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d:\09%s\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %6, %2 ]
%4 = tail call i8* @getPermutation(i32 5, i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 121
br i1 %7, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ default_parser(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
void _test_pass0(char *text) {
  printf("    ");
  default_parser(0, "Ok  ");
  printf(": [ %s ]\n", text);
}


x86 assembly (clang, -O0):
<_test_pass0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
lea    0xec2(%rip),%rsi
call   1040 <default_parser@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_pass0>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rsi
xor    %edi,%edi
call   1040 <default_parser@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" \00"
@.str.1 = [5 x i8] c"Ok \00"
@.str.2 = [10 x i8] c": [ %s ]\0A\00"
define void @_test_pass0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @default_parser(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
@.str.1 = [5 x i8] c"Ok \00"
@.str.2 = [10 x i8] c": [ %s ]\0A\00"
define void @_test_pass0(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @default_parser(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int time_total_centiseconds(float);
int time_minutes(float t) { return time_total_centiseconds(t) / (60 * 100); }


x86 assembly (clang, -O0):
<time_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <time_total_centiseconds@plt>
mov    $0x1770,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_minutes>:
push   %rax
call   1030 <time_total_centiseconds@plt>
cltq
imul   $0x57619f1,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @time_minutes(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @time_total_centiseconds(float %3)
%5 = sdiv i32 %4, 6000
ret i32 %5
}

LLVM IR (-O2):
define i32 @time_minutes(float %0) {
%2 = tail call i32 @time_total_centiseconds(float %0)
%3 = sdiv i32 %2, 6000
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xdb() {
  Assert_real((isupper(219) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1100, ("isupper should be 0 for 0xdb"));
}


x86 assembly (clang, -O0):
<t_isupper_0xdb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdb,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x44c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xdb>:
push   %rax
mov    $0xdb,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x44c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xdb\00"
define void @t_isupper_0xdb() {
%1 = call i64 @isupper(i32 219)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xdb\00"
define void @t_isupper_0xdb() {
%1 = tail call i64 @isupper(i32 219)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void console_putch(int ch) { putchar(ch); }


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

x86 assembly (clang, -O2):
<console_putch>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @console_putch(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ regular_char_wildcard_encoded_p(char);
char regular_char_wildcard_decode(char c) {
  if (regular_char_wildcard_encoded_p(c)) {
    return c & (char)(~((char)0x80));
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<regular_char_wildcard_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <regular_char_wildcard_encoded_p@plt>
cmp    $0x0,%rax
je     1140 <regular_char_wildcard_decode+0x30>
movsbl -0x2(%rbp),%eax
and    $0x7f,%eax
mov    %al,-0x1(%rbp)
jmp    1146 <regular_char_wildcard_decode+0x36>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regular_char_wildcard_decode>:
push   %rbx
mov    %edi,%ebx
call   1030 <regular_char_wildcard_encoded_p@plt>
mov    %ebx,%ecx
and    $0x7f,%cl
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @regular_char_wildcard_decode(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @regular_char_wildcard_encoded_p(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = and i32 %9, 127
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %14
12: ; preds = %1
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @regular_char_wildcard_decode(i8 signext %0) {
%2 = tail call i64 @regular_char_wildcard_encoded_p(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = and i8 %0, 127
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef size_t ssize_t;

/* Variables and functions */
void uint32_swapper(void *a, ssize_t b, ssize_t c) {
  uint32_t d;
  d = ((uint32_t *)(a))[b];
  ((uint32_t *)(a))[b] = ((uint32_t *)(a))[c];
  ((uint32_t *)(a))[c] = d;
}


x86 assembly (clang, -O0):
<uint32_swapper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_swapper>:
mov    (%rdi,%rsi,4),%eax
mov    (%rdi,%rdx,4),%ecx
mov    %ecx,(%rdi,%rsi,4)
mov    %eax,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @uint32_swapper(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i64, i64* %5
%11 = getelementptr inbounds i32, i32* %9, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = load i64, i64* %6
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i32*
%20 = load i64, i64* %5
%21 = getelementptr inbounds i32, i32* %19, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i8*, i8** %4
%24 = bitcast i8* %23 to i32*
%25 = load i64, i64* %6
%26 = getelementptr inbounds i32, i32* %24, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @uint32_swapper(i8* nocapture %0, i64 %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 %1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %4, i64 %2
%8 = load i32, i32* %7
store i32 %8, i32* %5
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double log10(int);
double logtwo(double x) {
  assert(x > 0);
  return log10(x) / log10(2);
}


x86 assembly (clang, -O0):
<logtwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cvttsd2si -0x8(%rbp),%edi
call   1040 <log10@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logtwo>:
push   %rax
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
seta   %dil
call   1030 <assert@plt>
cvttsd2si (%rsp),%edi
call   1040 <log10@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1040 <log10@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logtwo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load double, double* %2
%8 = fptosi double %7 to i32
%9 = call double @log10(i32 %8)
%10 = call double @log10(i32 2)
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @logtwo(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = fptosi double %0 to i32
%6 = tail call double @log10(i32 %5)
%7 = tail call double @log10(i32 2)
%8 = fdiv double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *removeDups(char *);
int main(int argc, const char *argv[]) {
  char *str = removeDups("RuR");
  if (str != NULL)
    printf("%s\n", str);
  else
    printf("NULL\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <removeDups@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1168 <main+0x48>
mov    -0x18(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1176 <main+0x56>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <removeDups@plt>
test   %rax,%rax
je     1137 <main+0x17>
mov    %rax,%rdi
jmp    113e <main+0x1e>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"RuR\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"NULL\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @removeDups(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"RuR\00"
@str = [5 x i8] c"NULL\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @removeDups(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* %3)
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}