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

/* Variables and functions */
int /*<<< orphan*/ ia_setbit64(int /*<<< orphan*/, int);
void ia_setbitv64(uint64_t *words, int i) {
  words[i / 64] = ia_setbit64(words[i / 64], i % 64);
}


x86 assembly (clang, -O0):
<ia_setbitv64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1030 <ia_setbit64@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ia_setbitv64>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x3f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x6,%ecx
movslq %ecx,%rbx
mov    (%rdi,%rbx,4),%edi
and    $0xffffffc0,%eax
sub    %eax,%esi
call   1030 <ia_setbit64@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ia_setbitv64(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 = sdiv i32 %6, 64
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 64
%13 = call i32 @ia_setbit64(i32 %10, i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 64
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
store i32 %13, i32* %18
ret void
}

LLVM IR (-O2):
define void @ia_setbitv64(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 64
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = srem i32 %1, 64
%8 = tail call i32 @ia_setbit64(i32 %6, i32 %7)
store i32 %8, i32* %5
ret void
}
/* Type definitions */
struct cart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cartVarDbName(char *, char *);
double cartUsualDouble(struct cart *, int /*<<< orphan*/, double);
double cartUsualDoubleDb(struct cart *cart, char *db, char *var, double usual) {
  return cartUsualDouble(cart, _cartVarDbName(db, var), usual);
}


x86 assembly (clang, -O0):
<cartUsualDoubleDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_cartVarDbName@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
movsd  -0x20(%rbp),%xmm0
call   1030 <cartUsualDouble@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cartUsualDoubleDb>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <_cartVarDbName@plt>
mov    %rbx,%rdi
mov    %eax,%esi
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <cartUsualDouble@plt>

LLVM IR (-O0):
%struct.cart = type { i32 }
define double @cartUsualDoubleDb(%struct.cart* %0, i8* %1, i8* %2, double %3) {
%5 = alloca %struct.cart*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca double
store %struct.cart* %0, %struct.cart** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store double %3, double* %8
%9 = load %struct.cart*, %struct.cart** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @_cartVarDbName(i8* %10, i8* %11)
%13 = load double, double* %8
%14 = call double @cartUsualDouble(%struct.cart* %9, i32 %12, double %13)
ret double %14
}

LLVM IR (-O2):
%struct.cart = type { i32 }
define double @cartUsualDoubleDb(%struct.cart* %0, i8* %1, i8* %2, double %3) {
%5 = tail call i32 @_cartVarDbName(i8* %1, i8* %2)
%6 = tail call double @cartUsualDouble(%struct.cart* %0, i32 %5, double %3)
ret double %6
}
void XkbGetNamedGeometry() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetNamedGeometry() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
void nil_dvec(int n, double *p) { memset(p, 0, sizeof(double) * n); }


x86 assembly (clang, -O0):
<nil_dvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nil_dvec>:
lea    0x0(,%rdi,8),%edx
mov    %rsi,%rdi
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @nil_dvec(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = mul i64 8, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(double* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @nil_dvec(i32 %0, double* %1) {
%3 = shl i32 %0, 3
%4 = tail call i32 @memset(double* %1, i32 0, i32 %3)
ret void
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *refseqIDParser(char *header) {
  return tokenParser(header, "|", 1, "refseqIDParser");
}


x86 assembly (clang, -O0):
<refseqIDParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
lea    0xecf(%rip),%rcx
call   1030 <tokenParser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refseqIDParser>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
@.str.1 = [15 x i8] c"refseqIDParser\00"
define i8* @refseqIDParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int errno;
void SetErrno(int n) { errno = n; }


x86 assembly (clang, -O0):
<SetErrno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetErrno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @SetErrno(i32 %0) {
store i32 %0, i32* @errno
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
int irand(const int max) {
  return (int)(1.0 * max * rand() / (RAND_MAX + 1.0));
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
mov    0x2e95(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec0(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xecc(%rip),%xmm1
mulsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @irand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 1.000000e+00, %4
%6 = call double (...) @rand()
%7 = fmul double %5, %6
%8 = load double, double* @RAND_MAX
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %7, %9
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @irand(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double (...) @rand()
%4 = fmul double %3, %2
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int main();
int test() { return main(); }


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

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

LLVM IR (-O0):
define i32 @test() {
%1 = call i32 (...) @main()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @main()
ret i32 %1
}
int test_imm_F8int64_highword_reg(long long val) {
  return ((val >> 32) & (0xF8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F8int64_highword_reg(i64 %0) {
%2 = and i64 %0, 1065151889408
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int islower(int c) { return ('a' <= c && c <= 'z'); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <islower+0x24>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int addOne(int a) { return (a + 1); }


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

x86 assembly (clang, -O2):
<addOne>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @addOne(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @addOne(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void shutdown_input(int descriptor, char *inputFile) {
  if (close(descriptor) == -1) {
    perror(inputFile);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<shutdown_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1167 <shutdown_input+0x37>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdown_input>:
push   %rbx
mov    %rsi,%rbx
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     1140 <shutdown_input+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @shutdown_input(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @perror(i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @shutdown_input(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int toupper(int);
int SDL_toupper(int x) { return toupper(x); }


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

x86 assembly (clang, -O2):
<SDL_toupper>:
jmp    1030 <toupper@plt>

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

LLVM IR (-O2):
define i32 @SDL_toupper(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
ret i32 %2
}
/* Type definitions */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ connection_close_private(struct connection *);
struct connection *connection_find_fd(int);
void connection_close_fd(int fd) {
  struct connection *c;
  c = connection_find_fd(fd);
  if (c)
    connection_close_private(c);
  else
    do
      if ((fd) != -1)
        close(fd);
    while (0);
}


x86 assembly (clang, -O0):
<connection_close_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <connection_find_fd@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <connection_close_fd+0x30>
mov    -0x10(%rbp),%rdi
call   1050 <connection_close_private@plt>
jmp    1181 <connection_close_fd+0x51>
jmp    1165 <connection_close_fd+0x35>
cmpl   $0xffffffff,-0x4(%rbp)
je     1177 <connection_close_fd+0x47>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
jmp    117c <connection_close_fd+0x4c>
jmp    1181 <connection_close_fd+0x51>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connection_close_fd>:
push   %rbx
mov    %edi,%ebx
call   1040 <connection_find_fd@plt>
test   %rax,%rax
je     1146 <connection_close_fd+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <connection_close_private@plt>
cmp    $0xffffffff,%ebx
je     1153 <connection_close_fd+0x23>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.connection = type { i32 }
define void @connection_close_fd(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.connection*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.connection* @connection_find_fd(i32 %4)
store %struct.connection* %5, %struct.connection** %3
%6 = load %struct.connection*, %struct.connection** %3
%7 = icmp ne %struct.connection* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.connection*, %struct.connection** %3
%10 = call i32 @connection_close_private(%struct.connection* %9)
br label %20
11: ; preds = %1
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %15, %12
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19, %8
ret void
}

LLVM IR (-O2):
%struct.connection = type { i32 }
define void @connection_close_fd(i32 %0) {
%2 = tail call %struct.connection* @connection_find_fd(i32 %0)
%3 = icmp eq %struct.connection* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @connection_close_private(%struct.connection* %2)
br label %10
6: ; preds = %1
%7 = icmp eq i32 %0, -1
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @close(i32 %0)
br label %10
10: ; preds = %6, %8, %4
ret void
}
int current_directory(const char *filename) {}


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

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

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

LLVM IR (-O2):
define i32 @current_directory(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ dup2(int /*<<< orphan*/, int);
int /*<<< orphan*/ execv(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ perror(char *);
int main() {
  pid_t p;
  dup2(0, 99);
  p = fork();
  if (p < 0) {
    perror("fork");
    exit(1);
  }
  if (p == 0)
    execv("riddle", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x63,%esi
call   1030 <dup2@plt>
mov    $0x0,%al
call   1070 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1197 <main+0x47>
lea    0xe78(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
cmpq   $0x0,-0x10(%rbp)
jne    11b2 <main+0x62>
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <execv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x63,%esi
call   1030 <dup2@plt>
xor    %eax,%eax
call   1070 <fork@plt>
test   %rax,%rax
js     117d <main+0x2d>
jne    1179 <main+0x29>
lea    0xe93(%rip),%rdi
xor    %esi,%esi
call   1060 <execv@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe7c(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fork\00"
@.str.1 = [7 x i8] c"riddle\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @dup2(i32 0, i32 99)
%4 = call i64 (...) @fork()
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i64, i64* %2
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @execv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
br label %15
15: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
@.str.1 = [7 x i8] c"riddle\00"
define i32 @main() {
%1 = tail call i32 @dup2(i32 0, i32 99)
%2 = tail call i64 (...) @fork()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = icmp eq i64 %2, 0
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @execv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
br label %11
11: ; preds = %9, %7
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int swap_standard_slices(void) {
  double *c;
  int fail, *a, *b;
  fail = _ada_use_c2phc4c(46, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<swap_standard_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x2e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_standard_slices>:
mov    $0x2e,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @swap_standard_slices() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 46, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("Usage: %s [ [p]ause | [r]estart | [s]top ]\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: %s [ [p]ause | [r]estart | [s]top ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: %s [ [p]ause | [r]estart | [s]top ]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *argv0) {
  printf("\n"
         "   Usage: %s <filename-1> <filename-2>\n"
         "\n"
         "      Compares the two files, but not strictly. The two files\n"
         "      must have the same number of bytes; however, each byte can\n"
         "      differ plus or minus 4. This is to compare normalized files\n"
         "      which will have small differences from rounding errors\n"
         "\n"
         "      Exit status is 0 if the files are the \"same\", 1 if they\n"
         "      are different, and 2 if there is some error reading the\n"
         "      files.\n"
         "\n",
         basename(argv0));
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
call   1040 <basename@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [435 x i8] c"\0A Usage: %s <filename-1> <filename-2>\0A\0A Compares the two files, but not strictly. The two files\0A must have the same number of bytes; however, each byte can\0A differ plus or minus 4. This is to compare normalized files\0A which will have small differences from rounding errors\0A\0A Exit status is 0 if the files are the \22same\22, 1 if they\0A are different, and 2 if there is some error reading the\0A files.\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @basename(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([435 x i8], [435 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [435 x i8] c"\0A Usage: %s <filename-1> <filename-2>\0A\0A Compares the two files, but not strictly. The two files\0A must have the same number of bytes; however, each byte can\0A differ plus or minus 4. This is to compare normalized files\0A which will have small differences from rounding errors\0A\0A Exit status is 0 if the files are the \22same\22, 1 if they\0A are different, and 2 if there is some error reading the\0A files.\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([435 x i8], [435 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void exchangeValue3(int *x, int *y) {
  *x = (*x) - (*y);
  *y = (*x) + (*y);
  *x = (*y) - (*x);
}


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

x86 assembly (clang, -O2):
<exchangeValue3>:
mov    (%rdi),%eax
sub    (%rsi),%eax
mov    %eax,(%rdi)
add    (%rsi),%eax
mov    %eax,(%rsi)
sub    (%rdi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @exchangeValue3(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = sub nsw i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @exchangeValue3(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %0
ret void
}
int match_no_quot(char c) { return (c != '"'); }


x86 assembly (clang, -O0):
<match_no_quot>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x22,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_no_quot>:
xor    %eax,%eax
cmp    $0x22,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @match_no_quot(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 34
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @match_no_quot(i8 signext %0) {
%2 = icmp ne i8 %0, 34
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int cfg_processor_get_hex_int_attr(void *, char *);
int cfg_timer_a_get_taccr_addr(void *reg) {
  return cfg_processor_get_hex_int_attr(reg, "taccr");
}


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

x86 assembly (clang, -O2):
<cfg_timer_a_get_taccr_addr>:
lea    0xee9(%rip),%rsi
jmp    1030 <cfg_processor_get_hex_int_attr@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"taccr\00"
define i32 @cfg_timer_a_get_taccr_addr(i8* %0) {
%2 = tail call i32 @cfg_processor_get_hex_int_attr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void _timeval_from_timespec(struct timeval *tv, struct timespec *ts) {
  tv->tv_sec = ts->tv_sec;
  tv->tv_usec = ts->tv_nsec / 1000;
}


x86 assembly (clang, -O0):
<_timeval_from_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_timeval_from_timespec>:
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
movslq (%rsi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timespec = type { i32, i32 }
define void @_timeval_from_timespec(%struct.timeval* %0, %struct.timespec* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timespec*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = load %struct.timespec*, %struct.timespec** %4
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 1000
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timespec = type { i32, i32 }
define void @_timeval_from_timespec(%struct.timeval* nocapture writeonly %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void main() {
  int x = 0;
  int t = 0;
  int phase = 0;
  while (t < 100) {
    if (phase == 0)
      x = x + 2;
    if (phase == 1)
      x = x - 1;
    phase = 1 - phase;
    t++;
  }
  assert(x <= 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1176 <main+0x66>
cmpl   $0x0,-0xc(%rbp)
jne    114a <main+0x3a>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    115d <main+0x4d>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x64,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 2
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %1
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %1
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %3
%21 = sub nsw i32 1, %20
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %4
24: ; preds = %4
%25 = load i32, i32* %1
%26 = icmp sle i32 %25, 100
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hdd_image_seek(int /*<<< orphan*/, int /*<<< orphan*/);
void scsi_hd_seek(uint8_t id, uint32_t pos) { hdd_image_seek(id, pos); }


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

x86 assembly (clang, -O2):
<scsi_hd_seek>:
jmp    1030 <hdd_image_seek@plt>

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

LLVM IR (-O2):
define void @scsi_hd_seek(i32 %0, i32 %1) {
%3 = tail call i32 @hdd_image_seek(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintDup(char *);
int main() {
  char str[] = "aaabbbcqqwwrrrrffdgdsgs";
  PrintDup(str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x73677364676466,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <PrintDup@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.str = [24 x i8] c"aaabbbcqqwwrrrrffdgdsgs\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%3 = call i32 @PrintDup(i8* %2)
ret i32 0
}
/* Variables and functions */
unsigned long *bitmap_init1(int /*<<< orphan*/, size_t);
int /*<<< orphan*/ bitmap_n_bytes(size_t);
int /*<<< orphan*/ xmalloc(int /*<<< orphan*/);
unsigned long *bitmap_allocate1(size_t n_bits) {
  return bitmap_init1(xmalloc(bitmap_n_bytes(n_bits)), n_bits);
}


x86 assembly (clang, -O0):
<bitmap_allocate1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bitmap_n_bytes@plt>
mov    %eax,%edi
call   1030 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1050 <bitmap_init1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_allocate1>:
push   %rbx
mov    %rdi,%rbx
call   1040 <bitmap_n_bytes@plt>
mov    %eax,%edi
call   1030 <xmalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <bitmap_init1@plt>

LLVM IR (-O0):
define i64* @bitmap_allocate1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @bitmap_n_bytes(i64 %3)
%5 = call i32 @xmalloc(i32 %4)
%6 = load i64, i64* %2
%7 = call i64* @bitmap_init1(i32 %5, i64 %6)
ret i64* %7
}

LLVM IR (-O2):
define i64* @bitmap_allocate1(i64 %0) {
%2 = tail call i32 @bitmap_n_bytes(i64 %0)
%3 = tail call i32 @xmalloc(i32 %2)
%4 = tail call i64* @bitmap_init1(i32 %3, i64 %0)
ret i64* %4
}
void insert(struct node *head, int index, int value) {}


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

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

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

LLVM IR (-O2):
%struct.node = type opaque
define void @insert(%struct.node* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_flttoflt_flt_flt(float *, float);
float xil_fpo_flttoflt_flt_flt(float a) {
  float res_flt;
  xip_fpo_flttoflt_flt_flt(&res_flt, a);
  return res_flt;
}


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

x86 assembly (clang, -O2):
<xil_fpo_flttoflt_flt_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_flttoflt_flt_flt@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xil_fpo_flttoflt_flt_flt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 @xip_fpo_flttoflt_flt_flt(float* %3, float %4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @xil_fpo_flttoflt_flt_flt(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @xip_fpo_flttoflt_flt_flt(float* %2, float %0)
%5 = load float, float* %2
ret float %5
}
/* Type definitions */
struct maxentmc_list_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct maxentmc_list_struct *const);
int /*<<< orphan*/ maxentmc_list_clear(struct maxentmc_list_struct *const);
void maxentmc_list_free(struct maxentmc_list_struct *const d) {
  if (d) {
    maxentmc_list_clear(d);
    free(d);
  }
}


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

x86 assembly (clang, -O2):
<maxentmc_list_free>:
test   %rdi,%rdi
je     1137 <maxentmc_list_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <maxentmc_list_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.maxentmc_list_struct = type { i32 }
define void @maxentmc_list_free(%struct.maxentmc_list_struct* %0) {
%2 = icmp eq %struct.maxentmc_list_struct* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @maxentmc_list_clear(%struct.maxentmc_list_struct* %0)
%5 = tail call i32 @free(%struct.maxentmc_list_struct* %0)
br label %6
6: ; preds = %3, %1
ret void
}
int test_imm_BDuint8_mem(unsigned char *val) {
  return ((*val) & (0xBD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BDuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 189
%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_BDuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -67
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void alfree(void *ptr) {
  unsigned char *cptr = ptr;
  free(cptr - (ptrdiff_t)cptr[-1] - 1);
}


x86 assembly (clang, -O0):
<alfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl -0x1(%rax),%eax
movslq %eax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alfree>:
movzbl -0x1(%rdi),%eax
not    %rax
add    %rax,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @alfree(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = sext i32 %9 to i64
%11 = sub i64 0, %10
%12 = getelementptr inbounds i8, i8* %5, i64 %11
%13 = getelementptr inbounds i8, i8* %12, i64 -1
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
define void @alfree(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = sub nsw i64 0, %4
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = tail call i32 @free(i8* %7)
ret void
}
old_int(a, b) { return a + b; }


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

x86 assembly (clang, -O2):
<old_int>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @old_int(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @old_int(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char fPeekChar(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char peekChar() { return fPeekChar(stdin); }


x86 assembly (clang, -O0):
<peekChar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fPeekChar@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<peekChar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fPeekChar@plt>

LLVM IR (-O0):
@stdin = global i32 0
define signext i8 @peekChar() {
%1 = load i32, i32* @stdin
%2 = call signext i8 @fPeekChar(i32 %1)
ret i8 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define signext i8 @peekChar() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @fPeekChar(i32 %1)
ret i8 %2
}
void Zip_Interrupt_Init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @Zip_Interrupt_Init() {
ret void
}
void not_a_prototype_test() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  FILE *fp;
  fp = fopen("/etc/fanadmin", "w+");
  if (fp == NULL) {
    puts("Couldn't open /etc/fanadmin");
    return 1;
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec4(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1180 <main+0x50>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1190 <main+0x60>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1155 <main+0x25>
mov    %rax,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/etc/fanadmin\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [28 x i8] c"Couldn't open /etc/fanadmin\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %15
12: ; preds = %2
%13 = load i32*, i32** %6
%14 = call i32 @fclose(i32* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %12, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [14 x i8] c"/etc/fanadmin\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [28 x i8] c"Couldn't open /etc/fanadmin\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 @fclose(i32* %3)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %10
}
void rtc_nvmem_unregister(struct rtc_device *rtc) {}


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

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

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

LLVM IR (-O2):
%struct.rtc_device = type opaque
define void @rtc_nvmem_unregister(%struct.rtc_device* nocapture %0) {
ret void
}