xunge/DecIR huggingface dataset:
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_machine_get_ifindices(const char *machine, int **ifindices) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_machine_get_ifindices>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_machine_get_ifindices>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_machine_get_ifindices(i8* %0, i32** %1) {
%3 = alloca i8*
%4 = alloca i32**
store i8* %0, i8** %3
store i32** %1, i32*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_machine_get_ifindices(i8* nocapture readnone %0, i32** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int _bme_cookie_read(int, char const *);
int bme_cookie_read(int fd, const char *cookie) {
  return _bme_cookie_read(fd, cookie);
}


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

x86 assembly (clang, -O2):
<bme_cookie_read>:
jmp    1030 <_bme_cookie_read@plt>

LLVM IR (-O0):
define i32 @bme_cookie_read(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 = load i8*, i8** %4
%7 = call i32 @_bme_cookie_read(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bme_cookie_read(i32 %0, i8* %1) {
%3 = tail call i32 @_bme_cookie_read(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_callback(void *arg) {
  printf("callback test pass\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<test_callback>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"callback test pass\0A\00"
define i32 @test_callback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [19 x i8] c"callback test pass\00"
define i32 @test_callback(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int x(void) {
  switch (1) {
  case 2:;
    int y = 0;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @x() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  scanf("%c", &c);
  int k;
  k = c;
  int n;
  n = k - 96;
  char a;
  a = 123 - n;
  printf("%c", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t gt_uint32_key_mul_hash(uint32_t key) {
  uint32_t x = ((uint64_t)2654435761UL * key) & (~(uint32_t)0);
  return x;
}


x86 assembly (clang, -O0):
<gt_uint32_key_mul_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x9e3779b1,-0x4(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_uint32_key_mul_hash>:
imul   $0x9e3779b1,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gt_uint32_key_mul_hash(i32 %0) {
%2 = mul nsw i32 %0, -1640531535
ret i32 %2
}
int main(void) {
  int i___0;
  int a;
  {
    i___0 = 0;
    a = 0;
    return (0);
  }
}


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

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

LLVM IR (-O0):
define i32 @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
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int main1();
int main() { return main1(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @main1()
ret i32 %2
}

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

/* Variables and functions */
int /*<<< orphan*/ ftell(void *);
int64_t stdio_tell(void *fp) { return ftell(fp); }


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

x86 assembly (clang, -O2):
<stdio_tell>:
jmp    1030 <ftell@plt>

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

LLVM IR (-O2):
define i32 @stdio_tell(i8* nocapture %0) {
%2 = tail call i32 @ftell(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_PCTX;
typedef int /*<<< orphan*/ ASN1_INTEGER;

/* Variables and functions */
scalar_t__ BIO_puts(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ OPENSSL_free(char *);
char *i2s_ASN1_INTEGER(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int asn1_print_integer_ctx(BIO *out, ASN1_INTEGER *str, const ASN1_PCTX *pctx) {
  char *s;
  int ret = 1;
  s = i2s_ASN1_INTEGER(NULL, str);
  if (BIO_puts(out, s) <= 0)
    ret = 0;
  OPENSSL_free(s);
  return ret;
}


x86 assembly (clang, -O0):
<asn1_print_integer_ctx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <i2s_ASN1_INTEGER@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <BIO_puts@plt>
cmp    $0x0,%rax
jg     117a <asn1_print_integer_ctx+0x4a>
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <OPENSSL_free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_print_integer_ctx>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %edi,%edi
call   1030 <i2s_ASN1_INTEGER@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <BIO_puts@plt>
xor    %ebp,%ebp
test   %rax,%rax
setg   %bpl
mov    %rbx,%rdi
call   1050 <OPENSSL_free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @asn1_print_integer_ctx(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 1, i32* %8
%9 = load i32*, i32** %5
%10 = call i8* @i2s_ASN1_INTEGER(i32* null, i32* %9)
store i8* %10, i8** %7
%11 = load i32*, i32** %4
%12 = load i8*, i8** %7
%13 = call i64 @BIO_puts(i32* %11, i8* %12)
%14 = icmp sle i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 0, i32* %8
br label %16
16: ; preds = %15, %3
%17 = load i8*, i8** %7
%18 = call i32 @OPENSSL_free(i8* %17)
%19 = load i32, i32* %8
ret i32 %19
}

LLVM IR (-O2):
define i32 @asn1_print_integer_ctx(i32* %0, i32* %1, i32* nocapture readnone %2) {
%4 = tail call i8* @i2s_ASN1_INTEGER(i32* null, i32* %1)
%5 = tail call i64 @BIO_puts(i32* %0, i8* %4)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @OPENSSL_free(i8* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x08() {
  Assert_real((isspace(8) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              45, ("isspace should be 0 for 0x08"));
}


x86 assembly (clang, -O0):
<t_isspace_0x08>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x08>:
push   %rax
mov    $0x8,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x08\00"
define void @t_isspace_0x08() {
%1 = call i64 @isspace(i32 8)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x08\00"
define void @t_isspace_0x08() {
%1 = tail call i64 @isspace(i32 8)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ExttLocalAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttLocalAuxTable() {
ret void
}
int test_imm_91uint8_mem(unsigned char *val) {
  return ((*val) & (-0x91 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_91uint8_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, -145
%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_91uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 111
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float slapy2_(float *, float *);
float aa_cla_slapy2(float x, float y) { return slapy2_(&x, &y); }


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

x86 assembly (clang, -O2):
<aa_cla_slapy2>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <slapy2_@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @aa_cla_slapy2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float @slapy2_(float* %3, float* %4)
ret float %5
}

LLVM IR (-O2):
define float @aa_cla_slapy2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float @slapy2_(float* %3, float* %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void version(char *nombre) { fprintf(stderr, "%s 1.0.0\n", nombre); }


x86 assembly (clang, -O0):
<version>:
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):
<version>:
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 = [10 x i8] c"%s 1.0.0\0A\00"
define void @version(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 ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s 1.0.0\0A\00"
define void @version(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ tl_sun(double);
double cos_tl(double t) { return cos(tl_sun(t)); }


x86 assembly (clang, -O0):
<cos_tl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tl_sun@plt>
mov    %eax,%edi
call   1040 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_tl>:
push   %rax
call   1030 <tl_sun@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cos@plt>

LLVM IR (-O0):
define double @cos_tl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @tl_sun(double %3)
%5 = call double @cos(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @cos_tl(double %0) {
%2 = tail call i32 @tl_sun(double %0)
%3 = tail call double @cos(i32 %2)
ret double %3
}
/* Variables and functions */
void *malloc(size_t);
void *jas_malloc(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @jas_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};
struct Cyc_JumpAnalysis_Jump_Anal_Result {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
Cyc_IOEffect_analysis(struct Cyc_JumpAnalysis_Jump_Anal_Result *,
                      struct Cyc_List_List *);
int Cyc_do_ioeffect_analysis(struct Cyc_JumpAnalysis_Jump_Anal_Result *tables,
                             struct Cyc_List_List *tds) {
  ({ Cyc_IOEffect_analysis(tables, tds); });
  return 1;
}


x86 assembly (clang, -O0):
<Cyc_do_ioeffect_analysis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_IOEffect_analysis@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_do_ioeffect_analysis>:
push   %rax
call   1030 <Cyc_IOEffect_analysis@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type { i32 }
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_do_ioeffect_analysis(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* %1) {
%3 = alloca %struct.Cyc_JumpAnalysis_Jump_Anal_Result*
%4 = alloca %struct.Cyc_List_List*
%5 = alloca i32
store %struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_JumpAnalysis_Jump_Anal_Result** %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_JumpAnalysis_Jump_Anal_Result*, %struct.Cyc_JumpAnalysis_Jump_Anal_Result** %3
%7 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%8 = call i32 @Cyc_IOEffect_analysis(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %6, %struct.Cyc_List_List* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 1
}

LLVM IR (-O2):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type { i32 }
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_do_ioeffect_analysis(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* %1) {
%3 = tail call i32 @Cyc_IOEffect_analysis(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* %1)
ret i32 1
}
void *phys_to_virt(unsigned long address) {
  return (void *)((__typeof__(address))(((unsigned long)(address)&0x1fffffff) |
                                        0x80000000));
}


x86 assembly (clang, -O0):
<phys_to_virt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1fffffff,%rax
movabs $0x80000000,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phys_to_virt>:
and    $0x1fffffff,%edi
mov    $0x80000000,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i8* @phys_to_virt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 536870911
%5 = or i64 %4, 2147483648
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @phys_to_virt(i64 %0) {
%2 = and i64 %0, 536870911
%3 = or i64 %2, 2147483648
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ F_ULOCK;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ lockf(int, int /*<<< orphan*/, int /*<<< orphan*/);
void unlock_mtab(int mtablock) {
  if (mtablock >= 0) {
    lockf(mtablock, F_ULOCK, 0);
    close(mtablock);
  }
}


x86 assembly (clang, -O0):
<unlock_mtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1150 <unlock_mtab+0x30>
mov    -0x4(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_mtab>:
test   %edi,%edi
js     113f <unlock_mtab+0x1f>
push   %rbx
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
ret

LLVM IR (-O0):
@F_ULOCK = global i32 0
define void @unlock_mtab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* @F_ULOCK
%8 = call i32 @lockf(i32 %6, i32 %7, i32 0)
%9 = load i32, i32* %2
%10 = call i32 @close(i32 %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@F_ULOCK = global i32 0
define void @unlock_mtab(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @F_ULOCK
%5 = tail call i32 @lockf(i32 %0, i32 %4, i32 0)
%6 = tail call i32 @close(i32 %0)
br label %7
7: ; preds = %3, %1
ret void
}
float celsius_to_fahr(float t) { return (9.0 / 5.0) * t + 32.0; }


x86 assembly (clang, -O0):
<celsius_to_fahr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius_to_fahr>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celsius_to_fahr(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %4, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @celsius_to_fahr(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
void funct(int v1, int v2, int v3) {
  if (v1) {
    if (v2)
      f1();
  } else {
    if (v3)
      f2();
  }
}


x86 assembly (clang, -O0):
<funct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1151 <funct+0x31>
cmpl   $0x0,-0x8(%rbp)
je     114c <funct+0x2c>
mov    $0x0,%al
call   1040 <f1@plt>
jmp    1167 <funct+0x47>
cmpl   $0x0,-0xc(%rbp)
je     1162 <funct+0x42>
mov    $0x0,%al
call   1030 <f2@plt>
jmp    1167 <funct+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct>:
test   %edi,%edi
je     112f <funct+0xf>
test   %esi,%esi
je     113a <funct+0x1a>
xor    %eax,%eax
jmp    1040 <f1@plt>
test   %edx,%edx
je     113a <funct+0x1a>
xor    %eax,%eax
jmp    1030 <f2@plt>
ret

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

LLVM IR (-O2):
define void @funct(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp eq i32 %1, 0
br i1 %6, label %13, label %7
7: ; preds = %5
%8 = tail call i32 (...) @f1()
br label %13
9: ; preds = %3
%10 = icmp eq i32 %2, 0
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 (...) @f2()
br label %13
13: ; preds = %9, %11, %5, %7
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52_set_fscod(uint8_t *p_a52, uint8_t i_fscod) {
  p_a52[4] &= ~0xc0;
  p_a52[4] |= (i_fscod & 0x3) << 6;
}


x86 assembly (clang, -O0):
<a52_set_fscod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
and    $0xffffff3f,%ecx
mov    %ecx,0x10(%rax)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0x10(%rax),%ecx
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_set_fscod>:
mov    $0xffffff3f,%eax
and    0x10(%rdi),%eax
shl    $0x6,%esi
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,0x10(%rdi)
ret

LLVM IR (-O0):
define void @a52_set_fscod(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 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %6
%8 = and i32 %7, -193
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 3
%11 = shl i32 %10, 6
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @a52_set_fscod(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = load i32, i32* %3
%5 = and i32 %4, -193
%6 = shl i32 %1, 6
%7 = and i32 %6, 192
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t charToBinASCII(unsigned char base) {
  switch (base) {
  case 'A':
  case 'a':
    return (0);
  case 'C':
  case 'c':
    return (1);
  case 'G':
  case 'g':
    return (2);
  case 'T':
  case 't':
    return (3);
  default:
    return (4);
  }
}


x86 assembly (clang, -O0):
<charToBinASCII>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1164 <charToBinASCII+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <charToBinASCII+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <charToBinASCII+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <charToBinASCII+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <charToBinASCII+0x6b>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToBinASCII>:
add    $0xbf,%dil
cmp    $0x33,%dil
ja     1132 <charToBinASCII+0x32>
xor    %eax,%eax
movzbl %dil,%ecx
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @charToBinASCII(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
]
6: ; preds = %1, %1
store i32 0, i32* %2
br label %11
7: ; preds = %1, %1
store i32 1, i32* %2
br label %11
8: ; preds = %1, %1
store i32 2, i32* %2
br label %11
9: ; preds = %1, %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 4, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @charToBinASCII(i8 zeroext %0) {
switch i8 %0, label %5 [
i8 65, label %6
i8 97, label %6
i8 67, label %2
i8 99, label %2
i8 71, label %3
i8 103, label %3
i8 84, label %4
i8 116, label %4
]
2: ; preds = %1, %1
br label %6
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3, %2
%7 = phi i32 [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %2 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_buf_append_byte(struct cbor_buf *, int);
bool cbor_add_map_start(struct cbor_buf *buf) {
  return cbor_buf_append_byte(buf, 0xbf);
}


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

x86 assembly (clang, -O2):
<cbor_add_map_start>:
mov    $0xbf,%esi
jmp    1030 <cbor_buf_append_byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_map_start(%struct.cbor_buf* %0) {
%2 = alloca %struct.cbor_buf*
store %struct.cbor_buf* %0, %struct.cbor_buf** %2
%3 = load %struct.cbor_buf*, %struct.cbor_buf** %2
%4 = call i32 @cbor_buf_append_byte(%struct.cbor_buf* %3, i32 191)
ret i32 %4
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_map_start(%struct.cbor_buf* %0) {
%2 = tail call i32 @cbor_buf_append_byte(%struct.cbor_buf* %0, i32 191)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ createExample();
int /*<<< orphan*/ fzz_test1();
int /*<<< orphan*/ fzz_test2();
int /*<<< orphan*/ fzz_test3();
int /*<<< orphan*/ gettingOutputExample();
int /*<<< orphan*/ printExample();
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  createExample();
  printExample();
  gettingOutputExample();
  fzz_test1();
  fzz_test2();
  fzz_test3();
  printf("\n");
  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    $0x0,%al
call   1030 <createExample@plt>
mov    $0x0,%al
call   1080 <printExample@plt>
mov    $0x0,%al
call   1070 <gettingOutputExample@plt>
mov    $0x0,%al
call   1050 <fzz_test1@plt>
mov    $0x0,%al
call   1090 <fzz_test2@plt>
mov    $0x0,%al
call   1060 <fzz_test3@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <createExample@plt>
xor    %eax,%eax
call   1080 <printExample@plt>
xor    %eax,%eax
call   1070 <gettingOutputExample@plt>
xor    %eax,%eax
call   1050 <fzz_test1@plt>
xor    %eax,%eax
call   1090 <fzz_test2@plt>
xor    %eax,%eax
call   1060 <fzz_test3@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
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 (...) @createExample()
%7 = call i32 (...) @printExample()
%8 = call i32 (...) @gettingOutputExample()
%9 = call i32 (...) @fzz_test1()
%10 = call i32 (...) @fzz_test2()
%11 = call i32 (...) @fzz_test3()
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @createExample()
%4 = tail call i32 (...) @printExample()
%5 = tail call i32 (...) @gettingOutputExample()
%6 = tail call i32 (...) @fzz_test1()
%7 = tail call i32 (...) @fzz_test2()
%8 = tail call i32 (...) @fzz_test3()
%9 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int end();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  if (end() == 42) {
    exit(0);
  }
  abort();
}


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    $0x0,%al
call   1040 <end@plt>
cmp    $0x2a,%eax
jne    115d <main+0x2d>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <end@plt>
cmp    $0x2a,%eax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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 (...) @end()
%7 = icmp eq i32 %6, 42
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @end()
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ isdigit(char);
int strlen(char *);
void dev_from_part(char *dev_name) {
  int i;
  for (i = strlen(dev_name) - 1; isdigit(dev_name[i]); i--)
    dev_name[i] = 0;
}


x86 assembly (clang, -O0):
<dev_from_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1170 <dev_from_part+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <dev_from_part+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_from_part>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%r14
movsbl -0x1(%r14,%rbx,1),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1165 <dev_from_part+0x45>
add    %r14,%rbx
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
movb   $0x0,(%rbx)
movsbl -0x1(%rbx),%edi
add    $0xffffffffffffffff,%rbx
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1150 <dev_from_part+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @dev_from_part(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i64 @isdigit(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %1, %9
%10 = phi i64 [ %12, %9 ], [ %4, %1 ]
%11 = phi i8* [ %13, %9 ], [ %5, %1 ]
store i8 0, i8* %11
%12 = add i64 %10, -1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = tail call i64 @isdigit(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
u_int32_t Interp4(u_int32_t c1, u_int32_t c2, u_int32_t c3) {
  return Interpolate_3(c1, 2, c2, 7, c3, 7, 4);
}


x86 assembly (clang, -O0):
<Interp4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
mov    $0x2,%esi
mov    $0x7,%r9d
mov    %r9d,%ecx
movl   $0x4,(%rsp)
call   1030 <Interpolate_3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp4>:
push   %rax
mov    %edx,%r8d
mov    %esi,%edx
movl   $0x4,(%rsp)
mov    $0x2,%esi
mov    $0x7,%ecx
mov    $0x7,%r9d
call   1030 <Interpolate_3@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Interp4(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Interpolate_3(i32 %0, i32 2, i32 %1, i32 7, i32 %2, i32 7, i32 4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic4() { panic(5); }


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

x86 assembly (clang, -O2):
<panic4>:
mov    $0x5,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic4() {
%1 = call i32 @panic(i32 5)
ret void
}

LLVM IR (-O2):
define void @panic4() {
%1 = tail call i32 @panic(i32 5)
ret void
}
__attribute__((no)) void func_1(void) {}


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

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

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

LLVM IR (-O2):
define void @func_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ProgressEx(int, int *, int *);
void Progress(int *step, int *percent) { ProgressEx((1), step, percent); }


x86 assembly (clang, -O0):
<Progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <ProgressEx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Progress>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <ProgressEx@plt>

LLVM IR (-O0):
define void @Progress(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 @ProgressEx(i32 1, i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @Progress(i32* %0, i32* %1) {
%3 = tail call i32 @ProgressEx(i32 1, i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int rom_present(char *);
int s3_metheus_86c928_available(void) {
  return rom_present(L"roms/video/s3/928.vbi");
}


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

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

LLVM IR (-O0):
@.str = [22 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 57, i32 50, i32 56, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @s3_metheus_86c928_available() {
%1 = call i32 @rom_present(i8* bitcast ([22 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [22 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 57, i32 50, i32 56, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @s3_metheus_86c928_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([22 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ DisposePtr(char *);
void FreeFile(char *fptr) {
  if (fptr)
    DisposePtr(fptr);
}


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

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

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

LLVM IR (-O2):
define void @FreeFile(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @DisposePtr(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
double sqrt(double);
double EDDsqrt(double x) { return (-.25 / sqrt(x) / x); }


x86 assembly (clang, -O0):
<EDDsqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDDsqrt>:
push   %rax
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1128 <EDDsqrt+0x18>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    113b <EDDsqrt+0x2b>
movapd %xmm2,%xmm0
movsd  %xmm2,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm2
movsd  0xebd(%rip),%xmm1
divsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @EDDsqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double %3)
%5 = fdiv double -2.500000e-01, %4
%6 = load double, double* %2
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @EDDsqrt(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = fdiv double -2.500000e-01, %2
%4 = fdiv double %3, %0
ret double %4
}
/* Type definitions */
typedef int uint32_t;
struct pcg_state_64 {
  int dummy;
};

/* Variables and functions */
int pcg_oneseq_64_xsh_rs_32_random_r(struct pcg_state_64 *);
uint32_t pcg_oneseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_64 *rng,
                                               uint32_t bound) {
  uint32_t threshold = -bound % bound;
  for (;;) {
    uint32_t r = pcg_oneseq_64_xsh_rs_32_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_oneseq_64_xsh_rs_32_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_oneseq_64_xsh_rs_32_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_oneseq_64_xsh_rs_32_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_oneseq_64_xsh_rs_32_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_oneseq_64_xsh_rs_32_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_oneseq_64_xsh_rs_32_random_r@plt>
test   %eax,%eax
js     1120 <pcg_oneseq_64_xsh_rs_32_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_oneseq_64_xsh_rs_32_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_64* %0, %struct.pcg_state_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_64*, %struct.pcg_state_64** %3
%13 = call i32 @pcg_oneseq_64_xsh_rs_32_random_r(%struct.pcg_state_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_oneseq_64_xsh_rs_32_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_oneseq_64_xsh_rs_32_random_r(%struct.pcg_state_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ increment(int *);
int /*<<< orphan*/ show(int *);
int /*<<< orphan*/ vectInit(int *);
int main(void) {
  int V[10];
  int j;
  vectInit(V);
  for (; V[9] < 1;) {
    show(V);
    increment(V);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <vectInit@plt>
cmpl   $0x1,-0xc(%rbp)
jge    1169 <main+0x39>
lea    -0x30(%rbp),%rdi
call   1050 <show@plt>
lea    -0x30(%rbp),%rdi
call   1040 <increment@plt>
jmp    1148 <main+0x18>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rdi
call   1030 <vectInit@plt>
cmpl   $0x0,0x24(%rsp)
jg     1167 <main+0x37>
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <show@plt>
mov    %rbx,%rdi
call   1040 <increment@plt>
cmpl   $0x0,0x24(%rsp)
jle    1150 <main+0x20>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @vectInit(i32* %4)
br label %6
6: ; preds = %10, %0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @show(i32* %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%14 = call i32 @increment(i32* %13)
br label %6
15: ; preds = %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @vectInit(i32* %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %0, %8
%9 = call i32 @show(i32* %3)
%10 = call i32 @increment(i32* %3)
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 1
br i1 %12, label %8, label %13
13: ; preds = %8, %0
ret i32 0
}