xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void lowceiling(void) {
  niceprint("The clearance of the cave or passage lowers suddenly to 3 feet "
            "above the water's surface. "
            "Each Medium character must succeed on a DC 10 Dexterity saving "
            "throw or take 1d4 "
            "bludgeoning damage from hitting the ceiling before the passage "
            "ends.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [242 x i8] c"The clearance of the cave or passage lowers suddenly to 3 feet above the water's surface. Each Medium character must succeed on a DC 10 Dexterity saving throw or take 1d4 bludgeoning damage from hitting the ceiling before the passage ends.\0A\0A\00"
define void @lowceiling() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [242 x i8] c"The clearance of the cave or passage lowers suddenly to 3 feet above the water's surface. Each Medium character must succeed on a DC 10 Dexterity saving throw or take 1d4 bludgeoning damage from hitting the ceiling before the passage ends.\0A\0A\00"
define void @lowceiling() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2(float *, float, float, float, float);
__attribute__((always_)) struct mat2 *psmat2(struct mat2 *result, float m11,
                                             float m12, float m21, float m22) {
  mat2((float *)result, m11, m12, m21, m22);
  return result;
}


x86 assembly (clang, -O0):
<psmat2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1030 <mat2@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat2@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2(%struct.mat2* %0, float %1, float %2, float %3, float %4) {
%6 = alloca %struct.mat2*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store %struct.mat2* %0, %struct.mat2** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load %struct.mat2*, %struct.mat2** %6
%12 = bitcast %struct.mat2* %11 to float*
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = call i32 @mat2(float* %12, float %13, float %14, float %15, float %16)
%18 = load %struct.mat2*, %struct.mat2** %6
ret %struct.mat2* %18
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2(%struct.mat2* returned %0, float %1, float %2, float %3, float %4) {
%6 = bitcast %struct.mat2* %0 to float*
%7 = tail call i32 @mat2(float* %6, float %1, float %2, float %3, float %4)
ret %struct.mat2* %0
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Toggle();
void TelosbBaseStationC__Leds__led1Toggle(void) { LedsP__Leds__led1Toggle(); }


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

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

LLVM IR (-O0):
define void @TelosbBaseStationC__Leds__led1Toggle() {
%1 = call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}

LLVM IR (-O2):
define void @TelosbBaseStationC__Leds__led1Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}
void sigwinch(int type) {}


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

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

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

LLVM IR (-O2):
define void @sigwinch(i32 %0) {
ret void
}
int test_imm_4Cuint8_mem(unsigned char *val) {
  return ((*val) & (-0x4C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Cuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -76
%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_4Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -76
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_4Fuint16_reg(unsigned short val) {
  return ((val) & (-0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fuint16_reg>:
test   $0xffb1,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -79
%6 = icmp ne i32 %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_4Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -79
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *strchr(char *, char);
void strrepl(char **str, char c_old, char c_new) {
  char *pos;
  while ((pos = strchr(*str, c_old)) != 0)
    pos[0] = c_new;
}


x86 assembly (clang, -O0):
<strrepl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1153 <strrepl+0x43>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1127 <strrepl+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrepl>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     1142 <strrepl+0x32>
movsbl %bpl,%ebp
nopl   (%rax)
mov    %r14b,(%rax)
mov    (%rbx),%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <strrepl+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @strrepl(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
br label %8
8: ; preds = %14, %3
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = load i8, i8* %5
%12 = call i8* @strchr(i8* %10, i8 signext %11)
store i8* %12, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i8, i8* %6
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
br label %8
18: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @strrepl(i8** nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8*, i8** %0
%5 = tail call i8* @strchr(i8* dereferenceable(1) %4, i8 signext %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %3, %7
%8 = phi i8* [ %10, %7 ], [ %5, %3 ]
store i8 %2, i8* %8
%9 = load i8*, i8** %0
%10 = tail call i8* @strchr(i8* dereferenceable(1) %9, i8 signext %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %7
12: ; preds = %7, %3
ret void
}
/* Variables and functions */
int fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101(
    char const *);
int fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101>:
jmp    1030 <fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101(i8* %0) {
%2 = tail call i32 @fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_72_ch_97_ch_115_ch_86_ch_97_ch_108_ch_117_ch_101(i8* %0)
ret i32 %2
}
int readSerialReal() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @readSerialReal() {
ret i32 -1
}
int test_imm_A4uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xA4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A4uint64_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, 164
%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_A4uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 704374636544
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
bool _assertIntEquals(int expected, int actual, int line) {
  if (expected == actual) {
    return true;
  } else {
    printf("assertIntEquals FAILED, line %i, expected: %i, actual: %i\n", line,
           expected, actual);
    return false;
  }
}


x86 assembly (clang, -O0):
<_assertIntEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1139 <_assertIntEquals+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1155 <_assertIntEquals+0x45>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertIntEquals>:
mov    $0x1,%eax
cmp    %esi,%edi
je     1138 <_assertIntEquals+0x28>
push   %rax
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xeda(%rip),%rdi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"assertIntEquals FAILED, line %i, expected: %i, actual: %i\0A\00"
define i32 @_assertIntEquals(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 1, i32* %4
br label %17
12: ; preds = %3
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
store i32 0, i32* %4
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [59 x i8] c"assertIntEquals FAILED, line %i, expected: %i, actual: %i\0A\00"
define i32 @_assertIntEquals(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ 0, %5 ], [ 1, %3 ]
ret i32 %8
}
void genbgezl() {}


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

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

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

LLVM IR (-O2):
define void @genbgezl() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t htonll(uint64_t v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @htonll(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct MCTStatStruc {
  int dummy;
};
struct DCTStatStruc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mct_SetClToNB_D(struct MCTStatStruc *,
                                   struct DCTStatStruc *);
int /*<<< orphan*/ mct_SetWbEnhWsbDis_D(struct MCTStatStruc *,
                                        struct DCTStatStruc *);
void mct_InitialMCT_D(struct MCTStatStruc *pMCTstat,
                      struct DCTStatStruc *pDCTstat) {
  mct_SetClToNB_D(pMCTstat, pDCTstat);
  mct_SetWbEnhWsbDis_D(pMCTstat, pDCTstat);
}


x86 assembly (clang, -O0):
<mct_InitialMCT_D>:
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   1040 <mct_SetClToNB_D@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mct_SetWbEnhWsbDis_D@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mct_InitialMCT_D>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <mct_SetClToNB_D@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mct_SetWbEnhWsbDis_D@plt>

LLVM IR (-O0):
%struct.MCTStatStruc = type { i32 }
%struct.DCTStatStruc = type { i32 }
define void @mct_InitialMCT_D(%struct.MCTStatStruc* %0, %struct.DCTStatStruc* %1) {
%3 = alloca %struct.MCTStatStruc*
%4 = alloca %struct.DCTStatStruc*
store %struct.MCTStatStruc* %0, %struct.MCTStatStruc** %3
store %struct.DCTStatStruc* %1, %struct.DCTStatStruc** %4
%5 = load %struct.MCTStatStruc*, %struct.MCTStatStruc** %3
%6 = load %struct.DCTStatStruc*, %struct.DCTStatStruc** %4
%7 = call i32 @mct_SetClToNB_D(%struct.MCTStatStruc* %5, %struct.DCTStatStruc* %6)
%8 = load %struct.MCTStatStruc*, %struct.MCTStatStruc** %3
%9 = load %struct.DCTStatStruc*, %struct.DCTStatStruc** %4
%10 = call i32 @mct_SetWbEnhWsbDis_D(%struct.MCTStatStruc* %8, %struct.DCTStatStruc* %9)
ret void
}

LLVM IR (-O2):
%struct.MCTStatStruc = type { i32 }
%struct.DCTStatStruc = type { i32 }
define void @mct_InitialMCT_D(%struct.MCTStatStruc* %0, %struct.DCTStatStruc* %1) {
%3 = tail call i32 @mct_SetClToNB_D(%struct.MCTStatStruc* %0, %struct.DCTStatStruc* %1)
%4 = tail call i32 @mct_SetWbEnhWsbDis_D(%struct.MCTStatStruc* %0, %struct.DCTStatStruc* %1)
ret void
}
/* Variables and functions */
int get_nonce();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", get_nonce());
  printf("%d\n", get_nonce());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <get_nonce@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <get_nonce@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void confusion_song(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 130)) {
    add_status(target, 8);
  }
}


x86 assembly (clang, -O0):
<confusion_song>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x82,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <confusion_song+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confusion_song>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x82,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <confusion_song+0x41>
mov    %r14,%rdi
mov    $0x8,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @confusion_song(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 130)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 8)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @confusion_song(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 130)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 8)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void pi_sleep(int t) { usleep(t * 1000); }


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

x86 assembly (clang, -O2):
<pi_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @pi_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @pi_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int generic_wrapper(void *context, const void *first, const void *second) {
  return (*(int (**)(const void *, const void *))context)(first, second);
}


x86 assembly (clang, -O0):
<generic_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_wrapper>:
mov    (%rdi),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    *%rax

LLVM IR (-O0):
define i32 @generic_wrapper(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 = bitcast i8* %7 to i32 (i8*, i8*)**
%9 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 %9(i8* %10, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @generic_wrapper(i8* nocapture %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i32 (i8*, i8*)**
%5 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %4
%6 = tail call i32 %5(i8* %1, i8* %2)
ret i32 %6
}
void task_recevie_msg_abort(void) {}


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

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

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

LLVM IR (-O2):
define void @task_recevie_msg_abort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void banner() {
  printf("RPilot: Rob's PILOT Interpreter, version %s\n", "1.4.2");
  printf("Copyright 1998,2002 Rob Linwood (rcl211@nyu.edu)\n");
  printf("RPilot is Free Software. Please see http://rpilot.sf.net/\n");
  printf("For help, try `rpilot -?'\n\n");
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xefe(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"RPilot: Rob's PILOT Interpreter, version %s\0A\00"
@.str.1 = [6 x i8] c"1.4.2\00"
@.str.2 = [50 x i8] c"Copyright 1998,2002 Rob Linwood (rcl211@nyu.edu)\0A\00"
@.str.3 = [59 x i8] c"RPilot is Free Software. Please see http://rpilot.sf.net/\0A\00"
@.str.4 = [28 x i8] c"For help, try `rpilot -?'\0A\0A\00"
define void @banner() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"RPilot: Rob's PILOT Interpreter, version %s\0A\00"
@.str.1 = [6 x i8] c"1.4.2\00"
@str = [49 x i8] c"Copyright 1998,2002 Rob Linwood (rcl211@nyu.edu)\00"
@str.5 = [58 x i8] c"RPilot is Free Software. Please see http://rpilot.sf.net/\00"
@str.6 = [27 x i8] c"For help, try `rpilot -?'\0A\00"
define void @banner() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
scalar_t__ __syscall_nice(int);
int getpriority(int /*<<< orphan*/, int /*<<< orphan*/);
int nice(int incr) {
  if (__syscall_nice(incr)) {
    return -1;
  }
  return getpriority(PRIO_PROCESS, 0);
}


x86 assembly (clang, -O0):
<nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <__syscall_nice@plt>
cmp    $0x0,%rax
je     1149 <nice+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <nice+0x3c>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nice>:
push   %rax
call   1040 <__syscall_nice@plt>
test   %rax,%rax
je     1132 <nice+0x12>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <getpriority@plt>

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
define i32 @nice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @__syscall_nice(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* @PRIO_PROCESS
%10 = call i32 @getpriority(i32 %9, i32 0)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
define i32 @nice(i32 %0) {
%2 = tail call i64 @__syscall_nice(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @PRIO_PROCESS
%6 = tail call i32 @getpriority(i32 %5, i32 0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
int test_imm_B8int32_reg(int val) { return ((val) & (0xB8 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_B8int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xb8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B8int32_reg>:
test   $0xb8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B8int32_reg(i32 %0) {
%2 = and i32 %0, 184
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double const,
                           double const, double const);
void sig1_print1(FILE *stream, double const *cycle) {
  fprintf(stream, "%.5G;%.5G;%.5G\n", cycle[0], cycle[1], cycle[2] / 2.0);
}


x86 assembly (clang, -O0):
<sig1_print1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
movsd  0xeba(%rip),%xmm3
divsd  %xmm3,%xmm2
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig1_print1>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm2
mulsd  0xeda(%rip),%xmm2
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%.5G;%.5G;%.5G\0A\00"
define void @sig1_print1(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
store i32* %0, i32** %3
store double* %1, double** %4
%5 = load i32*, i32** %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = fdiv double %14, 2.000000e+00
%16 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8, double %11, double %15)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%.5G;%.5G;%.5G\0A\00"
define void @sig1_print1(i32* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = load double, double* %6
%8 = fmul double %7, 5.000000e-01
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %3, double %5, double %8)
ret void
}
void store_le32(unsigned int v, unsigned char *p) {
  p[0] = v;
  p[1] = v >>= 8;
  p[2] = v >>= 8;
  p[3] = v >> 8;
}


x86 assembly (clang, -O0):
<store_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_le32>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @store_le32(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned long, int,
                            char const *, char const *);
int phPlaceCall2(const char *from, const char *uri, void *userData, int rcid) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "CALL UDATA=%08lx RCID=%d FROM=%s TO=%s",
           (unsigned long)userData, rcid, from, uri);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phPlaceCall2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x8(%rbp),%r9
mov    -0x10(%rbp),%rax
mov    $0x3e8,%esi
lea    0xea3(%rip),%rdx
mov    %rax,(%rsp)
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phPlaceCall2>:
push   %rbx
sub    $0x400,%rsp
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rdi,%r9
mov    %rsi,(%rsp)
lea    0xec4(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"CALL UDATA=%08lx RCID=%d FROM=%s TO=%s\00"
define i32 @phPlaceCall2(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [1000 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %7
%12 = ptrtoint i8* %11 to i64
%13 = load i32, i32* %8
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i32 @snprintf(i8* %10, i32 1000, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %12, i32 %13, i8* %14, i8* %15)
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%18 = call i32 @ph_rpc(i8* %17)
ret i32 %18
}

LLVM IR (-O2):
@.str = [39 x i8] c"CALL UDATA=%08lx RCID=%d FROM=%s TO=%s\00"
define i32 @phPlaceCall2(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [1000 x i8]
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = ptrtoint i8* %2 to i64
%8 = call i32 @snprintf(i8* %6, i32 1000, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %3, i8* %0, i8* %1)
%9 = call i32 @ph_rpc(i8* %6)
ret i32 %9
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t hash_32(u_int32_t val, unsigned int bits) {
  u_int32_t hash = val * 0x9e370001UL;
  return hash >> (32 - bits);
}


x86 assembly (clang, -O0):
<hash_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x9e370001,%rcx
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_32>:
mov    %esi,%ecx
imul   $0x9e370001,%edi,%eax
neg    %cl
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @hash_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 2654404609
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub i32 32, %11
%13 = ashr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash_32(i32 %0, i32 %1) {
%3 = mul i32 %0, -1640562687
%4 = sub i32 32, %1
%5 = ashr i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_four() { printf("4\n"); }


x86 assembly (clang, -O0):
<print_four>:
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):
<print_four>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"4\00"
define i32 @print_four() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ DeferredPowerManagerP__0__ResourceDefaultOwner__granted();
void ArbiterP__1__ResourceDefaultOwner__granted(void) {
  DeferredPowerManagerP__0__ResourceDefaultOwner__granted();
}


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

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

LLVM IR (-O0):
define void @ArbiterP__1__ResourceDefaultOwner__granted() {
%1 = call i32 (...) @DeferredPowerManagerP__0__ResourceDefaultOwner__granted()
ret void
}

LLVM IR (-O2):
define void @ArbiterP__1__ResourceDefaultOwner__granted() {
%1 = tail call i32 (...) @DeferredPowerManagerP__0__ResourceDefaultOwner__granted()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_path(char *);
int /*<<< orphan*/ free(char *);
char *get_filename();
int /*<<< orphan*/ save_to_file(char *, unsigned char *, unsigned long);
void save(unsigned char *buffer, unsigned long size) {
  char *filename = get_filename();
  check_path(filename);
  save_to_file(filename, buffer, size);
  free(filename);
}


x86 assembly (clang, -O0):
<save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_filename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <check_path@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <save_to_file@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <get_filename@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <check_path@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <save_to_file@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @save(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i8* (...) @get_filename()
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @check_path(i8* %7)
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @save_to_file(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
define void @save(i8* %0, i64 %1) {
%3 = tail call i8* (...) @get_filename()
%4 = tail call i32 @check_path(i8* %3)
%5 = tail call i32 @save_to_file(i8* %3, i8* %0, i64 %1)
%6 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void command_help(char const *progname, char const *const *argv,
                  char const *filename, int line) {
  puts("Graphdateline is a test client for the graph_dateline data type in "
       "libgraph.a\n"
       "\n"
       "Below, X and Y stand for single-character variable names;\n"
       "DBID stands for a 48-bit database ID, written as a number.\n"
       "N stands for a 34-bit element count, written as a number.\n"
       "\n"
       "Quickreference:\n"
       "    help                 create X        add  X DBID N IID\n"
       "    quit                 destroy X\n"
       "    dump X               format X\n"
       "    time [on / off]\n"
       "    time now\n");
}


x86 assembly (clang, -O0):
<command_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [433 x i8] c"Graphdateline is a test client for the graph_dateline data type in libgraph.a\0A\0ABelow, X and Y stand for single-character variable names;\0ADBID stands for a 48-bit database ID, written as a number.\0AN stands for a 34-bit element count, written as a number.\0A\0AQuickreference:\0A help create X add X DBID N IID\0A quit destroy X\0A dump X format X\0A time [on / off]\0A time now\0A\00"
define void @command_help(i8* %0, i8** %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 @puts(i8* getelementptr inbounds ([433 x i8], [433 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [433 x i8] c"Graphdateline is a test client for the graph_dateline data type in libgraph.a\0A\0ABelow, X and Y stand for single-character variable names;\0ADBID stands for a 48-bit database ID, written as a number.\0AN stands for a 34-bit element count, written as a number.\0A\0AQuickreference:\0A help create X add X DBID N IID\0A quit destroy X\0A dump X format X\0A time [on / off]\0A time now\0A\00"
define void @command_help(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([433 x i8], [433 x i8]* @.str, i64 0, i64 0))
ret void
}
int foo(x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
int find_fct(int *fct_list, int num_fct, int fct) {
  int *p;
  for (p = fct_list; p < &fct_list[num_fct]; p++)
    if (*p == fct)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<find_fct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1163 <find_fct+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x18(%rbp),%eax
jne    114d <find_fct+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    116a <find_fct+0x6a>
jmp    1152 <find_fct+0x52>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1116 <find_fct+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_fct>:
xor    %eax,%eax
test   %esi,%esi
jle    111d <find_fct+0x1d>
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
nopl   (%rax)
cmp    %edx,(%rdi)
je     111e <find_fct+0x1e>
add    $0x4,%rdi
cmp    %rcx,%rdi
jb     1110 <find_fct+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @find_fct(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = icmp sgt i32 %1, 0
br i1 %6, label %9, label %14
7: ; preds = %9
%8 = icmp ult i32* %13, %5
br i1 %8, label %9, label %14
9: ; preds = %3, %7
%10 = phi i32* [ %13, %7 ], [ %0, %3 ]
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %2
%13 = getelementptr inbounds i32, i32* %10, i64 1
br i1 %12, label %14, label %7
14: ; preds = %9, %7, %3
%15 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ rv;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *mergedname(int a) {
  static char rv[32];
  snprintf(rv, sizeof(rv), "merged-%d", a);
  return rv;
}


x86 assembly (clang, -O0):
<mergedname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x20,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergedname>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@mergedname.rv = internal global [32 x i8] zeroinitializer
@.str = [10 x i8] c"merged-%d\00"
define i8* @mergedname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mergedname.rv, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mergedname.rv, i64 0, i64 0)
}

LLVM IR (-O2):
@mergedname.rv = internal global [32 x i8] zeroinitializer
@.str = [10 x i8] c"merged-%d\00"
define i8* @mergedname(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mergedname.rv, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mergedname.rv, i64 0, i64 0)
}