xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bar(int, int);
__attribute__((no, noclone)) void f1(int x) {
  if (x != 2 && x != 3 && x != 10 && x != 11 && x != 17 && x != 18 && x != 23)
    bar(x, 1);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     116e <f1+0x5e>
cmpl   $0x3,-0x4(%rbp)
je     116e <f1+0x5e>
cmpl   $0xa,-0x4(%rbp)
je     116e <f1+0x5e>
cmpl   $0xb,-0x4(%rbp)
je     116e <f1+0x5e>
cmpl   $0x11,-0x4(%rbp)
je     116e <f1+0x5e>
cmpl   $0x12,-0x4(%rbp)
je     116e <f1+0x5e>
cmpl   $0x17,-0x4(%rbp)
je     116e <f1+0x5e>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cmp    $0x17,%edi
ja     1120 <f1+0x10>
mov    $0x860c0c,%eax
bt     %edi,%eax
jae    1120 <f1+0x10>
ret
mov    $0x1,%esi
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @f1(i32 %0) {
switch i32 %0, label %2 [
i32 23, label %4
i32 18, label %4
i32 17, label %4
i32 11, label %4
i32 10, label %4
i32 3, label %4
i32 2, label %4
]
2: ; preds = %1
%3 = tail call i32 @bar(i32 %0, i32 1)
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
ret void
}
char *element_drop_down_get_heading(char *element_name, char *heading) {
  if (!heading)
    heading = element_name;
  else
    heading = heading;
  return heading;
}


x86 assembly (clang, -O0):
<element_drop_down_get_heading>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <element_drop_down_get_heading+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112c <element_drop_down_get_heading+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_drop_down_get_heading>:
mov    %rdi,%rax
test   %rsi,%rsi
cmovne %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @element_drop_down_get_heading(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* %0, i8* %1
ret i8* %4
}
/* Variables and functions */
int fcntl(int, int, void *);
int fcntl_with_lock(int fd, int cmd, void *lock) {
  return fcntl(fd, cmd, lock);
}


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

x86 assembly (clang, -O2):
<fcntl_with_lock>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @fcntl_with_lock(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int F_OK;
int X_OK;
int access(int /*<<< orphan*/, int);
int /*<<< orphan*/ free(char *);
char *strdup(char *);
int /*<<< orphan*/ strtok(char *, char *);
int check_access(char *command) {
  char *tmp = strdup(command);
  int output = access(strtok(tmp, " "), F_OK | X_OK);
  free(tmp);
  return output;
}


x86 assembly (clang, -O0):
<check_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1050 <strtok@plt>
mov    %eax,%edi
mov    0x2e5e(%rip),%rax
mov    (%rax),%esi
mov    0x2e6d(%rip),%rax
or     (%rax),%esi
call   1040 <access@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_access>:
push   %rbp
push   %rbx
push   %rax
call   1060 <strdup@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rsi
mov    %rax,%rdi
call   1050 <strtok@plt>
mov    0x2e6f(%rip),%rcx
mov    0x2e80(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    %eax,%edi
call   1040 <access@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@F_OK = global i32 0
@X_OK = global i32 0
define i32 @check_access(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strtok(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @F_OK
%10 = load i32, i32* @X_OK
%11 = or i32 %9, %10
%12 = call i32 @access(i32 %8, i32 %11)
store i32 %12, i32* %4
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@F_OK = global i32 0
@X_OK = global i32 0
define i32 @check_access(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @strtok(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @F_OK
%5 = load i32, i32* @X_OK
%6 = or i32 %5, %4
%7 = tail call i32 @access(i32 %3, i32 %6)
%8 = tail call i32 @free(i8* %2)
ret i32 %7
}
int destroy_container(struct container *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.container = type opaque
define i32 @destroy_container(%struct.container* nocapture readnone %0) {
ret i32 0
}
void troca(int *P1, int *P2) {
  int Temp;
  Temp = *P1;
  *P1 = *P2;
  *P2 = Temp;
}


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

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

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

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
_falmbGenericTextPerCharExtents() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falmbGenericTextPerCharExtents() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glutWireOctahedron();
void drawOcta(void) {
  glColor3f(0.8, 0.5, 0.5);
  glPushMatrix();
  glScalef(6.0, 6.0, 6.0);
  glutWireOctahedron();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawOcta>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeac(%rip),%xmm0
movsd  0xeac(%rip),%xmm2
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
mov    $0x0,%al
call   1070 <glPushMatrix@plt>
movsd  0xe85(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glScalef@plt>
mov    $0x0,%al
call   1030 <glutWireOctahedron@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawOcta>:
push   %rax
movsd  0xea7(%rip),%xmm0
movsd  0xea7(%rip),%xmm1
movaps %xmm1,%xmm2
call   1050 <glColor3f@plt>
xor    %eax,%eax
call   1070 <glPushMatrix@plt>
movsd  0xe98(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1060 <glScalef@plt>
xor    %eax,%eax
call   1030 <glutWireOctahedron@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawOcta() {
%1 = call i32 @glColor3f(double 8.000000e-01, double 5.000000e-01, double 5.000000e-01)
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = call i32 (...) @glutWireOctahedron()
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawOcta() {
%1 = tail call i32 @glColor3f(double 8.000000e-01, double 5.000000e-01, double 5.000000e-01)
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = tail call i32 (...) @glutWireOctahedron()
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtmRfa1TimerMacP__CompareA__stop();
void AtmegaCompareP__0__AtmegaCompare__stop(void) {
  HplAtmRfa1TimerMacP__CompareA__stop();
}


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

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

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

LLVM IR (-O2):
define void @AtmegaCompareP__0__AtmegaCompare__stop() {
%1 = tail call i32 (...) @HplAtmRfa1TimerMacP__CompareA__stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xfree(void *);
void vector_only_slot_free(void *slot) { (xfree(slot)); }


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

x86 assembly (clang, -O2):
<vector_only_slot_free>:
jmp    1030 <xfree@plt>

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

LLVM IR (-O2):
define void @vector_only_slot_free(i8* %0) {
%2 = tail call i32 @xfree(i8* %0)
ret void
}
/* Variables and functions */
int _docommand(char *, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_docommand(char *cmdline, int verbose) {
  int ret;
  monLock();
  ret = _docommand(cmdline, verbose);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_docommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <_docommand@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_docommand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <_docommand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_docommand(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @monLock()
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @_docommand(i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_docommand(i8* %0, i32 %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_docommand(i8* %0, i32 %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
int main(void) {
  unsigned int a;
  unsigned long long b;
  a = a + b;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i64, i64* %3
%7 = add i64 %5, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Type definitions */
struct Seeds {
  int dummy;
};

/* Variables and functions */
float BoxMuller(struct Seeds *, float, float);
float larvaDelay(struct Seeds *seeds) {
  float mean = 1.0f;
  float stdDev = 0.1f;
  return BoxMuller(seeds, mean, stdDev);
}


x86 assembly (clang, -O0):
<larvaDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <BoxMuller@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<larvaDelay>:
movss  0xee8(%rip),%xmm0
movss  0xee4(%rip),%xmm1
jmp    1030 <BoxMuller@plt>

LLVM IR (-O0):
%struct.Seeds = type { i32 }
define float @larvaDelay(%struct.Seeds* %0) {
%2 = alloca %struct.Seeds*
%3 = alloca float
%4 = alloca float
store %struct.Seeds* %0, %struct.Seeds** %2
store float 1.000000e+00, float* %3
store float 0x3FB99999A0000000, float* %4
%5 = load %struct.Seeds*, %struct.Seeds** %2
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @BoxMuller(%struct.Seeds* %5, float %6, float %7)
ret float %8
}

LLVM IR (-O2):
%struct.Seeds = type { i32 }
define float @larvaDelay(%struct.Seeds* %0) {
%2 = tail call float @BoxMuller(%struct.Seeds* %0, float 1.000000e+00, float 0x3FB99999A0000000)
ret float %2
}
int sys_print(char ch, int z) {
  int position = z * 2;
  __asm__ volatile("movl $0x18,%%edx\n\t"
                   "mov  %%dx,%%gs\n\t"
                   "movb %%al,%%gs:(%%ebx)" ::"a"(ch),
                   "b"(position));
  return 0;
}


x86 assembly (clang, -O0):
<sys_print>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x9(%rbp),%al
mov    -0x14(%rbp),%ebx
mov    $0x18,%edx
mov    %edx,%gs
mov    %al,%gs:(%ebx)
xor    %eax,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_print>:
push   %rbx
mov    %edi,%eax
lea    (%rsi,%rsi,1),%ebx
mov    $0x18,%edx
mov    %edx,%gs
mov    %al,%gs:(%ebx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sys_print(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 2
store i32 %7, i32* %5
%8 = load i8, i8* %3
%9 = load i32, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @sys_print(i8 signext %0, i32 %1) {
%3 = shl nsw i32 %1, 1
tail call void asm sideeffect "movl $$0x18,%edx\0A\09mov %dx,%gs\0A\09movb %al,%gs:(%ebx)", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ispunct(int);
void uninitvar_ispunct(void) {
  int i;
  (void)ispunct(i);
}


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

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

LLVM IR (-O0):
define void @uninitvar_ispunct() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @ispunct(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ispunct() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
char *strdup(char *);
char *process_generic_datatype_system_string(char *select,
                                             char *datatype_folder_name,
                                             char *where) {
  char system_string[1024];
  sprintf(system_string, "select.sh \"%s\" %s \"%s\"", select,
          datatype_folder_name, where);
  return strdup(system_string);
}


x86 assembly (clang, -O0):
<process_generic_datatype_system_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeaf(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_generic_datatype_system_string>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"select.sh \22%s\22 %s \22%s\22\00"
define i8* @process_generic_datatype_system_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i8* @strdup(i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"select.sh \22%s\22 %s \22%s\22\00"
define noalias i8* @process_generic_datatype_system_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = call i8* @strdup(i8* %5)
ret i8* %7
}
void F3(int **Z) { *Z = (int *)0; }


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

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

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

LLVM IR (-O2):
define void @F3(i32** nocapture writeonly %0) {
store i32* null, i32** %0
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (5 < 8) {
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %0, %4
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *p = "hello World\n";
  char *q = p;
  printf("%s\n", q);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello World\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mkfifo(char *, int /*<<< orphan*/);
void main() { mkfifo("temp-trymkffo", 0); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"temp-trymkffo\00"
define void @main() {
%1 = call i32 @mkfifo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"temp-trymkffo\00"
define void @main() {
%1 = tail call i32 @mkfifo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void io_error(char *message) {
  char buf[(16384)];
  sprintf(buf, "Bonnie: drastic I/O error (%s)", message);
  perror(buf);
  exit(1);
}


x86 assembly (clang, -O0):
<io_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4010,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x4010(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x4010(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<io_error>:
push   %rbx
sub    $0x4000,%rsp
mov    %rdi,%rdx
lea    0xebe(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Bonnie: drastic I/O error (%s)\00"
define void @io_error(i8* %0) {
%2 = alloca i8*
%3 = alloca [16384 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%8 = call i32 @perror(i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Bonnie: drastic I/O error (%s)\00"
define void @io_error(i8* %0) {
%2 = alloca [16384 x i8]
%3 = getelementptr inbounds [16384 x i8], [16384 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @perror(i8* %3)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int encode(int, int);
int decode(int ch, int key) { return encode(ch, -key); }


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

x86 assembly (clang, -O2):
<decode>:
neg    %esi
jmp    1030 <encode@plt>

LLVM IR (-O0):
define i32 @decode(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 = sub nsw i32 0, %6
%8 = call i32 @encode(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @decode(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @encode(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
void putc(int c) {
  while (!((*(volatile unsigned char *)(0x11009000 + 0x14)) & 0x20))
    ;
  (*(volatile unsigned char *)(0x11009000 + 0x0)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x11009014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <putc+0x29>
jmp    112e <putc+0x2e>
jmp    1107 <putc+0x7>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x11009000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testb  $0x20,0x11009014
20
je     1100 <putc>
mov    %dil,0x11009000
11
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 285249556 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* inttoptr (i64 285249536 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 285249556 to i8*)
%4 = and i8 %3, 32
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = trunc i32 %0 to i8
store volatile i8 %7, i8* inttoptr (i64 285249536 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_diomelf_function_list();
void diomelf_init() { register_diomelf_function_list(); }


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

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

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

LLVM IR (-O2):
define void @diomelf_init() {
%1 = tail call i32 (...) @register_diomelf_function_list()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _cgi_init();
int /*<<< orphan*/ _error_init();
int /*<<< orphan*/ _http_init();
int /*<<< orphan*/ _inline_init();
void chl_fcgi_init() {
  _cgi_init();
  _error_init();
  _http_init();
  _inline_init();
}


x86 assembly (clang, -O0):
<chl_fcgi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_cgi_init@plt>
mov    $0x0,%al
call   1040 <_error_init@plt>
mov    $0x0,%al
call   1060 <_http_init@plt>
mov    $0x0,%al
call   1050 <_inline_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chl_fcgi_init>:
push   %rax
xor    %eax,%eax
call   1030 <_cgi_init@plt>
xor    %eax,%eax
call   1040 <_error_init@plt>
xor    %eax,%eax
call   1060 <_http_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <_inline_init@plt>

LLVM IR (-O0):
define void @chl_fcgi_init() {
%1 = call i32 (...) @_cgi_init()
%2 = call i32 (...) @_error_init()
%3 = call i32 (...) @_http_init()
%4 = call i32 (...) @_inline_init()
ret void
}

LLVM IR (-O2):
define void @chl_fcgi_init() {
%1 = tail call i32 (...) @_cgi_init()
%2 = tail call i32 (...) @_error_init()
%3 = tail call i32 (...) @_http_init()
%4 = tail call i32 (...) @_inline_init()
ret void
}
/* Variables and functions */
short btest_h(short *, short *);
short intr_wrap_503(short p1, short p2) { return btest_h(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_503>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <btest_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_503>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <btest_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_503(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @btest_h(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_503(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @btest_h(i16* %3, i16* %4)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ replace(int);
void op_compreplc() { replace(1); }


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

x86 assembly (clang, -O2):
<op_compreplc>:
mov    $0x1,%edi
jmp    1030 <replace@plt>

LLVM IR (-O0):
define void @op_compreplc() {
%1 = call i32 @replace(i32 1)
ret void
}

LLVM IR (-O2):
define void @op_compreplc() {
%1 = tail call i32 @replace(i32 1)
ret void
}
unsigned int swapu32(unsigned int x) { return __builtin_bswap32(x); }


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

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

LLVM IR (-O0):
define i32 @swapu32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @swapu32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct lisp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void error(struct lisp *lisp) { printf("error!\n"); }


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

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

LLVM IR (-O0):
%struct.lisp = type { i32 }
@.str = [8 x i8] c"error!\0A\00"
define void @error(%struct.lisp* %0) {
%2 = alloca %struct.lisp*
store %struct.lisp* %0, %struct.lisp** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.lisp = type { i32 }
@str = [7 x i8] c"error!\00"
define void @error(%struct.lisp* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int isH(int c) { return c == 'h' || c == 'H'; }


x86 assembly (clang, -O0):
<isH>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x68,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isH+0x20>
cmpl   $0x48,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isH>:
and    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x48,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isH(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 104
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 72
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isH(i32 %0) {
%2 = and i32 %0, -33
%3 = icmp eq i32 %2, 72
%4 = zext i1 %3 to i32
ret i32 %4
}
int _memcmp(const void *p1, const void *p2, unsigned int size) {
  unsigned int i;
  for (i = 0; i < size; ++i) {
    if (*((char *)p1 + i) > *((char *)p1 + i))
      return 1;
    if (*((char *)p1 + i) < *((char *)p1 + i))
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1189 <_memcmp+0x89>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%edx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jle    114c <_memcmp+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1190 <_memcmp+0x90>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%edx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jge    1176 <_memcmp+0x76>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <_memcmp+0x90>
jmp    117b <_memcmp+0x7b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <_memcmp+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_memcmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %44, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %47
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i32, i32* %8
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8*, i8** %5
%21 = load i32, i32* %8
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sgt i32 %19, %25
br i1 %26, label %27, label %28
27: ; preds = %13
store i32 1, i32* %4
br label %48
28: ; preds = %13
%29 = load i8*, i8** %5
%30 = load i32, i32* %8
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = load i8*, i8** %5
%36 = load i32, i32* %8
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp slt i32 %34, %40
br i1 %41, label %42, label %43
42: ; preds = %28
store i32 -1, i32* %4
br label %48
43: ; preds = %28
br label %44
44: ; preds = %43
%45 = load i32, i32* %8
%46 = add i32 %45, 1
store i32 %46, i32* %8
br label %9
47: ; preds = %9
store i32 0, i32* %4
br label %48
48: ; preds = %47, %42, %27
%49 = load i32, i32* %4
ret i32 %49
}

LLVM IR (-O2):
define i32 @_memcmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
void *ebbrt_newlib_malloc(size_t);
void *malloc(size_t size) { return ebbrt_newlib_malloc(size); }


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <ebbrt_newlib_malloc@plt>

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

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @ebbrt_newlib_malloc(i64 %0)
ret i8* %2
}
int test_imm_8Cint64_lowword_reg(long long val) {
  return ((val) & (0x8C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Cint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 140
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int get_stodep_value();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int val;
  val = get_stodep_value();
  if (val != 1) {
    printf("st1 value was %i instead of 1\n", val);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_stodep_value@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     115e <main+0x3e>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <main+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <get_stodep_value@plt>
cmp    $0x1,%eax
je     1142 <main+0x22>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"st1 value was %i instead of 1\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @get_stodep_value()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 -1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [31 x i8] c"st1 value was %i instead of 1\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_stodep_value()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fread(unsigned int *, int, int, int /*<<< orphan*/ *);
unsigned int getLastId(const char *path) {
  unsigned int ret = 0;
  FILE *fd = fopen(path, "rb");
  if (!fd)
    return 0;
  fread(&ret, sizeof(unsigned int), 1, fd);
  fclose(fd);
  return ret;
}


x86 assembly (clang, -O0):
<getLastId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116e <getLastId+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1194 <getLastId+0x64>
mov    -0x20(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLastId>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1176 <getLastId+0x46>
mov    %rax,%rbx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0xc(%rsp),%eax
jmp    1178 <getLastId+0x48>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @getLastId(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
%9 = load i32, i32* %2
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ check_hash_assumptions();
int /*<<< orphan*/ enforce_piecename_uniqueness();
void checkGlobalAssumptions(void) {
  assert('b' == 'a' + 1);
  assert('c' == 'b' + 1);
  assert('d' == 'c' + 1);
  assert('e' == 'd' + 1);
  assert('f' == 'e' + 1);
  assert('g' == 'f' + 1);
  assert('h' == 'g' + 1);
  check_hash_assumptions();
  enforce_piecename_uniqueness();
}


x86 assembly (clang, -O0):
<checkGlobalAssumptions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1040 <check_hash_assumptions@plt>
mov    $0x0,%al
call   1030 <enforce_piecename_uniqueness@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkGlobalAssumptions>:
push   %rax
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
call   1040 <check_hash_assumptions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <enforce_piecename_uniqueness@plt>

LLVM IR (-O0):
define void @checkGlobalAssumptions() {
%1 = call i32 @assert(i32 1)
%2 = call i32 @assert(i32 1)
%3 = call i32 @assert(i32 1)
%4 = call i32 @assert(i32 1)
%5 = call i32 @assert(i32 1)
%6 = call i32 @assert(i32 1)
%7 = call i32 @assert(i32 1)
%8 = call i32 (...) @check_hash_assumptions()
%9 = call i32 (...) @enforce_piecename_uniqueness()
ret void
}

LLVM IR (-O2):
define void @checkGlobalAssumptions() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 (...) @check_hash_assumptions()
%9 = tail call i32 (...) @enforce_piecename_uniqueness()
ret void
}
/* Variables and functions */
size_t get_shell_start(size_t shell_idx) {
  static const size_t start[] = {0, 0, 1, 4, 10};
  return start[shell_idx];
}


x86 assembly (clang, -O0):
<get_shell_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xeed(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shell_start>:
lea    0xef9(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
@get_shell_start.start = internal constant [5 x i64] [i64 0, i64 0, i64 1, i64 4, i64 10]
define i64 @get_shell_start(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds [5 x i64], [5 x i64]* @get_shell_start.start, i64 0, i64 %3
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
@get_shell_start.start = internal unnamed_addr constant [5 x i64] [i64 0, i64 0, i64 1, i64 4, i64 10]
define i64 @get_shell_start(i64 %0) {
%2 = getelementptr inbounds [5 x i64], [5 x i64]* @get_shell_start.start, i64 0, i64 %0
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned gettime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000000 + tv.tv_usec) / 1000;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
%9 = sdiv i32 %8, 1000
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sdiv i32 %9, 1000
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ b();
int c() { b(); }


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

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

LLVM IR (-O0):
define i32 @c() {
%1 = alloca i32
%2 = call i32 (...) @b()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @c() {
%1 = tail call i32 (...) @b()
ret i32 undef
}