xunge/DecIR huggingface dataset:
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int firetalk_internal_connect_host_addr(char const *const, int const,
                                        struct sockaddr_in *,
                                        struct sockaddr_in6 *);
int firetalk_internal_connect_host(const char *const host, const int port) {
  struct sockaddr_in myinet4;
  struct sockaddr_in6 myinet6;
  return (firetalk_internal_connect_host_addr(host, port, &myinet4, &myinet6));
}


x86 assembly (clang, -O0):
<firetalk_internal_connect_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <firetalk_internal_connect_host_addr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firetalk_internal_connect_host>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <firetalk_internal_connect_host_addr@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr_in6 = type { i32 }
define i32 @firetalk_internal_connect_host(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.sockaddr_in6
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @firetalk_internal_connect_host_addr(i8* %7, i32 %8, %struct.sockaddr_in* %5, %struct.sockaddr_in6* %6)
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr_in6 = type { i32 }
define i32 @firetalk_internal_connect_host(i8* %0, i32 %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in6
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = bitcast %struct.sockaddr_in6* %4 to i8*
%7 = call i32 @firetalk_internal_connect_host_addr(i8* %0, i32 %1, %struct.sockaddr_in* %3, %struct.sockaddr_in6* %4)
ret i32 %7
}
int test_13(unsigned char *x, int y, int z) { return (x[0] >> 2) & 16 ? y : z; }


x86 assembly (clang, -O0):
<test_13>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sar    $0x2,%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     112f <test_13+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <test_13+0x35>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_13>:
mov    %esi,%eax
testb  $0x40,(%rdi)
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_13(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = ashr i32 %10, 2
%12 = and i32 %11, 16
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i32, i32* %5
br label %18
16: ; preds = %3
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_13(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, 64
%6 = icmp eq i8 %5, 0
%7 = select i1 %6, i32 %2, i32 %1
ret i32 %7
}
const char *app_dataroot(void) { return "bundle://"; }


x86 assembly (clang, -O0):
<app_dataroot>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<app_dataroot>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"bundle://\00"
define i8* @app_dataroot() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"bundle://\00"
define i8* @app_dataroot() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
char *xmalloc(n)
unsigned int n;
{ return mallocate(n); }


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

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
xor    %eax,%eax
call   1030 <mallocate@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @mallocate to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @xmalloc(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @mallocate to i32 (i32, ...)*)(i32 %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int test_imm_99int16_reg(short val) {
  return ((val) & (-0x99 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_99int16_reg>:
test   $0xff67,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_99int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -153
%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_99int16_reg(i16 signext %0) {
%2 = and i16 %0, -153
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned char inb_local(int);
int /*<<< orphan*/ slow_down_io();
__attribute__((always_)) unsigned char inb_local_p(int port) {
  unsigned char value = inb_local(port);
  slow_down_io();
  return value;
}


x86 assembly (clang, -O0):
<inb_local_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inb_local@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <slow_down_io@plt>
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_local_p>:
push   %rbx
call   1030 <inb_local@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @inb_local_p(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call zeroext i8 @inb_local(i32 %4)
store i8 %5, i8* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i8, i8* %3
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @inb_local_p(i32 %0) {
%2 = tail call zeroext i8 @inb_local(i32 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i8 %2
}
double dclean(x)
double x;
{
  static double y;
  y = x;
  return y;
}


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

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

LLVM IR (-O0):
@dclean.y = internal global double 0.000000e+00
define double @dclean(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
store double %3, double* @dclean.y
%4 = load double, double* @dclean.y
ret double %4
}

LLVM IR (-O2):
define double @dclean(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello, %s #%d!\n", "world", 253);
  printf("%d\n", 0);
  printf("%d\n", 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0xfd,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x9,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0xfd,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, %s #%d!\0A\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 253)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 9)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, %s #%d!\0A\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 253)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 9)
ret i32 0
}
/* Type definitions */
struct dirent {
  scalar_t__ d_ino;
};
typedef scalar_t__ blkcnt_t;

/* Variables and functions */
void uninitvar_types(void) {
  blkcnt_t b;
  b + 1;
  struct dirent d;
  d.d_ino + 1;
}


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

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

LLVM IR (-O0):
%struct.dirent = type { i64 }
define void @uninitvar_types() {
%1 = alloca i64
%2 = alloca %struct.dirent
%3 = load i64, i64* %1
%4 = add nsw i64 %3, 1
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %2, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 1
ret void
}

LLVM IR (-O2):
define void @uninitvar_types() {
ret void
}
/* Variables and functions */
int A(int);
int B(int, int);
int /*<<< orphan*/ assert(int);
int main(int argc, char *argv[]) {
  assert(A(8) == 0xFFFFFF00);
  assert(B(16, 8) == 0x00FFFF00);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8,%edi
call   1050 <A@plt>
cmp    $0xffffff00,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x10,%edi
mov    $0x8,%esi
call   1030 <B@plt>
cmp    $0xffff00,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1050 <A@plt>
xor    %edi,%edi
cmp    $0xffffff00,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x10,%edi
mov    $0x8,%esi
call   1030 <B@plt>
xor    %edi,%edi
cmp    $0xffff00,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @A(i32 8)
%7 = icmp eq i32 %6, -256
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @B(i32 16, i32 8)
%11 = icmp eq i32 %10, 16776960
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @A(i32 8)
%4 = icmp eq i32 %3, -256
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @B(i32 16, i32 8)
%8 = icmp eq i32 %7, 16776960
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main(int argc, char *argv[]) {
  const int a = 5;
  int *p = (int *)&a;
  *p = 100;
  printf("a = %d\n", a);
  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)
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x64,(%rax)
lea    0xeba(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
void *Cyc_Core_identity(void *x) {
  void *_T0;
  _T0 = x;
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Core_identity>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @Cyc_Core_identity(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
ret i8* %5
}

LLVM IR (-O2):
define i8* @Cyc_Core_identity(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void yyerror(char *s) { fprintf(stderr, "%s\n", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgstack(int n) { ngen("%s\tsp,%d", "add", n); }


x86 assembly (clang, -O0):
<cgstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstack>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee9(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s\09sp,%d\00"
@.str.1 = [4 x i8] c"add\00"
define void @cgstack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s\09sp,%d\00"
@.str.1 = [4 x i8] c"add\00"
define void @cgstack(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void USBHostMode(unsigned long ulBase) {
  ;
  (*((volatile unsigned char *)(ulBase + 0x0000041C))) &= ~(0x00000001);
}


x86 assembly (clang, -O0):
<USBHostMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x41c(%rax),%cl
movzbl %cl,%ecx
and    $0xfffffffe,%ecx
mov    %cl,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostMode>:
andb   $0xfe,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBHostMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1052
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, -2
%9 = trunc i32 %8 to i8
store volatile i8 %9, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBHostMode(i64 %0) {
%2 = add i64 %0, 1052
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
%5 = and i8 %4, -2
store volatile i8 %5, i8* %3
ret void
}
char *strcsrch(s1, s2)
char *s1;
char *s2;
{
  int ls1;
  ls1 = strlen(s1);
  return (strncsrch(s1, s2, ls1));
}


x86 assembly (clang, -O0):
<strcsrch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <strncsrch@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcsrch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <strncsrch@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcsrch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strncsrch to i32 (i8*, i8*, i32, ...)*)(i8* %9, i8* %10, i32 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @strcsrch(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strncsrch to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int errno;
void SetErrno(uintptr_t value) { errno = (int)value; }


x86 assembly (clang, -O0):
<SetErrno>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    0x2ecb(%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(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
store i32 %4, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @SetErrno(i64 %0) {
%2 = trunc i64 %0 to i32
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int mkstemp(char *);
int set_cloexec_or_close(int);
int /*<<< orphan*/ unlink(char *);
int create_tmpfile_cloexec(char *tmpname) {
  int fd;
  fd = mkstemp(tmpname);
  if (fd >= 0) {
    fd = set_cloexec_or_close(fd);
    unlink(tmpname);
  }
  return fd;
}


x86 assembly (clang, -O0):
<create_tmpfile_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mkstemp@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1166 <create_tmpfile_cloexec+0x36>
mov    -0xc(%rbp),%edi
call   1050 <set_cloexec_or_close@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_tmpfile_cloexec>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <mkstemp@plt>
test   %eax,%eax
js     1152 <create_tmpfile_cloexec+0x22>
mov    %eax,%edi
call   1050 <set_cloexec_or_close@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @create_tmpfile_cloexec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @mkstemp(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @set_cloexec_or_close(i32 %9)
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = call i32 @unlink(i8* %11)
br label %13
13: ; preds = %8, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @create_tmpfile_cloexec(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @set_cloexec_or_close(i32 %2)
%6 = tail call i32 @unlink(i8* %0)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %8
}
uextInstall() {}


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

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

LLVM IR (-O0):
define i32 @uextInstall() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @uextInstall() {
ret i32 undef
}
/* Variables and functions */
double r1279();
double drand(double min, double max) { return min + r1279() * (max - min); }


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <r1279@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <r1279@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @drand(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 = call double (...) @r1279()
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double %5)
ret double %10
}

LLVM IR (-O2):
define double @drand(double %0, double %1) {
%3 = tail call double (...) @r1279()
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
width(s) char *s;
{
  int w;
  w = 0;
  while (*s != '\0') {
    if (*s == '\b')
      --w;
    else if (*s != '\n' && *s != '\r')
      ++w;
    ++s;
  }
  return (w);
}


x86 assembly (clang, -O0):
<width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117c <width+0x7c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x8,%eax
jne    113d <width+0x3d>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <width+0x6b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1166 <width+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1166 <width+0x66>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <width+0x6b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <width+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<width>:
xor    %eax,%eax
lea    0xef7(%rip),%rcx
jmp    1117 <width+0x17>
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%edx
cmp    $0xd,%rdx
ja     1110 <width+0x10>
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
add    $0xffffffff,%eax
add    $0x1,%rdi
jmp    1117 <width+0x17>
ret

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

LLVM IR (-O2):
define i32 @width(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i8* [ %0, %1 ], [ %12, %10 ]
%4 = phi i32 [ 0, %1 ], [ %11, %10 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %13
i8 8, label %6
i8 10, label %10
i8 13, label %10
]
6: ; preds = %2
%7 = add nsw i32 %4, -1
br label %10
8: ; preds = %2
%9 = add nsw i32 %4, 1
br label %10
10: ; preds = %2, %2, %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ], [ %4, %2 ], [ %4, %2 ]
%12 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
13: ; preds = %2
ret i32 %4
}
int f_le_rm1(float a1, float *a2) { return (((a1) <= (*a2))); }


x86 assembly (clang, -O0):
<f_le_rm1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_le_rm1>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @f_le_rm1(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = fcmp ole float %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_le_rm1(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp oge float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 21;
  char name[] = "Spiderman";
  printf("%d %s\n", 21, "Spiderman");
  printf("%s %d\n", name, age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0xa(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x15,%esi
lea    0xeb1(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x12(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x616d726564697053,%rax
72 6d 61
mov    %rax,0x8(%rsp)
movw   $0x6e,0x10(%rsp)
lea    0xed6(%rip),%rdx
lea    0xec8(%rip),%rdi
mov    $0x15,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    $0x15,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.name = [10 x i8] c"Spiderman\00"
@.str = [7 x i8] c"%d %s\0A\00"
@.str.1 = [10 x i8] c"Spiderman\00"
@.str.2 = [7 x i8] c"%s %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 0, i32* %1
store i32 21, i32* %2
%4 = bitcast [10 x i8]* %3 to i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %s\0A\00"
@.str.1 = [10 x i8] c"Spiderman\00"
@.str.2 = [7 x i8] c"%s %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32 21)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MSG_NOSIGNAL;
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write_header(int, char *, int /*<<< orphan*/);
void write_html(int socket_fd, char *head, char *html) {
  write_header(socket_fd, head, strlen(html));
  send(socket_fd, html, strlen(html), MSG_NOSIGNAL);
}


x86 assembly (clang, -O0):
<write_html>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
call   1050 <write_header@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    0x2e51(%rip),%rax
mov    (%rax),%ecx
call   1040 <send@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_html>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <write_header@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    0x2e81(%rip),%rcx
mov    (%rcx),%ecx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
@MSG_NOSIGNAL = global i32 0
define void @write_html(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write_header(i32 %7, i8* %8, i32 %10)
%12 = load i32, i32* %4
%13 = load i8*, i8** %6
%14 = load i8*, i8** %6
%15 = call i32 @strlen(i8* %14)
%16 = load i32, i32* @MSG_NOSIGNAL
%17 = call i32 @send(i32 %12, i8* %13, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@MSG_NOSIGNAL = global i32 0
define void @write_html(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @write_header(i32 %0, i8* %1, i32 %4)
%6 = tail call i32 @strlen(i8* %2)
%7 = load i32, i32* @MSG_NOSIGNAL
%8 = tail call i32 @send(i32 %0, i8* %2, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ setupterm(int /*<<< orphan*/, int, int *);
void ataribasic_setuptermcap(void) {
  int error;
  setupterm(getenv("TERM"), 1, &error);
}


x86 assembly (clang, -O0):
<ataribasic_setuptermcap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
mov    $0x1,%esi
lea    -0x4(%rbp),%rdx
call   1040 <setupterm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ataribasic_setuptermcap>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
lea    0x4(%rsp),%rdx
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <setupterm@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TERM\00"
define void @ataribasic_setuptermcap() {
%1 = alloca i32
%2 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @setupterm(i32 %2, i32 1, i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"TERM\00"
define void @ataribasic_setuptermcap() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @setupterm(i32 %3, i32 1, i32* %1)
ret void
}
/* Variables and functions */
char *base64_encode_multiple(void *, size_t, int *);
char *base64_encode(void *data, size_t size) {
  int line_count = 0;
  return base64_encode_multiple(data, size, &line_count);
}


x86 assembly (clang, -O0):
<base64_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <base64_encode_multiple@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <base64_encode_multiple@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @base64_encode(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i8* @base64_encode_multiple(i8* %0, i64 %1, i32* %3)
ret i8* %5
}
char *smalloc(size)
unsigned long size;
{
  char *p, *malloc();
  p = sbrk(0);
  if (brk(p + size + sizeof(long)) != (char *)0) {
    fatal("Exhausted mem\n");
  }
  return (p + sizeof(long) - ((long)p % sizeof(long)));
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1040 <sbrk@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    $0x0,%al
call   1030 <brk@plt>
cltq
cmp    $0x0,%rax
je     1178 <smalloc+0x48>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    -0x10(%rbp),%rdx
and    $0x7,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
xor    %eax,%eax
call   1040 <sbrk@plt>
movslq %eax,%rbx
lea    (%rbx,%r14,1),%rdi
add    $0x8,%rdi
xor    %eax,%eax
call   1030 <brk@plt>
test   %eax,%eax
je     1164 <smalloc+0x34>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1050 <fatal@plt>
and    $0xfffffffffffffff8,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Exhausted mem\0A\00"
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @sbrk to i32 (i32, ...)*)(i32 0)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i64, i64* %2
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 8
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @brk to i32 (i8*, ...)*)(i8* %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %1
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 8
%20 = load i8*, i8** %3
%21 = ptrtoint i8* %20 to i64
%22 = urem i64 %21, 8
%23 = sub i64 0, %22
%24 = getelementptr inbounds i8, i8* %19, i64 %23
ret i8* %24
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exhausted mem\0A\00"
define i8* @smalloc(i64 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @sbrk to i32 (i32, ...)*)(i32 0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = getelementptr inbounds i8, i8* %4, i64 %0
%6 = getelementptr inbounds i8, i8* %5, i64 8
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @brk to i32 (i8*, ...)*)(i8* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = getelementptr inbounds i8, i8* %4, i64 8
%13 = and i64 %3, 7
%14 = sub nsw i64 0, %13
%15 = getelementptr inbounds i8, i8* %12, i64 %14
ret i8* %15
}
/* Variables and functions */
int shutdown(int, int);
int ab_shutdown(int sockfd, int how) { return shutdown(sockfd, how); }


x86 assembly (clang, -O0):
<ab_shutdown>:
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 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ab_shutdown>:
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
define i32 @ab_shutdown(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 @shutdown(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ab_shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func1(int);
int /*<<< orphan*/ func2(int);
int main() {
  func1(8);
  func2(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1030 <func1@plt>
mov    $0xa,%edi
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <func1@plt>
mov    $0xa,%edi
call   1040 <func2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @func1(i32 8)
%3 = call i32 @func2(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func1(i32 8)
%2 = tail call i32 @func2(i32 10)
ret i32 0
}
/* Variables and functions */
int ns_foo();
int nonsecure4(void) { return ns_foo(); }


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

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

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

LLVM IR (-O2):
define i32 @nonsecure4() {
%1 = tail call i32 (...) @ns_foo()
ret i32 %1
}
int ft_isspace(int c) {
  unsigned char s;
  s = (unsigned char)c;
  if (s == '\t' || s == '\n' || s == '\v' || s == '\f' || s == '\r' || s == ' ')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x9,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xa,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xb,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xc,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xd,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jne    1167 <ft_isspace+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isspace+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <ft_isspace+0xe>
ret
cmp    $0x20,%dil
je     110d <ft_isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
%2 = trunc i32 %0 to i8
switch i8 %2, label %3 [
i8 32, label %4
i8 13, label %4
i8 12, label %4
i8 11, label %4
i8 10, label %4
i8 9, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
int test_imm_47uint32_reg(unsigned int val) {
  return ((val) & (0x47 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_47uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x47,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_47uint32_reg(i32 %0) {
%2 = and i32 %0, 71
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float fahr_to_cels(int fahr) { return (5.0 / 9.0) * (fahr - 32); }


x86 assembly (clang, -O0):
<fahr_to_cels>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_cels>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr_to_cels(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = sitofp i32 %4 to double
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahr_to_cels(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int module_start(void) {
  printk("Welcome to dark ocean! hope you will not give up learning me!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<module_start>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"Welcome to dark ocean! hope you will not give up learning me!\0A\00"
define i32 @module_start() {
%1 = call i32 @printk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"Welcome to dark ocean! hope you will not give up learning me!\0A\00"
define i32 @module_start() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int c;
  assume(c == 0 && i == 0);
  while (i < 100) {
    c = c + i;
    i = i + 1;
    if (i <= 0)
      break;
  }
  assert(c >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    1148 <main+0x28>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x64,-0x8(%rbp)
jge    1185 <main+0x65>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1180 <main+0x60>
jmp    1185 <main+0x65>
jmp    1155 <main+0x35>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ BigEndianReadU32(int /*<<< orphan*/ const *);
float BigEndianReadF32(const uint8_t *bytes) {
  union {
    float f32;
    uint32_t u32;
  } u;
  u.u32 = BigEndianReadU32(bytes);
  return u.f32;
}


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

x86 assembly (clang, -O2):
<BigEndianReadF32>:
push   %rax
call   1030 <BigEndianReadU32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @BigEndianReadF32(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @BigEndianReadU32(i32* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @BigEndianReadF32(i32* %0) {
%2 = tail call i32 @BigEndianReadU32(i32* %0)
%3 = bitcast i32 %2 to float
ret float %3
}
void estimate_ncf_terminate(void) {}


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

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

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

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