xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
void reg16_set_bits(volatile uint16_t *reg, uint16_t value) { *reg |= value; }


x86 assembly (clang, -O0):
<reg16_set_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg16_set_bits>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @reg16_set_bits(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = or i32 %7, %5
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @reg16_set_bits(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = or i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_SOUND(int /*<<< orphan*/);
int gen_SOUND() { handle_SOUND(0); }


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

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

LLVM IR (-O0):
define i32 @gen_SOUND() {
%1 = alloca i32
%2 = call i32 @handle_SOUND(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_SOUND() {
%1 = tail call i32 @handle_SOUND(i32 0)
ret i32 undef
}
/* Variables and functions */
int f1(int);
int f2(int f2arg) {
  int f2loc;
  f2loc = f1(f2arg - 1);
  return f2loc;
}


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

x86 assembly (clang, -O2):
<f2>:
add    $0xffffffff,%edi
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @f1(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("WRONG\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
call   1040 <scanf@plt>
lea    0xebd(%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
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [6 x i8] c"WRONG\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void ClearMatrix(double *mat, int n) {
  memset((void *)mat, 0, n * (n + 1) * sizeof(double));
}


x86 assembly (clang, -O0):
<ClearMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearMatrix>:
lea    0x1(%rsi),%edx
imul   %esi,%edx
shl    $0x3,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @ClearMatrix(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = bitcast double* %5 to i8*
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = call i32 @memset(i8* %6, i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
define void @ClearMatrix(double* %0, i32 %1) {
%3 = bitcast double* %0 to i8*
%4 = add nsw i32 %1, 1
%5 = shl i32 %1, 3
%6 = mul i32 %5, %4
%7 = tail call i32 @memset(i8* %3, i32 0, i32 %6)
ret void
}
/* Variables and functions */
int ptrcmp(void *, void *);
int cmp(const void *a, const void *b) {
  void *m = *((void **)a);
  void *n = *((void **)b);
  return ptrcmp(m, n);
}


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <ptrcmp@plt>

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @ptrcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @ptrcmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mptable [-dmesg] [-verbose] [-grope] [-help]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"usage: mptable [-dmesg] [-verbose] [-grope] [-help]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"usage: mptable [-dmesg] [-verbose] [-grope] [-help]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void fail3(void) { abort(); }


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

x86 assembly (clang, -O2):
<fail3>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fail3() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @fail3() {
%1 = tail call i32 (...) @abort()
unreachable
}
double dot(double *v1, double *v2) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *Sec_Malloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    printf("ERROR: Sec_Malloc - No memory!\nTerminating...\n");
    exit(666);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<Sec_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <Sec_Malloc+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x29a,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sec_Malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <Sec_Malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x29a,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"ERROR: Sec_Malloc - No memory!\0ATerminating...\0A\00"
define i8* @Sec_Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 666)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@str = [46 x i8] c"ERROR: Sec_Malloc - No memory!\0ATerminating...\00"
define noalias i8* @Sec_Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 666)
unreachable
7: ; preds = %1
ret i8* %2
}
int test_imm_90int16_mem(short *val) {
  return ((*val) & (-0x90 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_90int16_mem>:
movzwl (%rdi),%eax
test   $0xff70,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_90int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -144
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ PinConfigSet(unsigned long, int, int);
void PinTypeADC(unsigned long ulPin, unsigned long ulPinMode) {
  PinConfigSet(ulPin, 0x00000020, 0x10000000);
}


x86 assembly (clang, -O0):
<PinTypeADC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
mov    $0x10000000,%edx
call   1030 <PinConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PinTypeADC>:
mov    $0x20,%esi
mov    $0x10000000,%edx
jmp    1030 <PinConfigSet@plt>

LLVM IR (-O0):
define void @PinTypeADC(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @PinConfigSet(i64 %5, i32 32, i32 268435456)
ret void
}

LLVM IR (-O2):
define void @PinTypeADC(i64 %0, i64 %1) {
%3 = tail call i32 @PinConfigSet(i64 %0, i32 32, i32 268435456)
ret void
}
/* Variables and functions */
float floorf(float);
float num_floor(float a) { return floorf(a); }


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

x86 assembly (clang, -O2):
<num_floor>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define float @num_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @num_floor(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ b4(int);
void b3(int n) { b4(n); }


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

x86 assembly (clang, -O2):
<b3>:
jmp    1030 <b4@plt>

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

LLVM IR (-O2):
define void @b3(i32 %0) {
%2 = tail call i32 @b4(i32 %0)
ret void
}
void demmt_nouveau_gem_pushbuf_data(struct mmt_nouveau_pushbuf_data *data,
                                    void *state) {}


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

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

LLVM IR (-O0):
%struct.mmt_nouveau_pushbuf_data = type opaque
define void @demmt_nouveau_gem_pushbuf_data(%struct.mmt_nouveau_pushbuf_data* %0, i8* %1) {
%3 = alloca %struct.mmt_nouveau_pushbuf_data*
%4 = alloca i8*
store %struct.mmt_nouveau_pushbuf_data* %0, %struct.mmt_nouveau_pushbuf_data** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.mmt_nouveau_pushbuf_data = type opaque
define void @demmt_nouveau_gem_pushbuf_data(%struct.mmt_nouveau_pushbuf_data* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct __netgrent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int internal_getnetgrent_r(struct __netgrent *, char *, size_t, int *);
int /*<<< orphan*/ sss_nss_lock();
int /*<<< orphan*/ sss_nss_unlock();
enum nss_status _nss_sss_getnetgrent_r(struct __netgrent *result, char *buffer,
                                       size_t buflen, int *errnop) {
  enum nss_status nret;
  sss_nss_lock();
  nret = internal_getnetgrent_r(result, buffer, buflen, errnop);
  sss_nss_unlock();
  return nret;
}


x86 assembly (clang, -O0):
<_nss_sss_getnetgrent_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <sss_nss_lock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1050 <internal_getnetgrent_r@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <sss_nss_unlock@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_sss_getnetgrent_r>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <sss_nss_lock@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <internal_getnetgrent_r@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <sss_nss_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.__netgrent = type { i32 }
define i32 @_nss_sss_getnetgrent_r(%struct.__netgrent* %0, i8* %1, i64 %2, i32* %3) {
%5 = alloca %struct.__netgrent*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
store %struct.__netgrent* %0, %struct.__netgrent** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = call i32 (...) @sss_nss_lock()
%11 = load %struct.__netgrent*, %struct.__netgrent** %5
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = load i32*, i32** %8
%15 = call i32 @internal_getnetgrent_r(%struct.__netgrent* %11, i8* %12, i64 %13, i32* %14)
store i32 %15, i32* %9
%16 = call i32 (...) @sss_nss_unlock()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
%struct.__netgrent = type { i32 }
define i32 @_nss_sss_getnetgrent_r(%struct.__netgrent* %0, i8* %1, i64 %2, i32* %3) {
%5 = tail call i32 (...) @sss_nss_lock()
%6 = tail call i32 @internal_getnetgrent_r(%struct.__netgrent* %0, i8* %1, i64 %2, i32* %3)
%7 = tail call i32 (...) @sss_nss_unlock()
ret i32 %6
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c;
  while (c = getchar() != EOF) {
    printf("%d\n", c);
  }
  printf("%d - at EOF\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x8(%rbp)
test   $0x1,%al
jne    115b <main+0x3b>
jmp    116f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x8(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%rax
je     1159 <main+0x39>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea4(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"%d - at EOF\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i64 (...) @getchar()
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
double __attribute__((unit(m))) f(double __attribute__((unit(m))) x) {
  return x;
}


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

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

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

LLVM IR (-O2):
define double @f(double returned %0) {
ret double %0
}
int l3mdev_get_saddr(struct net *net, int ifindex, struct flowi4 *fl4) {
  return 0;
}


x86 assembly (clang, -O0):
<l3mdev_get_saddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.net = type opaque
%struct.flowi4 = type opaque
define i32 @l3mdev_get_saddr(%struct.net* %0, i32 %1, %struct.flowi4* %2) {
%4 = alloca %struct.net*
%5 = alloca i32
%6 = alloca %struct.flowi4*
store %struct.net* %0, %struct.net** %4
store i32 %1, i32* %5
store %struct.flowi4* %2, %struct.flowi4** %6
ret i32 0
}

LLVM IR (-O2):
%struct.net = type opaque
%struct.flowi4 = type opaque
define i32 @l3mdev_get_saddr(%struct.net* nocapture readnone %0, i32 %1, %struct.flowi4* nocapture readnone %2) {
ret i32 0
}
void R_DrawStretchPic(int x, int y, int w, int h, float s1, float t1, float s2,
                      float t2, const float *color,
                      const struct shader_s *shader) {}


x86 assembly (clang, -O0):
<R_DrawStretchPic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.shader_s = type opaque
define void @R_DrawStretchPic(i32 %0, i32 %1, i32 %2, i32 %3, float %4, float %5, float %6, float %7, float* %8, %struct.shader_s* %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float*
%20 = alloca %struct.shader_s*
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store float %4, float* %15
store float %5, float* %16
store float %6, float* %17
store float %7, float* %18
store float* %8, float** %19
store %struct.shader_s* %9, %struct.shader_s** %20
ret void
}

LLVM IR (-O2):
%struct.shader_s = type opaque
define void @R_DrawStretchPic(i32 %0, i32 %1, i32 %2, i32 %3, float %4, float %5, float %6, float %7, float* nocapture %8, %struct.shader_s* nocapture %9) {
ret void
}
/* Type definitions */
struct ip {
  int ip_v;
};

/* Variables and functions */
int get_ip_ver(struct ip *self) { return self->ip_v; }


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

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

LLVM IR (-O0):
%struct.ip = type { i32 }
define i32 @get_ip_ver(%struct.ip* %0) {
%2 = alloca %struct.ip*
store %struct.ip* %0, %struct.ip** %2
%3 = load %struct.ip*, %struct.ip** %2
%4 = getelementptr inbounds %struct.ip, %struct.ip* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i32 @get_ip_ver(%struct.ip* nocapture %0) {
%2 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int ANSI_col_convert(int col) {
  col = col & 7;
  switch (col) {
  case 1:
    col = 4;
    break;
  case 3:
    col = 6;
    break;
  case 4:
    col = 1;
    break;
  case 6:
    col = 3;
    break;
  }
  return col;
}


x86 assembly (clang, -O0):
<ANSI_col_convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1164 <ANSI_col_convert+0x64>
mov    -0x10(%rbp),%rax
lea    0xed0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x4(%rbp)
jmp    1164 <ANSI_col_convert+0x64>
movl   $0x6,-0x4(%rbp)
jmp    1164 <ANSI_col_convert+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1164 <ANSI_col_convert+0x64>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANSI_col_convert>:
mov    %edi,%eax
and    $0x7,%eax
lea    -0x1(%rax),%ecx
cmp    $0x5,%ecx
ja     1124 <ANSI_col_convert+0x24>
mov    $0x2d,%edx
bt     %ecx,%edx
jae    1124 <ANSI_col_convert+0x24>
movslq %ecx,%rax
lea    0xedf(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @ANSI_col_convert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 7
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %10 [
i32 1, label %6
i32 3, label %7
i32 4, label %8
i32 6, label %9
]
6: ; preds = %1
store i32 4, i32* %2
br label %10
7: ; preds = %1
store i32 6, i32* %2
br label %10
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 3, i32* %2
br label %10
10: ; preds = %1, %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.ANSI_col_convert = [6 x i32] [i32 4, i32 4, i32 6, i32 1, i32 4, i32 3]
define i32 @ANSI_col_convert(i32 %0) {
%2 = and i32 %0, 7
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %3, 6
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = trunc i32 %3 to i8
%7 = lshr i8 45, %6
%8 = and i8 %7, 1
%9 = icmp eq i8 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.ANSI_col_convert, i64 0, i64 %11
%13 = load i32, i32* %12
br label %14
14: ; preds = %10, %5, %1
%15 = phi i32 [ %2, %1 ], [ %2, %5 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void _dump_list(size_t *list, size_t nc) {
  size_t i;
  for (i = 0; i < nc; i++)
    printf("%lu ", list[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<_dump_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <_dump_list+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <_dump_list+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dump_list>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <_dump_list+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <_dump_list+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lu \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @_dump_list(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i64*, i64** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = load i64, i64* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu \00"
define void @_dump_list(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
regx0adr1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((p0[x0]) <= (*((unsigned char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    $0xa98ac7,%ecx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <regx0adr1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <regx0adr1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adr1>:
movslq %edx,%rax
mov    (%r8,%rax,1),%cl
xor    %eax,%eax
cmp    0xa98ac7,%cl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @regx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* inttoptr (i64 11111111 to i8*)
%11 = icmp ule i8 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int numberize(int x) {
  if (x >= 0x90 && x <= 0x99)
    return x - 0x90;
  else if (x >= 0x10 && x <= 0x19)
    return x - 0x10;
  return x;
}


x86 assembly (clang, -O0):
<numberize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x90,-0x8(%rbp)
jl     1131 <numberize+0x31>
cmpl   $0x99,-0x8(%rbp)
jg     1131 <numberize+0x31>
mov    -0x8(%rbp),%eax
sub    $0x90,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <numberize+0x5e>
cmpl   $0x10,-0x8(%rbp)
jl     1153 <numberize+0x53>
cmpl   $0x19,-0x8(%rbp)
jg     1153 <numberize+0x53>
mov    -0x8(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <numberize+0x5e>
jmp    1158 <numberize+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberize>:
lea    -0x10(%rdi),%eax
cmp    $0xa,%eax
cmovae %edi,%eax
lea    -0x90(%rdi),%ecx
cmp    $0xa,%ecx
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numberize(i32 %0) {
%2 = add i32 %0, -144
%3 = icmp ult i32 %2, 10
%4 = add i32 %0, -16
%5 = icmp ult i32 %4, 10
%6 = select i1 %5, i32 %4, i32 %0
%7 = select i1 %3, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ sm750_hw_i2c_read_reg(int, int);
unsigned short sii164GetVendorID(void) {
  unsigned short vendorID;
  vendorID = ((unsigned short)sm750_hw_i2c_read_reg(0x70, 0x01) << 8) |
             (unsigned short)sm750_hw_i2c_read_reg(0x70, 0x00);
  return vendorID;
}


x86 assembly (clang, -O0):
<sii164GetVendorID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x70,%edi
mov    $0x1,%esi
call   1030 <sm750_hw_i2c_read_reg@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x70,%edi
xor    %esi,%esi
call   1030 <sm750_hw_i2c_read_reg@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
movzwl %cx,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sii164GetVendorID>:
push   %rbx
mov    $0x70,%edi
mov    $0x1,%esi
call   1030 <sm750_hw_i2c_read_reg@plt>
mov    %rax,%rbx
shl    $0x8,%ebx
mov    $0x70,%edi
xor    %esi,%esi
call   1030 <sm750_hw_i2c_read_reg@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @sii164GetVendorID() {
%1 = alloca i16
%2 = call i64 @sm750_hw_i2c_read_reg(i32 112, i32 1)
%3 = trunc i64 %2 to i16
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = call i64 @sm750_hw_i2c_read_reg(i32 112, i32 0)
%7 = trunc i64 %6 to i16
%8 = zext i16 %7 to i32
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %1
%11 = load i16, i16* %1
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @sii164GetVendorID() {
%1 = tail call i64 @sm750_hw_i2c_read_reg(i32 112, i32 1)
%2 = trunc i64 %1 to i16
%3 = shl i16 %2, 8
%4 = tail call i64 @sm750_hw_i2c_read_reg(i32 112, i32 0)
%5 = trunc i64 %4 to i16
%6 = or i16 %3, %5
ret i16 %6
}
int test_imm_DDuint8_reg(unsigned char val) {
  return ((val) & (0xDD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DDuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xdd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DDuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -35
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test_half_setup(struct mu_test_desc *desc) {}


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

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

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

LLVM IR (-O2):
%struct.mu_test_desc = type opaque
define void @test_half_setup(%struct.mu_test_desc* nocapture %0) {
ret void
}
/* Variables and functions */
char GComm();
int /*<<< orphan*/ putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ *strchr(char *, char);
char getchf(char *list, char defchar) {
  char ch;
  ch = GComm();
  if ((strchr(list, ch)) == NULL) {
    ch = defchar;
    putc(7, stdout);
  }
  return (ch);
}


x86 assembly (clang, -O0):
<getchf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1030 <GComm@plt>
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0xa(%rbp),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    117c <getchf+0x4c>
mov    -0x9(%rbp),%al
mov    %al,-0xa(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
mov    $0x7,%edi
call   1050 <putc@plt>
movsbl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchf>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <GComm@plt>
mov    %eax,%ebx
movsbl %al,%esi
mov    %rbp,%rdi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1169 <getchf+0x39>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    $0x7,%edi
call   1050 <putc@plt>
mov    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
define signext i8 @getchf(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = call signext i8 (...) @GComm()
store i8 %6, i8* %5
%7 = load i8*, i8** %3
%8 = load i8, i8* %5
%9 = call i32* @strchr(i8* %7, i8 signext %8)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8, i8* %4
store i8 %12, i8* %5
%13 = load i32, i32* @stdout
%14 = call i32 @putc(i32 7, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i8, i8* %5
ret i8 %16
}

LLVM IR (-O2):
@stdout = global i32 0
define signext i8 @getchf(i8* %0, i8 signext %1) {
%3 = tail call signext i8 (...) @GComm()
%4 = tail call i32* @strchr(i8* %0, i8 signext %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stdout
%8 = tail call i32 @putc(i32 7, i32 %7)
br label %9
9: ; preds = %6, %2
%10 = phi i8 [ %1, %6 ], [ %3, %2 ]
ret i8 %10
}
int main(int arch, char **argv) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
char *strchr(char const *, char);
int chrpos(const char *haystack, char needle) {
  char *p = strchr(haystack, needle);
  if (p) {
    return p - haystack;
  }
  return -1;
}


x86 assembly (clang, -O0):
<chrpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1151 <chrpos+0x41>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1158 <chrpos+0x48>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @chrpos(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
int mySqrt(int x) {
  int a = 1;
  int b = 1;
  if (x == 1)
    return 1;
  while (a != b) {
    a = b;
    b = a / 2 + x / a / 2;
  }
  return a;
}


x86 assembly (clang, -O0):
<mySqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    112b <mySqrt+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1174 <mySqrt+0x74>
jmp    1130 <mySqrt+0x30>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     116e <mySqrt+0x6e>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <mySqrt+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mySqrt(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c, s;
  scanf("%c", &c);
  s = 'z' - (c - 'a');
  printf("%c", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xea9(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0xf(%rsp),%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aa_checked_free(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<aa_checked_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <aa_checked_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_checked_free>:
test   %rdi,%rdi
je     111a <aa_checked_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @aa_checked_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @aa_checked_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int sourceA();
int /*<<< orphan*/ two_arg_sink_caller(int, int);
int caller2() {
  int a = sourceA();
  int b = 0;
  two_arg_sink_caller(a, b);
}


x86 assembly (clang, -O0):
<caller2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sourceA@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <two_arg_sink_caller@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller2>:
push   %rax
xor    %eax,%eax
call   1030 <sourceA@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <two_arg_sink_caller@plt>

LLVM IR (-O0):
define i32 @caller2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @sourceA()
store i32 %4, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @two_arg_sink_caller(i32 %5, i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @caller2() {
%1 = tail call i32 (...) @sourceA()
%2 = tail call i32 @two_arg_sink_caller(i32 %1, i32 0)
ret i32 undef
}