xunge/DecIR huggingface dataset:
/* Variables and functions */
double ln_get_neptune_earth_dist(double);
double ln_get_neptune_sdiam(double JD) {
  double So = 33.50;
  double dist;
  dist = ln_get_neptune_earth_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_neptune_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_neptune_earth_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_neptune_sdiam>:
push   %rax
call   1030 <ln_get_neptune_earth_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_neptune_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 3.350000e+01, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_neptune_earth_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_neptune_sdiam(double %0) {
%2 = tail call double @ln_get_neptune_earth_dist(double %0)
%3 = fdiv double 3.350000e+01, %2
ret double %3
}
int sys_mkdir(int fd, const char *path, int perms) {}


x86 assembly (clang, -O0):
<sys_mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sys_mkdir(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ r_strcpy(char *, char const *);
size_t r_strlen(char const *);
scalar_t__ r_zmalloc(size_t);
char *r_strdup(const char *s) {
  size_t size = r_strlen(s);
  char *dupstr = (char *)r_zmalloc(size + 1);
  if (dupstr) {
    r_strcpy(dupstr, s);
  }
  return dupstr;
}


x86 assembly (clang, -O0):
<r_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <r_strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <r_zmalloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <r_strdup+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <r_strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <r_strlen@plt>
lea    0x1(%rax),%rdi
call   1040 <r_zmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <r_strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <r_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @r_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @r_strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i64 @r_zmalloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @r_strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %1
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @r_strdup(i8* %0) {
%2 = tail call i64 @r_strlen(i8* %0)
%3 = add i64 %2, 1
%4 = tail call i64 @r_zmalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @r_strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
int main(void) {
  struct s *a;
  struct s (*b)();
  typedef struct s s;
  union u *c;
  union u (*d)();
  typedef union u u;
  struct s {
    int x;
  };
  union u {
    int x;
  };
  return 0;
}


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

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

LLVM IR (-O0):
%struct.s = type { i32 }
%union.u = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.s*
%3 = alloca i32 (...)*
%4 = alloca %union.u*
%5 = alloca i32 (...)*
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
%struct.s = type { i32 }
%union.u = type { i32 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: xtcidu [-B badchars] [-F font] [-b bg] [-f fg] [-n]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: xtcidu [-B badchars] [-F font] [-b bg] [-f fg] [-n]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [60 x i8] c"Usage: xtcidu [-B badchars] [-F font] [-b bg] [-f fg] [-n]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct slName {
  int dummy;
};

/* Variables and functions */
struct slName *charSepToSlNames(char *, char);
struct slName *commaSepToSlNames(char *commaSep) {
  return charSepToSlNames(commaSep, ',');
}


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

x86 assembly (clang, -O2):
<commaSepToSlNames>:
mov    $0x2c,%esi
jmp    1030 <charSepToSlNames@plt>

LLVM IR (-O0):
%struct.slName = type { i32 }
define %struct.slName* @commaSepToSlNames(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.slName* @charSepToSlNames(i8* %3, i8 signext 44)
ret %struct.slName* %4
}

LLVM IR (-O2):
%struct.slName = type { i32 }
define %struct.slName* @commaSepToSlNames(i8* %0) {
%2 = tail call %struct.slName* @charSepToSlNames(i8* %0, i8 signext 44)
ret %struct.slName* %2
}
int occampi_oper_post_setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @occampi_oper_post_setup() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int close(int);
int /*<<< orphan*/ perror(char *);
void disconnect(int socket) {
  if (close(socket) == -1) {
    perror("close");
    abort();
  }
}


x86 assembly (clang, -O0):
<disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0xffffffff,%eax
jne    115f <disconnect+0x2f>
lea    0xead(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconnect>:
push   %rax
call   1040 <close@plt>
cmp    $0xffffffff,%eax
je     113d <disconnect+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"close\00"
define void @disconnect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define void @disconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_bfpp_comment() {
  test_parser_verify_parse(test_parser_sourcefile("bfpp", " = comment"), "bfpp",
                           "", "= comment", 0);
}


x86 assembly (clang, -O0):
<test_bfpp_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bfpp_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"bfpp\00"
@.str.1 = [11 x i8] c" = comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"= comment\00"
define void @test_bfpp_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"bfpp\00"
@.str.1 = [11 x i8] c" = comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"= comment\00"
define void @test_bfpp_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void cpu_dump(char *msg) {}


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

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

LLVM IR (-O0):
define void @cpu_dump(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @cpu_dump(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timespec {
  unsigned long long tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t time64_now() {
  struct timespec now;
  clock_gettime(CLOCK_REALTIME, &now);
  return (now.tv_sec * 1000000ull) + (now.tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<time64_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time64_now>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @time64_now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @time64_now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
%12 = add i64 %7, %11
ret i64 %12
}
float fromRep(unsigned x) {
  const union {
    float f;
    unsigned i;
  } rep = {.i = x};
  return rep.f;
}


x86 assembly (clang, -O0):
<fromRep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromRep>:
movd   %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @fromRep(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf(" How are you doing?");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [20 x i8] c" How are you doing?\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c" How are you doing?\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output_decimal(int);
int /*<<< orphan*/ output_label_prefix();
void print_label(int label) {
  output_label_prefix();
  output_decimal(label);
}


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

x86 assembly (clang, -O2):
<print_label>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <output_label_prefix@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <output_decimal@plt>

LLVM IR (-O0):
define void @print_label(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @output_label_prefix()
%4 = load i32, i32* %2
%5 = call i32 @output_decimal(i32 %4)
ret void
}

LLVM IR (-O2):
define void @print_label(i32 %0) {
%2 = tail call i32 (...) @output_label_prefix()
%3 = tail call i32 @output_decimal(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int SIGTSTP;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exit_handler(int signo) {
  if (signo == SIGTSTP)
    exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113b <exit_handler+0x2b>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
je     111e <exit_handler+0xe>
pop    %rax
ret
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@SIGTSTP = global i32 0
@EXIT_SUCCESS = global i32 0
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTSTP
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGTSTP = global i32 0
@EXIT_SUCCESS = global i32 0
define void @exit_handler(i32 %0) {
%2 = load i32, i32* @SIGTSTP
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
float num_clamp(float a, float min, float max) {
  return a < min ? min : (a > max ? max : a);
}


x86 assembly (clang, -O0):
<num_clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <num_clamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <num_clamp+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <num_clamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <num_clamp+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_clamp>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @num_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @num_clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
void trocaMinimo(int *v, int pos) {
  int min;
  int aux = v[min];
  v[min] = v[pos];
  v[pos] = aux;
}


x86 assembly (clang, -O0):
<trocaMinimo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trocaMinimo>:
mov    (%rdi),%eax
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%edx
mov    %edx,(%rdi)
mov    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @trocaMinimo(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 %16, i32* %20
%21 = load i32, i32* %6
%22 = load i32*, i32** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
store i32 %21, i32* %25
ret void
}

LLVM IR (-O2):
define void @trocaMinimo(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
store i32 %6, i32* %0
store i32 %3, i32* %5
ret void
}
/* Variables and functions */
int rand();
int rand_int_between(int low, int hi) { return rand() % (hi - low + 1) + low; }


x86 assembly (clang, -O0):
<rand_int_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_int_between(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_int_between(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
char *strcpy(char *dst, const char *src) {
  size_t i;
  for (i = 0; src[i] != '\0'; i++) {
    dst[i] = src[i];
  }
  dst[i] = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <strcpy+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putnbr(int nbr) {
  char c;
  if (nbr >= 10) {
    ft_putnbr(nbr / 10);
    ft_putnbr(nbr % 10);
  } else {
    c = nbr + '0';
    write(1, &c, 1);
  }
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     115e <ft_putnbr+0x3e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <ft_putnbr@plt>
jmp    1177 <ft_putnbr+0x57>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
cmp    $0xa,%edi
jl     1154 <ft_putnbr+0x34>
mov    %ebp,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1040 <ft_putnbr@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_putnbr@plt>
add    $0x30,%bpl
mov    %bpl,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
br label %16
11: ; preds = %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 48
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = call i32 @write(i32 1, i8* %3, i32 1)
br label %16
16: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = alloca i8
%3 = icmp sgt i32 %0, 9
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = udiv i32 %0, 10
tail call void @ft_putnbr(i32 %5)
%6 = urem i32 %0, 10
tail call void @ft_putnbr(i32 %6)
br label %11
7: ; preds = %1
%8 = trunc i32 %0 to i8
%9 = add i8 %8, 48
store i8 %9, i8* %2
%10 = call i32 @write(i32 1, i8* %2, i32 1)
br label %11
11: ; preds = %7, %4
ret void
}
void call_frame_dummy() { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ vsprintf(char *, char const *, int /*<<< orphan*/);
void build_message(char log_message[], const char *fmt, va_list ap) {
  vsprintf(log_message, fmt, ap);
}


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

x86 assembly (clang, -O2):
<build_message>:
jmp    1030 <vsprintf@plt>

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

LLVM IR (-O2):
define void @build_message(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsprintf(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_fne(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_fne");
  exit(-1);
}


x86 assembly (clang, -O0):
<_Q_fne>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [7 x i8] c"_Q_fne\00"
define void @_Q_fne() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [7 x i8] c"_Q_fne\00"
define void @_Q_fne() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
int minus(int a, int b) {
  int result = a - b;
  return result;
}


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

x86 assembly (clang, -O2):
<minus>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @minus(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int ftemp = 27;
  printf("Celsius temp is: %.2f\n", (ftemp - 32) / 1.8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Celsius temp is: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 27, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.800000e+00
%7 = fptosi double %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Celsius temp is: %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 -2)
ret i32 0
}
void XUngrabServer() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *afio_get_MAPR() { return mem_get_reg32(0x40010000 + 0x04); }


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

x86 assembly (clang, -O2):
<afio_get_MAPR>:
mov    $0x40010004,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @afio_get_MAPR() {
%1 = call i32* @mem_get_reg32(i32 1073807364)
ret i32* %1
}

LLVM IR (-O2):
define i32* @afio_get_MAPR() {
%1 = tail call i32* @mem_get_reg32(i32 1073807364)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX0(int);
int /*<<< orphan*/ ROR16(int /*<<< orphan*/, int);
void Op7EM0X0(void) { ROR16(AbsoluteIndexedXX0(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op7EM0X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1030 <ROR16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op7EM0X0>:
push   %rax
mov    $0x3,%edi
call   1040 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1030 <ROR16@plt>

LLVM IR (-O0):
define void @Op7EM0X0() {
%1 = call i32 @AbsoluteIndexedXX0(i32 3)
%2 = call i32 @ROR16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op7EM0X0() {
%1 = tail call i32 @AbsoluteIndexedXX0(i32 3)
%2 = tail call i32 @ROR16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x76() {
  Assert_real((isascii(118)),
              "/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_isascii.c",
              595, ("isascii should be 1 for v"));
}


x86 assembly (clang, -O0):
<t_isascii_0x76>:
push   %rbp
mov    %rsp,%rbp
mov    $0x76,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x253,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x76>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x253,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for v\00"
define void @t_isascii_0x76() {
%1 = call i32 @isascii(i32 118)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for v\00"
define void @t_isascii_0x76() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mandelbrot(int, int);
int main(void) {
  mandelbrot(84, 25);
  mandelbrot(100, 100);
  mandelbrot(256, 25);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x54,%edi
mov    $0x19,%esi
call   1030 <mandelbrot@plt>
mov    $0x64,%esi
mov    %esi,%edi
call   1030 <mandelbrot@plt>
mov    $0x100,%edi
mov    $0x19,%esi
call   1030 <mandelbrot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x54,%edi
mov    $0x19,%esi
call   1030 <mandelbrot@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   1030 <mandelbrot@plt>
mov    $0x100,%edi
mov    $0x19,%esi
call   1030 <mandelbrot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mandelbrot(i32 84, i32 25)
%3 = call i32 @mandelbrot(i32 100, i32 100)
%4 = call i32 @mandelbrot(i32 256, i32 25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mandelbrot(i32 84, i32 25)
%2 = tail call i32 @mandelbrot(i32 100, i32 100)
%3 = tail call i32 @mandelbrot(i32 256, i32 25)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ temp;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
void append(char *str, int val) {
  char temp[8];
  if ('\0' != str[0]) {
    strcat(str, ",");
  }
  snprintf(temp, sizeof(temp) - 1, "%d", val);
  strcat(str, temp);
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1150 <append+0x30>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcat@plt>
lea    -0x14(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x7,%esi
lea    0xe9f(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1141 <append+0x21>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xeba(%rip),%rdx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x7,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
@.str.1 = [3 x i8] c"%d\00"
define void @append(i8* %0, i32 %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = call i32 @snprintf(i8* %4, i32 7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%11 = call i32 @strcat(i8* %0, i8* %4)
ret void
}
float mph2kmph(float mph) { return mph * 1.609344; }


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

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

LLVM IR (-O0):
define float @mph2kmph(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3FF9BFDF7E8038A0
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @mph2kmph(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3FF9BFDF7E8038A0
%4 = fptrunc double %3 to float
ret float %4
}
void first(char *status, int *counter, char pref) {
  if (*status == 'U') {
    if (pref == 'D')
      *counter += 2;
  } else {
    *counter += 1;
  }
  *status = 'U';
}


x86 assembly (clang, -O0):
<first>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x55,%eax
jne    113e <first+0x3e>
movsbl -0x11(%rbp),%eax
cmp    $0x44,%eax
jne    1139 <first+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
jmp    1149 <first+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x55,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<first>:
mov    $0x1,%eax
cmpb   $0x55,(%rdi)
jne    1114 <first+0x14>
mov    $0x2,%eax
cmp    $0x44,%dl
jne    1116 <first+0x16>
add    %eax,(%rsi)
movb   $0x55,(%rdi)
ret

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

LLVM IR (-O2):
define void @first(i8* nocapture %0, i32* nocapture %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 85
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = icmp eq i8 %2, 68
br i1 %7, label %8, label %12
8: ; preds = %3, %6
%9 = phi i32 [ 2, %6 ], [ 1, %3 ]
%10 = load i32, i32* %1
%11 = add nsw i32 %10, %9
store i32 %11, i32* %1
br label %12
12: ; preds = %8, %6
store i8 85, i8* %0
ret void
}
int pr43638(int *a) {
  a = __builtin_assume_aligned(a, 1073741824);
  return a[0];
}


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

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

LLVM IR (-O0):
define i32 @pr43638(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @pr43638(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i32, i32* %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ack(char *);
scalar_t__ chdir(char *);
int /*<<< orphan*/ perror_reply(int, char *);
void cwd(char *path) {
  if (chdir(path) < 0)
    perror_reply(550, path);
  else
    ack("CWD");
}


x86 assembly (clang, -O0):
<cwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <chdir@plt>
cmp    $0x0,%rax
jge    1162 <cwd+0x32>
mov    -0x8(%rbp),%rsi
mov    $0x226,%edi
call   1050 <perror_reply@plt>
jmp    116e <cwd+0x3e>
lea    0xe97(%rip),%rdi
call   1030 <ack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwd>:
push   %rbx
mov    %rdi,%rbx
call   1040 <chdir@plt>
test   %rax,%rax
js     114b <cwd+0x1b>
lea    0xebb(%rip),%rdi
pop    %rbx
jmp    1030 <ack@plt>
mov    $0x226,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <perror_reply@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"CWD\00"
define void @cwd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @chdir(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @perror_reply(i32 550, i8* %7)
br label %11
9: ; preds = %1
%10 = call i32 @ack(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"CWD\00"
define void @cwd(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror_reply(i32 550, i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @ack(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}
void of_gpiochip_remove(struct gpio_chip *gc) {}


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

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

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

LLVM IR (-O2):
%struct.gpio_chip = type opaque
define void @of_gpiochip_remove(%struct.gpio_chip* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putstr_fd(char const *s, int fd) {
  if (s != NULL)
    write(fd, s, ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115f <ft_putstr_fd+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
test   %rdi,%rdi
je     1144 <ft_putstr_fd+0x24>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @ft_strlen(i8* %0)
%6 = tail call i32 @write(i32 %1, i8* %0, i32 %5)
br label %7
7: ; preds = %4, %2
ret void
}