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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_header(FILE *fd) { fprintf(fd, "Created with vrbc utils\n"); }


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

x86 assembly (clang, -O2):
<write_header>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Created with vrbc utils\0A\00"
define void @write_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Created with vrbc utils\0A\00"
define void @write_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 24, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int do_test();
int main(int argc, char *argv[]) { return do_test(); }


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 <do_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <do_test@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 (...) @do_test()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_test()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_ada_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("ada", " --comment"),
                            "comment", "--comment");
}


x86 assembly (clang, -O0):
<test_ada_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec7(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ada_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecc(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ada\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"--comment\00"
define void @test_ada_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 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_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ada\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"--comment\00"
define void @test_ada_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 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_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timeb {
  scalar_t__ millitm;
  scalar_t__ time;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
double wtime() {
  struct timeb T;
  static time_t time_diff;
  static time_t mill_diff;
  double dt;
  (void)ftime(&T);
  time_diff = T.time;
  mill_diff = T.millitm;
  dt = ((double)time_diff) + (1e-3) * ((double)mill_diff);
  return dt;
}


x86 assembly (clang, -O0):
<wtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <ftime@plt>
mov    -0x8(%rbp),%rax
mov    %rax,0x2f04(%rip)
mov    -0x10(%rbp),%rax
mov    %rax,0x2f01(%rip)
cvtsi2sdq 0x2ef0(%rip),%xmm1
cvtsi2sdq 0x2eef(%rip),%xmm0
movsd  0xeaf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <ftime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeb = type { i64, i64 }
@wtime.time_diff = internal global i64 0
@wtime.mill_diff = internal global i64 0
define double @wtime() {
%1 = alloca %struct.timeb
%2 = alloca double
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%5 = load i64, i64* %4
store i64 %5, i64* @wtime.time_diff
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* @wtime.mill_diff
%8 = load i64, i64* @wtime.time_diff
%9 = sitofp i64 %8 to double
%10 = load i64, i64* @wtime.mill_diff
%11 = sitofp i64 %10 to double
%12 = call double @llvm.fmuladd.f64(double 1.000000e-03, double %11, double %9)
store double %12, double* %2
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
%struct.timeb = type { i64, i64 }
define double @wtime() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %5 to double
%9 = sitofp i64 %7 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-03, double %8)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char, int);
int /*<<< orphan*/ ft_putnb1(long long, int);
void ft_putnbr_fd(int n, int fd) {
  long long num;
  num = n;
  if (n < 0) {
    ft_putchar_fd('-', fd);
    num *= -1;
  }
  ft_putnb1(num, fd);
}


x86 assembly (clang, -O0):
<ft_putnbr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1156 <ft_putnbr_fd+0x36>
mov    -0x8(%rbp),%esi
mov    $0x2d,%edi
call   1030 <ft_putchar_fd@plt>
imul   $0xffffffffffffffff,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <ft_putnb1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movslq %edi,%rbx
test   %ebx,%ebx
jns    113b <ft_putnbr_fd+0x1b>
mov    $0x2d,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
neg    %rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_putnb1@plt>

LLVM IR (-O0):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
store i64 %7, i64* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @ft_putchar_fd(i8 signext 45, i32 %11)
%13 = load i64, i64* %5
%14 = mul nsw i64 %13, -1
store i64 %14, i64* %5
br label %15
15: ; preds = %10, %2
%16 = load i64, i64* %5
%17 = load i32, i32* %4
%18 = call i32 @ft_putnb1(i64 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @ft_putchar_fd(i8 signext 45, i32 %1)
%7 = sub nsw i64 0, %3
br label %8
8: ; preds = %5, %2
%9 = phi i64 [ %7, %5 ], [ %3, %2 ]
%10 = tail call i32 @ft_putnb1(i64 %9, i32 %1)
ret void
}
/* Type definitions */
struct ndm_ptrvec_t {
  int dummy;
};

/* Variables and functions */
int ndm_ptrvec_insert(struct ndm_ptrvec_t *, int /*<<< orphan*/, void *);
bool ndm_ptrvec_push_front(struct ndm_ptrvec_t *v, void *p) {
  return ndm_ptrvec_insert(v, 0, p);
}


x86 assembly (clang, -O0):
<ndm_ptrvec_push_front>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <ndm_ptrvec_insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_ptrvec_push_front>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <ndm_ptrvec_insert@plt>

LLVM IR (-O0):
%struct.ndm_ptrvec_t = type { i32 }
define i32 @ndm_ptrvec_push_front(%struct.ndm_ptrvec_t* %0, i8* %1) {
%3 = alloca %struct.ndm_ptrvec_t*
%4 = alloca i8*
store %struct.ndm_ptrvec_t* %0, %struct.ndm_ptrvec_t** %3
store i8* %1, i8** %4
%5 = load %struct.ndm_ptrvec_t*, %struct.ndm_ptrvec_t** %3
%6 = load i8*, i8** %4
%7 = call i32 @ndm_ptrvec_insert(%struct.ndm_ptrvec_t* %5, i32 0, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ndm_ptrvec_t = type { i32 }
define i32 @ndm_ptrvec_push_front(%struct.ndm_ptrvec_t* %0, i8* %1) {
%3 = tail call i32 @ndm_ptrvec_insert(%struct.ndm_ptrvec_t* %0, i32 0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECELF(const char *the_title) { return any_decrqss(the_title, "+q"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"+q\00"
define i32 @rpt_DECELF(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
unsigned int __crc32d(unsigned int, unsigned int);
unsigned int test__crc32d(unsigned int CRC, unsigned int V) {
  return __crc32d(CRC, V);
}


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

x86 assembly (clang, -O2):
<test__crc32d>:
jmp    1030 <__crc32d@plt>

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

LLVM IR (-O2):
define i32 @test__crc32d(i32 %0, i32 %1) {
%3 = tail call i32 @__crc32d(i32 %0, i32 %1)
ret i32 %3
}
unsigned char give_char(unsigned char c) {
  if (c >= ' ' && c < 0x7f)
    return (c);
  else
    return ('.');
}


x86 assembly (clang, -O0):
<give_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     112f <give_char+0x2f>
movzbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jge    112f <give_char+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1133 <give_char+0x33>
movb   $0x2e,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<give_char>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%al
mov    $0x2e,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @give_char(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 127
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %14
13: ; preds = %7, %1
store i8 46, i8* %2
br label %14
14: ; preds = %13, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @give_char(i8 zeroext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = select i1 %3, i8 %0, i8 46
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memmove(int *, int *, int);
int main() {
  int abc[] = {0, 1, 2};
  int *copy1, copy2[3];
  copy1 = abc;
  memmove(copy2, abc, sizeof(int) * 3);
  abc[0] = 3;
  assert(copy1[0] == 3);
  assert(copy2[0] == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x24(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0xc,%edx
call   1040 <memmove@plt>
movl   $0x3,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x3,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1040 <memmove@plt>
movl   $0x3,(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,0xc(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.abc = [3 x i32] [i32 0, i32 1, i32 2]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %5, i32** %2
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = call i32 @memmove(i32* %6, i32* %7, i32 12)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32 3, i32* %9
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret i32 0
}

LLVM IR (-O2):
@__const.main.abc = [3 x i32] [i32 0, i32 1, i32 2]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @memmove(i32* %6, i32* %5, i32 12)
store i32 3, i32* %5
%8 = call i32 @assert(i32 1)
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void remove_pid_file(char *pidFile) {
  if (pidFile == NULL)
    return;
  unlink(pidFile);
}


x86 assembly (clang, -O0):
<remove_pid_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <remove_pid_file+0x1c>
jmp    1135 <remove_pid_file+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @remove_pid_file(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @unlink(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
void switch_stack(unsigned long stack, void (*func)()) {
  asm volatile("mov %[stack], %%rsp   \n\t"
               "jmp *%[func]          \n\t"
               :
               : [stack] "r"(stack), [func] "r"(func), "d"(0)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<switch_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
mov    %rax,%rsp
jmp    *%rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_stack>:
xor    %edx,%edx
mov    %rdi,%rsp
jmp    *%rsi
ret

LLVM IR (-O0):
define void @switch_stack(i64 %0, void (...)* %1) {
%3 = alloca i64
%4 = alloca void (...)*
store i64 %0, i64* %3
store void (...)* %1, void (...)** %4
%5 = load i64, i64* %3
%6 = load void (...)*, void (...)** %4
ret void
}

LLVM IR (-O2):
define void @switch_stack(i64 %0, void (...)* %1) {
tail call void asm sideeffect "mov $0, %rsp \0A\09jmp *$1 \0A\09", "r,r,{dx},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %0, void (...)* %1, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char *get_lame_version();
char *get_psy_version();
void lame_print_version(FILE *ofile) {
  fprintf(ofile, "LAME version %s (www.sulaco.org/mp3) \n", get_lame_version());
  fprintf(ofile,
          "GPSYCHO: GPL psycho-acoustic and noise shaping model version %s. \n",
          get_psy_version());
}


x86 assembly (clang, -O0):
<lame_print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <get_lame_version@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_psy_version@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lame_print_version>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <get_lame_version@plt>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <get_psy_version@plt>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"LAME version %s (www.sulaco.org/mp3) \0A\00"
@.str.1 = [67 x i8] c"GPSYCHO: GPL psycho-acoustic and noise shaping model version %s. \0A\00"
define void @lame_print_version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i8* (...) @get_lame_version()
%5 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32*, i32** %2
%7 = call i8* (...) @get_psy_version()
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"LAME version %s (www.sulaco.org/mp3) \0A\00"
@.str.1 = [67 x i8] c"GPSYCHO: GPL psycho-acoustic and noise shaping model version %s. \0A\00"
define void @lame_print_version(i32* nocapture %0) {
%2 = tail call i8* (...) @get_lame_version()
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i8* (...) @get_psy_version()
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main(void) {
  for (;;) {
    wait(NULL);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <wait@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @wait(i32* null)
%4 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @wait(i32* null)
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int fabs(double);
int /*<<< orphan*/ fmod(double, int);
double sin(int /*<<< orphan*/);
double sinc(double x) {
  return (fabs(x) < 1E-50 ? 1.0 : sin(fmod(x, 2 * 3.1415926535)) / x);
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xead(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    116f <sinc+0x3f>
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    118f <sinc+0x5f>
movsd  -0x8(%rbp),%xmm0
mov    $0x6,%edi
call   1030 <fmod@plt>
mov    %eax,%edi
call   1050 <sin@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
test   %eax,%eax
jle    115c <sinc+0x2c>
movsd  (%rsp),%xmm0
mov    $0x6,%edi
call   1030 <fmod@plt>
mov    %eax,%edi
call   1050 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xe9c(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fabs(double %3)
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 1.000000e-50
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load double, double* %2
%10 = call i32 @fmod(double %9, i32 6)
%11 = call double @sin(i32 %10)
%12 = load double, double* %2
%13 = fdiv double %11, %12
br label %14
14: ; preds = %8, %7
%15 = phi double [ 1.000000e+00, %7 ], [ %13, %8 ]
ret double %15
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @fmod(double %0, i32 6)
%6 = tail call double @sin(i32 %5)
%7 = fdiv double %6, %0
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 1.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
int checkaltloc();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int answer;
  answer = checkaltloc();
  printf("%d\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <checkaltloc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @checkaltloc()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "usage: %s <ttyS>\n", name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <ttyS>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <ttyS>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ meta_accept_payment(int *, int *, int /*<<< orphan*/,
                                       char *);
int *safe_malloc(int);
void accept_payment_exact_change_returns_0(int stats[3]) {
  int *cb;
  cb = safe_malloc(sizeof(*cb) * 8);
  meta_accept_payment(stats, cb, 0,
                      "  -Exact change (enter 5 at the prompt)...");
  free(cb);
}


x86 assembly (clang, -O0):
<accept_payment_exact_change_returns_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
call   1040 <safe_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
lea    0xea5(%rip),%rcx
call   1050 <meta_accept_payment@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_payment_exact_change_returns_0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x20,%edi
call   1040 <safe_malloc@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rcx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1050 <meta_accept_payment@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [43 x i8] c" -Exact change (enter 5 at the prompt)...\00"
define void @accept_payment_exact_change_returns_0(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i32* @safe_malloc(i32 32)
store i32* %4, i32** %3
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = call i32 @meta_accept_payment(i32* %5, i32* %6, i32 0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @free(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c" -Exact change (enter 5 at the prompt)...\00"
define void @accept_payment_exact_change_returns_0(i32* %0) {
%2 = tail call i32* @safe_malloc(i32 32)
%3 = tail call i32 @meta_accept_payment(i32* %0, i32* %2, i32 0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int UARTBaseValid(unsigned long);
void UARTClockSourceSet(unsigned long ulBase, unsigned long ulSource) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  DEBUG_ASSERT((ulSource == 0x00000000) || (ulSource == 0x00000005));
  (*((volatile unsigned long *)(ulBase + 0x00000FC8))) = ulSource;
}


x86 assembly (clang, -O0):
<UARTClockSourceSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     115b <UARTClockSourceSet+0x3b>
cmpq   $0x5,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xfc8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTClockSourceSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
test   %rbx,%rbx
sete   %al
cmp    $0x5,%rbx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,0xfc8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @UARTClockSourceSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @UARTBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, 5
br label %13
13: ; preds = %10, %2
%14 = phi i1 [ true, %2 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @DEBUG_ASSERT(i32 %15)
%17 = load i64, i64* %4
%18 = load i64, i64* %3
%19 = add i64 %18, 4040
%20 = inttoptr i64 %19 to i64*
store volatile i64 %17, i64* %20
ret void
}

LLVM IR (-O2):
define void @UARTClockSourceSet(i64 %0, i64 %1) {
%3 = tail call i32 @UARTBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = icmp eq i64 %1, 0
%6 = icmp eq i64 %1, 5
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = add i64 %0, 4040
%11 = inttoptr i64 %10 to i64*
store volatile i64 %1, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, sq, cb;
  scanf("%d", &a);
  sq = a * a;
  cb = a * a * a;
  printf("\n %d", sq);
  printf("\n %d", cb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
long long zsuz() { return 0x0000ffff7fff0000LL; }


x86 assembly (clang, -O0):
<zsuz>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zsuz>:
movabs $0xffff7fff0000,%rax
ret

LLVM IR (-O0):
define i64 @zsuz() {
ret i64 281472829161472
}

LLVM IR (-O2):
define i64 @zsuz() {
ret i64 281472829161472
}
/* Type definitions */
typedef int pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pthread_self();
int /*<<< orphan*/ sleep(int);
void *worker_thread() {
  pthread_t ppid = pthread_self();
  while (1) {
    printf("i am thread %d\n", ppid);
    sleep(10);
  }
}


x86 assembly (clang, -O0):
<worker_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
jmp    1142 <worker_thread+0x12>

x86 assembly (clang, -O2):
<worker_thread>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%ebx
lea    0xebc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
jmp    1150 <worker_thread+0x20>

LLVM IR (-O0):
@.str = [16 x i8] c"i am thread %d\0A\00"
define i8* @worker_thread() {
%1 = alloca i32
%2 = call i32 (...) @pthread_self()
store i32 %2, i32* %1
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sleep(i32 10)
br label %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"i am thread %d\0A\00"
define noalias i8* @worker_thread() {
%1 = tail call i32 (...) @pthread_self()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @sleep(i32 10)
br label %2
}
void test36() {
  void **pc;
  void *dummy[] = {&&L1, &&L2};
L1:
  goto *pc;
L2:
  goto *pc;
}


x86 assembly (clang, -O0):
<test36>:
push   %rbp
mov    %rsp,%rbp
mov    0x2d35(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2d32(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    112f <test36+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<test36>:
jmp    1100 <test36>

LLVM IR (-O0):
@__const.test36.dummy = [2 x i8*] [i8* blockaddress(@test36, %4), i8* blockaddress(@test36, %7)]
define void @test36() {
%1 = alloca i8**
%2 = alloca [2 x i8*]
%3 = bitcast [2 x i8*]* %2 to i8*
br label %4
4: ; preds = %0, %10
%5 = load i8**, i8*** %1
%6 = bitcast i8** %5 to i8*
br label %10
7: ; preds = %10
%8 = load i8**, i8*** %1
%9 = bitcast i8** %8 to i8*
br label %10
10: ; preds = %7, %4
%11 = phi i8* [ %6, %4 ], [ %9, %7 ]
indirectbr i8* %11, [label %4, label %7]
}

LLVM IR (-O2):
define void @test36() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *str) {
  if (str) {
    fprintf(stderr, "Error: %s\n", str);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <error+0x3e>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
test   %rdi,%rdi
jne    1126 <error+0x6>
ret
push   %rax
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(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 %11
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test1(void *nil) { printf("every 1 s.\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"every 1 s.\0A\00"
define void @test1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"every 1 s.\00"
define void @test1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int x, y, N;
  int *a;
  x = 1;
  N = __VERIFIER_nondet_int();
  while (x <= N) {
    y = N - x;
    if (y < 0 || y >= N)
      __VERIFIER_assert(0 == 1);
    a[y] = -1;
    x++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     118f <main+0x6f>
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     116b <main+0x4b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1172 <main+0x52>
xor    %edi,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 1
tail call void @llvm.assume(i1 %2)
ret i32 1
}
int test1_i(int *x) { return *x; }


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

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

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

LLVM IR (-O2):
define i32 @test1_i(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int reverseBits(unsigned int);
int main() {
  unsigned int x = 2;
  printf("%u", reverseBits(x));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <reverseBits@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1050 <reverseBits@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = tail call i32 @reverseBits(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func1(int);
int main() {
  func1(10);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func1(i32 10)
ret i32 0
}
XSetZoomHints() {}


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

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

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

LLVM IR (-O2):
define i32 @XSetZoomHints() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f25(unsigned int x, unsigned int y) {
  unsigned int r = x + y;
  if (r > x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    113a <f25+0x2a>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f25>:
push   %rbx
mov    %esi,%ebx
add    %edi,%ebx
cmp    %edi,%ebx
jbe    1120 <f25+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f25(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 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp ugt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @f25(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ugt i32 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int addInt(int n, int m) { return n + m; }


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

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

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

LLVM IR (-O2):
define i32 @addInt(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void lt_dladdsearchdir(void) {}


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

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

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

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