xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LoadRegistre(int, unsigned int);
int /*<<< orphan*/ ipc(int, int);
void sleep(unsigned milliseconds) {
  LoadRegistre(0, 4);
  LoadRegistre(1, 3);
  LoadRegistre(2, milliseconds);
  ipc(3, 4);
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x4,%esi
call   1030 <LoadRegistre@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <LoadRegistre@plt>
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <LoadRegistre@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <ipc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x4,%esi
call   1030 <LoadRegistre@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <LoadRegistre@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <LoadRegistre@plt>
mov    $0x3,%edi
mov    $0x4,%esi
pop    %rbx
jmp    1040 <ipc@plt>

LLVM IR (-O0):
define void @sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @LoadRegistre(i32 0, i32 4)
%4 = call i32 @LoadRegistre(i32 1, i32 3)
%5 = load i32, i32* %2
%6 = call i32 @LoadRegistre(i32 2, i32 %5)
%7 = call i32 @ipc(i32 3, i32 4)
ret void
}

LLVM IR (-O2):
define void @sleep(i32 %0) {
%2 = tail call i32 @LoadRegistre(i32 0, i32 4)
%3 = tail call i32 @LoadRegistre(i32 1, i32 3)
%4 = tail call i32 @LoadRegistre(i32 2, i32 %0)
%5 = tail call i32 @ipc(i32 3, i32 4)
ret void
}
float simple_fabs(const float x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<simple_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <simple_fabs+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <simple_fabs+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @simple_fabs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @simple_fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ NDFC_WRITE_REG_INT(int);
void NFC_DmaIntEnable(void) { NDFC_WRITE_REG_INT((1 << 2)); }


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

x86 assembly (clang, -O2):
<NFC_DmaIntEnable>:
mov    $0x4,%edi
jmp    1030 <NDFC_WRITE_REG_INT@plt>

LLVM IR (-O0):
define void @NFC_DmaIntEnable() {
%1 = call i32 @NDFC_WRITE_REG_INT(i32 4)
ret void
}

LLVM IR (-O2):
define void @NFC_DmaIntEnable() {
%1 = tail call i32 @NDFC_WRITE_REG_INT(i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpi32_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 __attribute__((no, unused)) test(__m128 __A, __m64 __B) {
  return _mm_cvtpi32_ps(__A, __B);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cvtpi32_ps@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cvtpi32_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int create_standard_Laurent_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(792, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<create_standard_Laurent_homotopy>:
mov    $0x318,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @create_standard_Laurent_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 792, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int test_imm_EAint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xEA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EAint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 234
%7 = icmp ne i64 %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_EAint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1005022347264
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float exp_approx(float);
float log_approx(float);
float pow_approx(float a, float b) { return exp_approx(b * log_approx(a)); }


x86 assembly (clang, -O0):
<pow_approx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <log_approx@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <exp_approx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_approx>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1040 <log_approx@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <exp_approx@plt>

LLVM IR (-O0):
define float @pow_approx(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = call float @log_approx(float %6)
%8 = fmul float %5, %7
%9 = call float @exp_approx(float %8)
ret float %9
}

LLVM IR (-O2):
define float @pow_approx(float %0, float %1) {
%3 = tail call float @log_approx(float %0)
%4 = fmul float %3, %1
%5 = tail call float @exp_approx(float %4)
ret float %5
}
/* Variables and functions */
char const *CK_VAR_GetString(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, int);
const char *CK_VAR_GetStringByNameAndIndex(const char *name, int index) {
  char fullName[256];
  sprintf(fullName, "%s%d", name, index);
  return CK_VAR_GetString(fullName, fullName);
}


x86 assembly (clang, -O0):
<CK_VAR_GetStringByNameAndIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <CK_VAR_GetString@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CK_VAR_GetStringByNameAndIndex>:
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <CK_VAR_GetString@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%d\00"
define i8* @CK_VAR_GetStringByNameAndIndex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = call i8* @CK_VAR_GetString(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%d\00"
define i8* @CK_VAR_GetStringByNameAndIndex(i8* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = call i8* @CK_VAR_GetString(i8* %4, i8* %4)
ret i8* %6
}
long int maxValue(long a, long b, long c) {
  long maxVal = a > b ? a : b;
  return (maxVal > c ? maxVal : c);
}


x86 assembly (clang, -O0):
<maxValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    112b <maxValue+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1133 <maxValue+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1156 <maxValue+0x56>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    115e <maxValue+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxValue>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
cmp    %rdx,%rax
cmovle %rdx,%rax
ret

LLVM IR (-O0):
define i64 @maxValue(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = icmp sgt i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i64, i64* %4
br label %15
13: ; preds = %3
%14 = load i64, i64* %5
br label %15
15: ; preds = %13, %11
%16 = phi i64 [ %12, %11 ], [ %14, %13 ]
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = load i64, i64* %6
%19 = icmp sgt i64 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i64, i64* %7
br label %24
22: ; preds = %15
%23 = load i64, i64* %6
br label %24
24: ; preds = %22, %20
%25 = phi i64 [ %21, %20 ], [ %23, %22 ]
ret i64 %25
}

LLVM IR (-O2):
define i64 @maxValue(i64 %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %0, %1
%5 = select i1 %4, i64 %0, i64 %1
%6 = icmp sgt i64 %5, %2
%7 = select i1 %6, i64 %5, i64 %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void snail_cnt_reset(void) {
  mbus_remote_register_write(0x5, 0x01, ((0 << 5) | (0 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<snail_cnt_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x9,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snail_cnt_reset>:
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x9,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @snail_cnt_reset() {
%1 = call i32 @mbus_remote_register_write(i32 5, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
define void @snail_cnt_reset() {
%1 = tail call i32 @mbus_remote_register_write(i32 5, i32 1, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printNumber(float);
float rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srand(time(NULL));
  float tar = rand() / 1e6f;
  printNumber(tar);
  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)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
movss  0xe8b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <printNumber@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
divss  0xea2(%rip),%xmm0
call   1040 <printNumber@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
%9 = call float (...) @rand()
%10 = fdiv float %9, 1.000000e+06
store float %10, float* %6
%11 = load float, float* %6
%12 = call i32 @printNumber(float %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call float (...) @rand()
%6 = fdiv float %5, 1.000000e+06
%7 = tail call i32 @printNumber(float %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
int8_t bno_hal_write(uint8_t address, uint8_t reg_address, uint8_t *data_in,
                     uint8_t data_size) {
  uint8_t temp_buff[512];
  uint8_t *temp_ptr = data_in;
  uint8_t *temp_buff_ptr = temp_buff;
  temp_buff[0] = reg_address;
  memcpy(&temp_buff[1], temp_ptr, data_size);
}


x86 assembly (clang, -O0):
<bno_hal_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x828(%rbp)
lea    -0x820(%rbp),%rax
mov    %rax,-0x830(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x820(%rbp)
lea    -0x820(%rbp),%rdi
add    $0x4,%rdi
mov    -0x828(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bno_hal_write>:
sub    $0x808,%rsp
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    $0x808,%rsp
ret

LLVM IR (-O0):
define i32 @bno_hal_write(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca [512 x i32]
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%13 = load i32*, i32** %8
store i32* %13, i32** %11
%14 = getelementptr inbounds [512 x i32], [512 x i32]* %10, i64 0, i64 0
store i32* %14, i32** %12
%15 = load i32, i32* %7
%16 = getelementptr inbounds [512 x i32], [512 x i32]* %10, i64 0, i64 0
store i32 %15, i32* %16
%17 = getelementptr inbounds [512 x i32], [512 x i32]* %10, i64 0, i64 1
%18 = load i32*, i32** %11
%19 = load i32, i32* %9
%20 = call i32 @memcpy(i32* %17, i32* %18, i32 %19)
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @bno_hal_write(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca [512 x i32]
%6 = bitcast [512 x i32]* %5 to i8*
%7 = getelementptr inbounds [512 x i32], [512 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [512 x i32], [512 x i32]* %5, i64 0, i64 1
%9 = call i32 @memcpy(i32* %8, i32* %2, i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __NR_shmdt;
int syscall(int /*<<< orphan*/, void const *);
int shmdt(const void *shmaddr) { return syscall(__NR_shmdt, shmaddr); }


x86 assembly (clang, -O0):
<shmdt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmdt>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_shmdt = global i32 0
define i32 @shmdt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @__NR_shmdt
%4 = load i8*, i8** %2
%5 = call i32 @syscall(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@__NR_shmdt = global i32 0
define i32 @shmdt(i8* %0) {
%2 = load i32, i32* @__NR_shmdt
%3 = tail call i32 @syscall(i32 %2, i8* %0)
ret i32 %3
}
/* Type definitions */
struct OCRkit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ocrLineLoop(struct OCRkit *);
void startOcr(struct OCRkit *ocrKit) { ocrLineLoop(ocrKit); }


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

x86 assembly (clang, -O2):
<startOcr>:
jmp    1030 <ocrLineLoop@plt>

LLVM IR (-O0):
%struct.OCRkit = type { i32 }
define void @startOcr(%struct.OCRkit* %0) {
%2 = alloca %struct.OCRkit*
store %struct.OCRkit* %0, %struct.OCRkit** %2
%3 = load %struct.OCRkit*, %struct.OCRkit** %2
%4 = call i32 @ocrLineLoop(%struct.OCRkit* %3)
ret void
}

LLVM IR (-O2):
%struct.OCRkit = type { i32 }
define void @startOcr(%struct.OCRkit* %0) {
%2 = tail call i32 @ocrLineLoop(%struct.OCRkit* %0)
ret void
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int const INT64_C(int);
int32_t aeron_mul_wrap_i32(int32_t a, int32_t b) {
  const int64_t a_widened = a;
  const int64_t b_widened = b;
  const int64_t product = a_widened * b_widened;
  return (int32_t)(product & INT64_C(0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<aeron_mul_wrap_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <INT64_C@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
and    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_mul_wrap_i32>:
push   %rbx
mov    %edi,%ebx
imul   %esi,%ebx
mov    $0xffffffff,%edi
call   1030 <INT64_C@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @aeron_mul_wrap_i32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 @INT64_C(i32 -1)
%15 = and i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @aeron_mul_wrap_i32(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @INT64_C(i32 -1)
%5 = and i32 %4, %3
ret i32 %5
}
/* Type definitions */
struct winsize {
  scalar_t__ ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int ioctl(int /*<<< orphan*/, int /*<<< orphan*/, struct winsize *);
int console_width() {
  struct winsize ws;
  if (ioctl(0, TIOCGWINSZ, &ws) == -1)
    return 80;
  else
    return (int)ws.ws_col;
}


x86 assembly (clang, -O0):
<console_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1141 <console_width+0x31>
movl   $0x50,-0x4(%rbp)
jmp    1148 <console_width+0x38>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_width>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
mov    %eax,%ecx
mov    $0x50,%eax
cmp    $0xffffffff,%ecx
je     1133 <console_width+0x23>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i64 }
@TIOCGWINSZ = global i32 0
define i32 @console_width() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 0, i32 %3, %struct.winsize* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 80, i32* %1
br label %11
7: ; preds = %0
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.winsize = type { i64 }
@TIOCGWINSZ = global i32 0
define i32 @console_width() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 0, i32 %3, %struct.winsize* %1)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 80, i32 %8
ret i32 %9
}
int sysfs_update_file(struct kobject *k, const struct attribute *a) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define i32 @sysfs_update_file(%struct.kobject* nocapture readnone %0, %struct.attribute* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct b_whirl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setRevSelect(struct b_whirl *, int);
void revControl(void *d, unsigned char u) {
  struct b_whirl *w = (struct b_whirl *)d;
  setRevSelect(w, (int)(u / 43));
}


x86 assembly (clang, -O0):
<revControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movzbl -0x9(%rbp),%eax
mov    $0x2b,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <setRevSelect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revControl>:
imul   $0xbf,%esi,%esi
shr    $0xd,%esi
jmp    1030 <setRevSelect@plt>

LLVM IR (-O0):
%struct.b_whirl = type { i32 }
define void @revControl(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca %struct.b_whirl*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.b_whirl*
store %struct.b_whirl* %7, %struct.b_whirl** %5
%8 = load %struct.b_whirl*, %struct.b_whirl** %5
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = sdiv i32 %10, 43
%12 = call i32 @setRevSelect(%struct.b_whirl* %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.b_whirl = type { i32 }
define void @revControl(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_whirl*
%4 = udiv i8 %1, 43
%5 = zext i8 %4 to i32
%6 = tail call i32 @setRevSelect(%struct.b_whirl* %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int func(int x) { printf("%d\n", x); }


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

x86 assembly (clang, -O2):
<func>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @func(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sub_fun_1(char *, char, int);
int /*<<< orphan*/ sub_fun_2();
char sub_fun_3(char, int);
int fun(char x) {
  char y;
  char z = 10;
  sub_fun_1(&y, x, 1);
  ;
  sub_fun_2();
  ;
  y = sub_fun_3(y, 1);
  ;
  return y + z;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0xa,-0x3(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x1,%edx
movsbl -0x1(%rbp),%esi
call   1050 <sub_fun_1@plt>
mov    $0x0,%al
call   1030 <sub_fun_2@plt>
mov    $0x1,%esi
movsbl -0x2(%rbp),%edi
call   1040 <sub_fun_3@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
mov    %edi,%esi
lea    0x7(%rsp),%rdi
mov    $0x1,%edx
call   1050 <sub_fun_1@plt>
xor    %eax,%eax
call   1030 <sub_fun_2@plt>
movsbl 0x7(%rsp),%edi
mov    $0x1,%esi
call   1040 <sub_fun_3@plt>
movsbl %al,%eax
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
store i8 10, i8* %4
%5 = load i8, i8* %2
%6 = call i32 @sub_fun_1(i8* %3, i8 signext %5, i32 1)
%7 = call i32 (...) @sub_fun_2()
%8 = load i8, i8* %3
%9 = call signext i8 @sub_fun_3(i8 signext %8, i32 1)
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = call i32 @sub_fun_1(i8* %2, i8 signext %0, i32 1)
%4 = call i32 (...) @sub_fun_2()
%5 = load i8, i8* %2
%6 = call signext i8 @sub_fun_3(i8 signext %5, i32 1)
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 10
ret i32 %8
}
int _assign_ignore(const unsigned long long value,
                   const unsigned long long assign_value_data) {
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @_assign_ignore(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @_assign_ignore(i64 %0, i64 %1) {
ret i32 1
}
long int foo(long int x) { return (x * x + (8 * x)) << (4 - x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    $0x4,%ecx
sub    -0x8(%rbp),%rcx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x8(%rdi),%rax
imul   %rdi,%rax
mov    $0x4,%cl
sub    %dil,%cl
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = add i64 %0, 8
%3 = mul i64 %2, %0
%4 = sub nsw i64 4, %0
%5 = shl i64 %3, %4
ret i64 %5
}
int test_imm_54uint16_reg(unsigned short val) {
  return ((val) & (0x54 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_54uint16_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, 84
%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_54uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 84
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void midi_done(void) {}


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

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

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

LLVM IR (-O2):
define void @midi_done() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy_imat(int nx, int ny, int **dest, int **p) {
  memcpy(*dest, *p, nx * ny * sizeof(int));
}


x86 assembly (clang, -O0):
<copy_imat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_imat>:
mov    (%rdx),%rax
mov    (%rcx),%rcx
imul   %esi,%edi
lea    0x0(,%rdi,4),%edx
mov    %rax,%rdi
mov    %rcx,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_imat(i32 %0, i32 %1, i32** %2, i32** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32**
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32** %2, i32*** %7
store i32** %3, i32*** %8
%9 = load i32**, i32*** %7
%10 = load i32*, i32** %9
%11 = load i32**, i32*** %8
%12 = load i32*, i32** %11
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 4
%18 = trunc i64 %17 to i32
%19 = call i32 @memcpy(i32* %10, i32* %12, i32 %18)
ret void
}

LLVM IR (-O2):
define void @copy_imat(i32 %0, i32 %1, i32** nocapture %2, i32** nocapture %3) {
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = shl i32 %0, 2
%8 = mul i32 %7, %1
%9 = tail call i32 @memcpy(i32* %5, i32* %6, i32 %8)
ret void
}
unsigned grid2x_generic_output_fmts(unsigned input_fmts) { return input_fmts; }


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

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

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

LLVM IR (-O2):
define i32 @grid2x_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fileExists(char *filename) {
  FILE *file;
  file = fopen(filename, "r");
  if (file == NULL)
    return 0;
  fclose(file);
  return 1;
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <fileExists+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <fileExists+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fileExists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
char *remove_character(char *, char);
char *timlib_remove_character(char *source_destination, char character) {
  return remove_character(source_destination, character);
}


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

x86 assembly (clang, -O2):
<timlib_remove_character>:
jmp    1030 <remove_character@plt>

LLVM IR (-O0):
define i8* @timlib_remove_character(i8* %0, i8 signext %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 i8* @remove_character(i8* %5, i8 signext %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @timlib_remove_character(i8* %0, i8 signext %1) {
%3 = tail call i8* @remove_character(i8* %0, i8 signext %1)
ret i8* %3
}
void MP_sleep(unsigned long VV_wait) {
  unsigned long LV_ii = 0L, LV_jj = 0L;
  volatile int PV_dummy1;
  volatile int PV_dummy2;
  for (LV_jj = 0L; LV_jj < VV_wait; LV_jj++) {
    for (LV_ii = 0L; LV_ii < 0UL; LV_ii++) {
      PV_dummy2 = PV_dummy1;
    };
  };
}


x86 assembly (clang, -O0):
<MP_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116e <MP_sleep+0x6e>
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jae    1158 <MP_sleep+0x58>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <MP_sleep+0x36>
jmp    115d <MP_sleep+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <MP_sleep+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @MP_sleep(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 0, i64* %4
store i64 0, i64* %4
br label %7
7: ; preds = %21, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %2
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
store i64 0, i64* %3
br label %12
12: ; preds = %17, %11
%13 = load i64, i64* %3
%14 = icmp ult i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load volatile i32, i32* %5
store volatile i32 %16, i32* %6
br label %17
17: ; preds = %15
%18 = load i64, i64* %3
%19 = add i64 %18, 1
store i64 %19, i64* %3
br label %12
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i64, i64* %4
%23 = add i64 %22, 1
store i64 %23, i64* %4
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @MP_sleep(i64 %0) {
ret void
}
/* Variables and functions */
char tolower(char const);
void strtolower(char *dest, const char *src) {
  int i;
  for (i = 0; src[i]; i++)
    dest[i] = tolower(src[i]);
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1165 <strtolower+0x55>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <strtolower+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     114a <strtolower+0x3a>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%r14,%rbx,1)
movzbl 0x1(%r15,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolower+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8 [ %12, %5 ], [ %3, %2 ]
%8 = tail call signext i8 @tolower(i8 signext %7)
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
int strline(char *p, char *end) {
  const char *start = p;
  for (;;) {
    if (p[0] == '\n') {
      break;
    } else if (!p[0]) {
      if (p == end) {
        break;
      }
    }
    ++p;
  }
  return p - start;
}


x86 assembly (clang, -O0):
<strline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1129 <strline+0x29>
jmp    1164 <strline+0x64>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    114e <strline+0x4e>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1149 <strline+0x49>
jmp    1164 <strline+0x64>
jmp    114e <strline+0x4e>
jmp    1153 <strline+0x53>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strline+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strline>:
mov    %rdi,%rax
jmp    1119 <strline+0x19>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rsi,%rax
je     1128 <strline+0x28>
add    $0x1,%rax
movzbl (%rax),%ecx
test   %cl,%cl
je     1110 <strline+0x10>
cmp    $0xa,%cl
jne    1115 <strline+0x15>
sub    %edi,%eax
ret
mov    %rsi,%rax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @strline(i8* %0, i8* readnone %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 10, label %10
i8 0, label %6
]
6: ; preds = %3
%7 = icmp eq i8* %4, %1
br i1 %7, label %10, label %8
8: ; preds = %3, %6
%9 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
10: ; preds = %3, %6
%11 = phi i8* [ %4, %3 ], [ %1, %6 ]
%12 = ptrtoint i8* %11 to i64
%13 = ptrtoint i8* %0 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t ret = 0;
  while (str[ret] != 0)
    ret++;
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int GetInterrupts() { return (*(volatile unsigned int *)(0xffffffb0 + 0x0)); }


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

x86 assembly (clang, -O2):
<GetInterrupts>:
mov    $0xffffffb0,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @GetInterrupts() {
%1 = load volatile i32, i32* inttoptr (i64 4294967216 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @GetInterrupts() {
%1 = load volatile i32, i32* inttoptr (i64 4294967216 to i32*)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ acu_new_unique(int /*<<< orphan*/ *, void (*)(void *));
scalar_t__ fclose;
int /*<<< orphan*/ *fopen_t(char const *, char const *);
FILE *acu_fopen_t(const char *s, const char *m) {
  FILE *fi = fopen_t(s, m);
  (void)acu_new_unique(fi, (void (*)(void *))fclose);
  return fi;
}


x86 assembly (clang, -O0):
<acu_fopen_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen_t@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rsi
call   1030 <acu_new_unique@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acu_fopen_t>:
push   %rbx
call   1040 <fopen_t@plt>
mov    %rax,%rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%rsi
mov    %rbx,%rdi
call   1030 <acu_new_unique@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@fclose = global i64 0
define i32* @acu_fopen_t(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen_t(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i64, i64* @fclose
%11 = inttoptr i64 %10 to void (i8*)*
%12 = call i32 @acu_new_unique(i32* %9, void (i8*)* %11)
%13 = load i32*, i32** %5
ret i32* %13
}

LLVM IR (-O2):
@fclose = global i64 0
define i32* @acu_fopen_t(i8* %0, i8* %1) {
%3 = tail call i32* @fopen_t(i8* %0, i8* %1)
%4 = load i64, i64* @fclose
%5 = inttoptr i64 %4 to void (i8*)*
%6 = tail call i32 @acu_new_unique(i32* %3, void (i8*)* %5)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xmalloc(scalar_t__);
char *xstrdup(char *str) {
  char *tmp;
  tmp = xmalloc(strlen(str) + 1);
  strcpy(tmp, str);
  return tmp;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void gtk_pack_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_pack_type_get_type() {
ret void
}
/* Variables and functions */
int get_response(char *);
int main(int argc, char *argv[]) {
  int response;
  response = get_response("Do you want another transaction");
  return response;
}


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    0xed3(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 %7, i32* %6
%8 = load i32, i32* %6
ret i32 %8
}

LLVM IR (-O2):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}