xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
void pdie(char *err) {
  debug("errno %d\n", errno);
  fflush(stdout);
  perror(err);
  exit(1);
}


x86 assembly (clang, -O0):
<pdie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xea4(%rip),%rdi
call   1030 <debug@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<pdie>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
lea    0xeac(%rip),%rdi
call   1030 <debug@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"errno %d\0A\00"
@errno = global i32 0
@stdout = global i32 0
define void @pdie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @errno
%4 = call i32 @debug(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @perror(i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"errno %d\0A\00"
@errno = global i32 0
@stdout = global i32 0
define void @pdie(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @debug(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void sysMemZero(void *in_destination, size_t in_size) {
  memset(in_destination, 0, in_size);
}


x86 assembly (clang, -O0):
<sysMemZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysMemZero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @sysMemZero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Type definitions */
typedef size_t const uint16_t;

/* Variables and functions */
size_t *get_lookup_table(size_t const);
uint16_t galois_multiply(uint16_t n, uint16_t mixcolumn) {
  const uint16_t *table = get_lookup_table(mixcolumn);
  return table[n];
}


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

x86 assembly (clang, -O2):
<galois_multiply>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <get_lookup_table@plt>
mov    (%rax,%rbx,8),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @galois_multiply(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i64* @get_lookup_table(i64 %6)
store i64* %7, i64** %5
%8 = load i64*, i64** %5
%9 = load i64, i64* %3
%10 = getelementptr inbounds i64, i64* %8, i64 %9
%11 = load i64, i64* %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @galois_multiply(i64 %0, i64 %1) {
%3 = tail call i64* @get_lookup_table(i64 %1)
%4 = getelementptr inbounds i64, i64* %3, i64 %0
%5 = load i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ SubjectModel_addSubject(char *, char *, char *);
void Controller_addSubject(char subjectName[], char subjectCriteria[],
                           char subjectRange[]) {
  SubjectModel_addSubject(subjectName, subjectCriteria, subjectRange);
}


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

x86 assembly (clang, -O2):
<Controller_addSubject>:
jmp    1030 <SubjectModel_addSubject@plt>

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

LLVM IR (-O2):
define void @Controller_addSubject(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @SubjectModel_addSubject(i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_fio_close(int);
void close_trx(int status) { gmx_fio_close(status); }


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

x86 assembly (clang, -O2):
<close_trx>:
jmp    1030 <gmx_fio_close@plt>

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

LLVM IR (-O2):
define void @close_trx(i32 %0) {
%2 = tail call i32 @gmx_fio_close(i32 %0)
ret void
}
/* Variables and functions */
float logf(float);
float __glsl_log2(float x) { return logf(x) / logf(2.0f); }


x86 assembly (clang, -O0):
<__glsl_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_log2>:
push   %rax
call   1030 <logf@plt>
divss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__glsl_log2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
%5 = call float @logf(float 2.000000e+00)
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @__glsl_log2(float %0) {
%2 = tail call float @logf(float %0)
%3 = fdiv float %2, 0x3FE62E4300000000
ret float %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void uDMAErrorStatusClear(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000004C))) = 0x00000001;
}


x86 assembly (clang, -O0):
<uDMAErrorStatusClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0x4c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAErrorStatusClear>:
movq   $0x1,0x4c(%rdi)
ret

LLVM IR (-O0):
define void @uDMAErrorStatusClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 76
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}

LLVM IR (-O2):
define void @uDMAErrorStatusClear(i64 %0) {
%2 = add nsw i64 %0, 76
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
ret void
}
void rop3_53_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_53_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_53_0_0>:
mov    (%rdi),%al
xor    %sil,%al
not    %al
or     %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_53_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_53_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %5, -1
%7 = or i8 %6, %2
%8 = xor i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int);
int main(void) {
  int i = 0;
  for (i = 0; i < 134; ++i) {
    printf("%s\n", strerror(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x86,-0x8(%rbp)
jge    116f <main+0x4f>
mov    -0x8(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 134
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
char bitwise_check(int number, int bitshift) {
  int newnumber = number;
  return ((number >> bitshift) & 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<bitwise_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwise_check>:
bt     %esi,%edi
setb   %al
ret

LLVM IR (-O0):
define signext i8 @bitwise_check(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
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = ashr i32 %7, %8
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @bitwise_check(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Type definitions */
struct aiocb64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int aio_write64(struct aiocb64 *cb) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<aio_write64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_write64>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.aiocb64 = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_write64(%struct.aiocb64* %0) {
%2 = alloca %struct.aiocb64*
store %struct.aiocb64* %0, %struct.aiocb64** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb64 = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_write64(%struct.aiocb64* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
int md_post_newfs(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @md_post_newfs() {
ret i32 0
}

LLVM IR (-O2):
define i32 @md_post_newfs() {
ret i32 0
}
void intToByteArray(int iNb, char *abNb) {
  char i, offset;
  for (i = 0; i < 4; i++) {
    offset = (4 - 1 - i) * 8;
    abNb[i] = (iNb >> offset) & 0xFF;
  }
}


x86 assembly (clang, -O0):
<intToByteArray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x4,%eax
jge    1156 <intToByteArray+0x56>
movsbl -0x11(%rbp),%ecx
mov    $0x3,%eax
sub    %ecx,%eax
shl    $0x3,%eax
mov    %al,-0x12(%rbp)
mov    -0x4(%rbp),%eax
movsbl -0x12(%rbp),%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    110f <intToByteArray+0xf>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @intToByteArray(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
any(c, as) int c;
char *as;
{
  register char *s;
  s = as;
  while (*s)
    if (*s++ == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <any+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1147 <any+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1153 <any+0x53>
jmp    1113 <any+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl (%rsi),%eax
test   %eax,%eax
je     1115 <any+0x15>
add    $0x1,%rsi
cmp    %edi,%eax
jne    1100 <any>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assertEmptyCount(int *, int);
char *test_assertEmptyCount() {
  static int a[4] = {0, 2, 0, 2};
  do {
    if (!(assertEmptyCount(a, 2)))
      return "e: test_assertEmptyCount";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_assertEmptyCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f11(%rip),%rdi
mov    $0x2,%esi
call   1030 <assertEmptyCount@plt>
cmp    $0x0,%eax
jne    1142 <test_assertEmptyCount+0x32>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <test_assertEmptyCount+0x3f>
jmp    1147 <test_assertEmptyCount+0x37>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assertEmptyCount>:
push   %rax
lea    0x2f18(%rip),%rdi
mov    $0x2,%esi
call   1030 <assertEmptyCount@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xed3(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@test_assertEmptyCount.a = internal global [4 x i32] [i32 0, i32 2, i32 0, i32 2]
@.str = [25 x i8] c"e: test_assertEmptyCount\00"
define i8* @test_assertEmptyCount() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @assertEmptyCount(i32* getelementptr inbounds ([4 x i32], [4 x i32]* @test_assertEmptyCount.a, i64 0, i64 0), i32 2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@test_assertEmptyCount.a = internal global [4 x i32] [i32 0, i32 2, i32 0, i32 2]
@.str = [25 x i8] c"e: test_assertEmptyCount\00"
define i8* @test_assertEmptyCount() {
%1 = tail call i32 @assertEmptyCount(i32* getelementptr inbounds ([4 x i32], [4 x i32]* @test_assertEmptyCount.a, i64 0, i64 0), i32 2)
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
void foo683() {}


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

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

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

LLVM IR (-O2):
define void @foo683() {
ret void
}
/* Variables and functions */
int read(int, char *, int);
int g_file_read(int fd, char *ptr, int len) { return read(fd, ptr, len); }


x86 assembly (clang, -O0):
<g_file_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_file_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @g_file_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void rl_save_prompt(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ehrpwm_write(int /*<<< orphan*/, unsigned char,
                                unsigned short);
int ehrpwm_cmp_set_cmp_val(uint8_t module, unsigned char reg,
                           unsigned short val) {
  unsigned char offset;
  if (reg > 0x1)
    return -1;
  if (reg == 0)
    offset = 0x12;
  else
    offset = 0x14;
  ehrpwm_write(module, offset, val);
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_cmp_set_cmp_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %sil,%cl
mov    %edi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %ax,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jle    1141 <ehrpwm_cmp_set_cmp_val+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <ehrpwm_cmp_set_cmp_val+0x64>
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1157 <ehrpwm_cmp_set_cmp_val+0x47>
movb   $0x12,-0xd(%rbp)
jmp    115b <ehrpwm_cmp_set_cmp_val+0x4b>
movb   $0x14,-0xd(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xd(%rbp),%al
movzbl %al,%esi
movzwl -0xc(%rbp),%edx
call   1030 <ehrpwm_write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_cmp_set_cmp_val>:
mov    $0xffffffff,%eax
cmp    $0x1,%sil
ja     1138 <ehrpwm_cmp_set_cmp_val+0x28>
push   %rax
xor    %eax,%eax
test   %sil,%sil
setne  %al
lea    (%rax,%rax,1),%esi
add    $0x12,%esi
movzwl %dx,%edx
call   1030 <ehrpwm_write@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @ehrpwm_cmp_set_cmp_val(i32 %0, i8 zeroext %1, i16 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i16
%8 = alloca i8
store i32 %0, i32* %5
store i8 %1, i8* %6
store i16 %2, i16* %7
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 -1, i32* %4
br label %24
13: ; preds = %3
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 18, i8* %8
br label %19
18: ; preds = %13
store i8 20, i8* %8
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %5
%21 = load i8, i8* %8
%22 = load i16, i16* %7
%23 = call i32 @ehrpwm_write(i32 %20, i8 zeroext %21, i16 zeroext %22)
store i32 0, i32* %4
br label %24
24: ; preds = %19, %12
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @ehrpwm_cmp_set_cmp_val(i32 %0, i8 zeroext %1, i16 zeroext %2) {
%4 = icmp ugt i8 %1, 1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp eq i8 %1, 0
%7 = select i1 %6, i8 18, i8 20
%8 = tail call i32 @ehrpwm_write(i32 %0, i8 zeroext %7, i16 zeroext %2)
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ 0, %5 ], [ -1, %3 ]
ret i32 %10
}
int main() {
  int a = 'a';
  int *p = &a;
  printf("%d", &a + 1);
  printf("%u \n", sizeof(a));
  printf(" %ld \n", (p + 1) - (p + 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x61,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rsi
add    $0x4,%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    -0x10(%rbp),%rax
sub    %rax,%rsi
sar    $0x2,%rsi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x61,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%u \0A\00"
@.str.2 = [7 x i8] c" %ld \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 97, i32* %2
store i32* %2, i32** %3
%4 = getelementptr inbounds i32, i32* %2, i64 1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = ptrtoint i32* %8 to i64
%12 = ptrtoint i32* %10 to i64
%13 = sub i64 %11, %12
%14 = sdiv exact i64 %13, 4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%u \0A\00"
@.str.2 = [7 x i8] c" %ld \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 97, i32* %1
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 1)
ret i32 0
}
void skip(id) int id;
{ printf("thread %d is skip\n", id); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"thread %d is skip\0A\00"
define void @skip(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("hello world !\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello world !\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello world !\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void beep_on(void) {}


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

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

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

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

/* Variables and functions */
struct storage *__alloc_storage(int /*<<< orphan*/);
struct storage *alloc_storage(void) {
  return __alloc_storage(0);
}


x86 assembly (clang, -O0):
<alloc_storage>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__alloc_storage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_storage>:
xor    %edi,%edi
jmp    1030 <__alloc_storage@plt>

LLVM IR (-O0):
%struct.storage = type { i32 }
define %struct.storage* @alloc_storage() {
%1 = call %struct.storage* @__alloc_storage(i32 0)
ret %struct.storage* %1
}

LLVM IR (-O2):
%struct.storage = type { i32 }
define %struct.storage* @alloc_storage() {
%1 = tail call %struct.storage* @__alloc_storage(i32 0)
ret %struct.storage* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int C, N;
  scanf("%d %d", &C, &N);
  printf("%d\n", C - N * (C / N));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
sub    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
lea    0xec2(%rip),%rdi
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sdiv i32 %7, %8
%10 = mul nsw i32 %6, %9
%11 = sub nsw i32 %5, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fz_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<fz_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fz_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int branch(double d) {
  if (d) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<branch>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1126 <branch+0x26>
jp     1126 <branch+0x26>
jmp    1132 <branch+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <branch+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<branch>:
xorpd  %xmm1,%xmm1
cmpneqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @branch(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp une double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @branch(double %0) {
%2 = fcmp une double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void XtIsOverrideShell() {}


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

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

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

LLVM IR (-O2):
define void @XtIsOverrideShell() {
ret void
}
int apr_base64_encode_len(int len) { return ((len + 2) / 3 * 4) + 1; }


x86 assembly (clang, -O0):
<apr_base64_encode_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<apr_base64_encode_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @apr_base64_encode_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @apr_base64_encode_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
%5 = or i32 %4, 1
ret i32 %5
}
int test00(char *a, char *b, int c, int d) {
  if (*a & *b)
    return c;
  return d;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1136 <test00+0x36>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <test00+0x3c>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edx,%eax
mov    (%rsi),%dl
test   %dl,(%rdi)
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test00(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = load i8, i8* %0
%6 = load i8, i8* %1
%7 = and i8 %6, %5
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i32 %3, i32 %2
ret i32 %9
}
/* Variables and functions */
scalar_t__ getstr(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
main() {
  char line[1000];
  while (getstr(line, 1000) > 0) {
    reverse(line);
    printf("%s\n", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getstr@plt>
cmp    $0x0,%rax
jle    1181 <main+0x51>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getstr@plt>
test   %rax,%rax
jle    1185 <main+0x55>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getstr@plt>
test   %rax,%rax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getstr(i8* %2, i32 1000)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i64 @getstr(i8* %2, i32 1000)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
void gtk_window_deiconify() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_deiconify() {
ret void
}
int reverseBytes(int x) {
  return ((x >> 24) & 0xff) | ((x >> 8) & (0xff << 8)) |
         ((x << 8) & (0xff << 16)) | (x << 24);
}


x86 assembly (clang, -O0):
<reverseBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reverseBytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 65280
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 8
%12 = and i32 %11, 16711680
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = shl i32 %14, 24
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @reverseBytes(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *strstr(char *, char *);
char *streqrep(char *s, char *oldstring, char *newstring) {
  char *ptr;
  int len;
  len = strlen(oldstring);
  while ((ptr = strstr(s, oldstring)) != NULL) {
    memcpy(ptr, newstring, len);
  }
  return (s);
}


x86 assembly (clang, -O0):
<streqrep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1180 <streqrep+0x50>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <memcpy@plt>
jmp    1150 <streqrep+0x20>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streqrep>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strstr@plt>
test   %rax,%rax
je     116f <streqrep+0x3f>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1150 <streqrep+0x20>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @streqrep(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %8
br label %11
11: ; preds = %16, %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i8* @strstr(i8* %12, i8* %13)
store i8* %14, i8** %7
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8*, i8** %7
%18 = load i8*, i8** %6
%19 = load i32, i32* %8
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
br label %11
21: ; preds = %11
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @streqrep(i8* returned %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %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 ]
%9 = tail call i32 @memcpy(i8* %8, i8* %2, i32 %4)
%10 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %7
12: ; preds = %7, %3
ret i8* %0
}
void put_half(p, x) unsigned char *p;
unsigned short x;
{
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<put_half>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_half>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @put_half(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = trunc i32 %1 to i16
store i8* %0, i8** %3
store i16 %5, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @put_half(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_note {
  int dummy;
};
struct i8x_ctx {
  int dummy;
};

/* Variables and functions */
struct i8x_ctx *i8x_ob_get_ctx(struct i8x_object *);
struct i8x_ctx *__attribute__((always_)) i8x_note_get_ctx(struct i8x_note *x) {
  return i8x_ob_get_ctx((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_note_get_ctx>:
jmp    1030 <i8x_ob_get_ctx@plt>

LLVM IR (-O0):
%struct.i8x_ctx = type { i32 }
%struct.i8x_note = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_note_get_ctx(%struct.i8x_note* %0) {
%2 = alloca %struct.i8x_note*
store %struct.i8x_note* %0, %struct.i8x_note** %2
%3 = load %struct.i8x_note*, %struct.i8x_note** %2
%4 = bitcast %struct.i8x_note* %3 to %struct.i8x_object*
%5 = call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %4)
ret %struct.i8x_ctx* %5
}

LLVM IR (-O2):
%struct.i8x_ctx = type { i32 }
%struct.i8x_note = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_note_get_ctx(%struct.i8x_note* %0) {
%2 = bitcast %struct.i8x_note* %0 to %struct.i8x_object*
%3 = tail call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %2)
ret %struct.i8x_ctx* %3
}
ns_name_skip(unsigned char **x, unsigned char *y) {
  *x = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<ns_name_skip>:
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ns_name_skip(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
store i8* null, i8** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @ns_name_skip(i8** nocapture writeonly %0, i8* nocapture readnone %1) {
store i8* null, i8** %0
ret i32 0
}
/* Variables and functions */
scalar_t__ isUpperExtendedLetter(unsigned char);
scalar_t__ isUpperRegularLetter(unsigned char);
short int isUpperLetter(unsigned char chrsource) {
  if (isUpperRegularLetter(chrsource) || isUpperExtendedLetter(chrsource))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isUpperLetter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1030 <isUpperRegularLetter@plt>
cmp    $0x0,%rax
jne    1154 <isUpperLetter+0x34>
movzbl -0x3(%rbp),%edi
call   1040 <isUpperExtendedLetter@plt>
cmp    $0x0,%rax
je     115f <isUpperLetter+0x3f>
movw   $0x1,-0x2(%rbp)
jmp    1165 <isUpperLetter+0x45>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUpperLetter>:
push   %rbx
mov    %edi,%ebx
call   1030 <isUpperRegularLetter@plt>
mov    %rax,%rcx
mov    $0x1,%ax
test   %rcx,%rcx
je     1136 <isUpperLetter+0x16>
pop    %rbx
ret
movzbl %bl,%edi
call   1040 <isUpperExtendedLetter@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @isUpperLetter(i8 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isUpperRegularLetter(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @isUpperExtendedLetter(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i16 1, i16* %2
br label %13
12: ; preds = %7
store i16 0, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @isUpperLetter(i8 zeroext %0) {
%2 = tail call i64 @isUpperRegularLetter(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isUpperExtendedLetter(i8 zeroext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i16
br label %8
8: ; preds = %4, %1
%9 = phi i16 [ 1, %1 ], [ %7, %4 ]
ret i16 %9
}