xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x14() {
  Assert_real((isspace(20) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              105, ("isspace should be 0 for 0x14"));
}


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

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

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

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


x86 assembly (clang, -O0):
<signedlonglong_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_unsignedchar(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_unsignedchar(i64 returned %0, i8 zeroext %1) {
ret i64 %0
}
/* Variables and functions */
scalar_t__ call_prom(char *, int /*<<< orphan*/, int);
int get_ms() { return (int)call_prom("milliseconds", 0, 1); }


x86 assembly (clang, -O0):
<get_ms>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <call_prom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ms>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <call_prom@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"milliseconds\00"
define i32 @get_ms() {
%1 = call i64 @call_prom(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
@.str = [13 x i8] c"milliseconds\00"
define i32 @get_ms() {
%1 = tail call i64 @call_prom(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = trunc i64 %1 to i32
ret i32 %2
}
int arch_irqs_disabled_flags(unsigned long flags) { return (flags & 1) == 0; }


x86 assembly (clang, -O0):
<arch_irqs_disabled_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_irqs_disabled_flags>:
mov    %rdi,%rax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @arch_irqs_disabled_flags(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @arch_irqs_disabled_flags(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
indreg0indreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*p0) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
mov    -0x20(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1141 <indreg0indreg1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <indreg0indreg1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0indreg1>:
movzwl (%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%cx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = icmp sle i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Olá mundo"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Ol\C3\A1 mundo\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Ol\C3\A1 mundo\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ argv;

/* Variables and functions */
int exist(char **, int, int, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", exist(argv + 2, argc - 2, sizeof(argv[2]), argv[1]));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    $0x8,%edx
call   1030 <exist@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    -0x2(%rdi),%eax
mov    0x8(%rsi),%rcx
lea    0x10(%rsi),%rdi
mov    %eax,%esi
mov    $0x8,%edx
call   1030 <exist@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 2
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @exist(i8** %7, i32 %9, i32 8, i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = add nsw i32 %0, -2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @exist(i8** %3, i32 %4, i32 8, i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int RTP_get_version(unsigned char *p) { return ((unsigned int)p[0]) >> 6; }


x86 assembly (clang, -O0):
<RTP_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shr    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_get_version>:
movzbl (%rdi),%eax
shr    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @RTP_get_version(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = lshr i8 %2, 6
%4 = zext i8 %3 to i32
ret i32 %4
}
int fail_on_purpose(int msg_len, const char *msg) { return 1; }


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

x86 assembly (clang, -O2):
<fail_on_purpose>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fail_on_purpose(i32 %0, i8* nocapture readnone %1) {
ret i32 1
}
int do_844() { return 844; }


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

x86 assembly (clang, -O2):
<do_844>:
mov    $0x34c,%eax
ret

LLVM IR (-O0):
define i32 @do_844() {
ret i32 844
}

LLVM IR (-O2):
define i32 @do_844() {
ret i32 844
}
int op_mod(int a, int b) { return a % b; }


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

x86 assembly (clang, -O2):
<op_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @op_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int thirdBits(void) {
  int mask = 0x49;
  int ret = 0x49;
  ret = ret << 9;
  ret = ret | mask;
  ret = ret << 9;
  ret = ret | mask;
  ret = ret << 6;
  ret = ret | 0x09;
  return ret;
}


x86 assembly (clang, -O0):
<thirdBits>:
push   %rbp
mov    %rsp,%rbp
movl   $0x49,-0x4(%rbp)
movl   $0x49,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x9,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x9,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x9,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<thirdBits>:
mov    $0x49249249,%eax
ret

LLVM IR (-O0):
define i32 @thirdBits() {
%1 = alloca i32
%2 = alloca i32
store i32 73, i32* %1
store i32 73, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 9
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = or i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = shl i32 %8, 9
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = or i32 %10, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 6
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = or i32 %15, 9
store i32 %16, i32* %2
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @thirdBits() {
ret i32 1227133513
}
/* Variables and functions */
int /*<<< orphan*/ tso_noop(int, void *);
void tso_add_object(void *o) {
  { tso_noop(1, o); }
}


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

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

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

LLVM IR (-O2):
define void @tso_add_object(i8* %0) {
%2 = tail call i32 @tso_noop(i32 1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *s) { fprintf(stderr, "sas: error: %s\n", s); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"sas: error: %s\0A\00"
define void @error(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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"sas: error: %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void onJoy2PosUpdate(int x1, int y1, int x2, int y2) {}


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

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

LLVM IR (-O0):
define void @onJoy2PosUpdate(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @onJoy2PosUpdate(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_msg(char *);
void log_ackPacketReceived() { log_msg("NET: ACK packet received"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"NET: ACK packet received\00"
define void @log_ackPacketReceived() {
%1 = call i32 @log_msg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"NET: ACK packet received\00"
define void @log_ackPacketReceived() {
%1 = tail call i32 @log_msg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct xylo_draw {
  int dummy;
};
struct xylo_dlist {
  int dummy;
};

/* Variables and functions */
int xylo_dlist_insert(struct xylo_dlist *, struct xylo_draw *,
                      int /*<<< orphan*/);
int /*<<< orphan*/ xylo_dlist_length(struct xylo_dlist *);
int xylo_dlist_append(struct xylo_dlist *dlist, struct xylo_draw *element) {
  return xylo_dlist_insert(dlist, element, xylo_dlist_length(dlist));
}


x86 assembly (clang, -O0):
<xylo_dlist_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xylo_dlist_length@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <xylo_dlist_insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xylo_dlist_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <xylo_dlist_length@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xylo_dlist_insert@plt>

LLVM IR (-O0):
%struct.xylo_dlist = type { i32 }
%struct.xylo_draw = type { i32 }
define i32 @xylo_dlist_append(%struct.xylo_dlist* %0, %struct.xylo_draw* %1) {
%3 = alloca %struct.xylo_dlist*
%4 = alloca %struct.xylo_draw*
store %struct.xylo_dlist* %0, %struct.xylo_dlist** %3
store %struct.xylo_draw* %1, %struct.xylo_draw** %4
%5 = load %struct.xylo_dlist*, %struct.xylo_dlist** %3
%6 = load %struct.xylo_draw*, %struct.xylo_draw** %4
%7 = load %struct.xylo_dlist*, %struct.xylo_dlist** %3
%8 = call i32 @xylo_dlist_length(%struct.xylo_dlist* %7)
%9 = call i32 @xylo_dlist_insert(%struct.xylo_dlist* %5, %struct.xylo_draw* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.xylo_dlist = type { i32 }
%struct.xylo_draw = type { i32 }
define i32 @xylo_dlist_append(%struct.xylo_dlist* %0, %struct.xylo_draw* %1) {
%3 = tail call i32 @xylo_dlist_length(%struct.xylo_dlist* %0)
%4 = tail call i32 @xylo_dlist_insert(%struct.xylo_dlist* %0, %struct.xylo_draw* %1, i32 %3)
ret i32 %4
}
int __attribute__((unused)) isspace(int c) {
  return (c == ' ') || (c == '\f') || (c == '\n') || (c == '\r') ||
         (c == '\t') || (c == '\v');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 12
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 9
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int *foo_normal(int *);
void test(void) {
  int i;
  int *p = &i;
  int *q_normal = foo_normal(p);
  *p = 1;
  *q_normal = 2;
  if (*p != 2)
    abort();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <foo_normal@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x2,(%rax)
je     1165 <test+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <foo_normal@plt>
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rax)
cmpl   $0x2,0x4(%rsp)
jne    1142 <test+0x22>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32* @foo_normal(i32* %1)
store i32 1, i32* %1
store i32 2, i32* %3
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret void
}
/* Variables and functions */
int dedupe_main(int, char **);
int main(int argc, char **argv) { return dedupe_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <dedupe_main@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @dedupe_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @dedupe_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ctrlc_raise();
int /*<<< orphan*/ strcmp(char const *, char *);
void handle_special(const char *text) {
  if (!strcmp(text, "break"))
    ctrlc_raise();
}


x86 assembly (clang, -O0):
<handle_special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    114c <handle_special+0x2c>
mov    $0x0,%al
call   1040 <ctrlc_raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_special>:
push   %rax
lea    0xed8(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1133 <handle_special+0x13>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <ctrlc_raise@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"break\00"
define void @handle_special(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @ctrlc_raise()
br label %6
6: ; preds = %4, %1
ret void
}
void gtk_window_get_resizable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_resizable() {
ret void
}
long construct_II(int opcode, int rd, int imm) {
  return ((opcode << 24) | (rd << 20) | ((imm & ((1 << 16) - 1)) << 0));
}


x86 assembly (clang, -O0):
<construct_II>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x14,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xffff,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<construct_II>:
shl    $0x18,%edi
shl    $0x14,%esi
or     %edi,%esi
movzwl %dx,%eax
or     %esi,%eax
cltq
ret

LLVM IR (-O0):
define i64 @construct_II(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 24
%9 = load i32, i32* %5
%10 = shl i32 %9, 20
%11 = or i32 %8, %10
%12 = load i32, i32* %6
%13 = and i32 %12, 65535
%14 = shl i32 %13, 0
%15 = or i32 %11, %14
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
define i64 @construct_II(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 24
%5 = shl i32 %1, 20
%6 = or i32 %5, %4
%7 = and i32 %2, 65535
%8 = or i32 %6, %7
%9 = sext i32 %8 to i64
ret i64 %9
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tst_timespec_diff(struct timespec, struct timespec);
long long tst_timespec_to_ms(int /*<<< orphan*/);
long long tst_timespec_diff_ms(struct timespec t1, struct timespec t2) {
  return tst_timespec_to_ms(tst_timespec_diff(t1, t2));
}


x86 assembly (clang, -O0):
<tst_timespec_diff_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <tst_timespec_diff@plt>
mov    %eax,%edi
call   1040 <tst_timespec_to_ms@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i64 @tst_timespec_diff_ms(i32 %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @tst_timespec_diff(i32 %8, i32 %10)
%12 = call i64 @tst_timespec_to_ms(i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @tst_timespec_diff_ms(i32 %0, i32 %1) {
%3 = tail call i32 @tst_timespec_diff(i32 %0, i32 %1)
%4 = tail call i64 @tst_timespec_to_ms(i32 %3)
ret i64 %4
}
/* Variables and functions */
double sine(double);
double cosine(double phase) { return sine(phase + 0.25); }


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

x86 assembly (clang, -O2):
<cosine>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <sine@plt>

LLVM IR (-O0):
define double @cosine(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 2.500000e-01
%5 = call double @sine(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cosine(double %0) {
%2 = fadd double %0, 2.500000e-01
%3 = tail call double @sine(double %2)
ret double %3
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_misc_enable_turboBoost() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 6;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rax) &
        ((((uint64_t)1 << (((1)) - ((1)) + 1)) - 1) << ((1)))) >>
       (1)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_misc_enable_turboBoost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%eax
and    $0x2,%eax
sar    $0x1,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_misc_enable_turboBoost+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_misc_enable_turboBoost+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_misc_enable_turboBoost>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x6,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
shr    %eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_misc_enable_turboBoost() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 6, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @cpuid(i32 %7, i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %2
%10 = and i32 %9, 2
%11 = ashr i32 %10, 1
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpuid_misc_enable_turboBoost() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 6, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 1
%12 = and i32 %11, 1
ret i32 %12
}
int test_imm_A8int8_mem(signed char *val) {
  return ((*val) & (0xA8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A8int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -88
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a = 0;
  while (1) {
    scanf("%d", &a);
    if (a == 42)
      break;
    printf("%d\n", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2a,-0x8(%rbp)
jne    1155 <main+0x35>
jmp    1169 <main+0x49>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
je     117c <main+0x5c>
lea    0xeb1(%rip),%r14
lea    0xea7(%rip),%r15
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %8
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 42
br i1 %6, label %7, label %8
7: ; preds = %3
br label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%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 = icmp eq i32 %4, 42
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
unsigned long long two_raised_to(unsigned int n) {
  long long rslt = 1;
  for (unsigned int i = 0; i < n; i++) {
    rslt *= 2;
  }
  return (rslt);
}


x86 assembly (clang, -O0):
<two_raised_to>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    113c <two_raised_to+0x3c>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <two_raised_to+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_raised_to>:
test   %edi,%edi
je     1118 <two_raised_to+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <two_raised_to+0x1e>
mov    $0x1,%eax
jmp    1139 <two_raised_to+0x39>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffff8,%edi
jne    1130 <two_raised_to+0x30>
test   %ecx,%ecx
je     1148 <two_raised_to+0x48>
nopl   (%rax)
add    %rax,%rax
add    $0xffffffff,%ecx
jne    1140 <two_raised_to+0x40>
ret

LLVM IR (-O0):
define i64 @two_raised_to(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 %0, i32* %2
store i64 1, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i64, i64* %3
%11 = mul nsw i64 %10, 2
store i64 %11, i64* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @two_raised_to(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %21
9: ; preds = %21, %3
%10 = phi i64 [ undef, %3 ], [ %24, %21 ]
%11 = phi i64 [ 1, %3 ], [ %24, %21 ]
%12 = icmp eq i32 %5, 0
br i1 %12, label %19, label %13
13: ; preds = %9, %13
%14 = phi i64 [ %16, %13 ], [ %11, %9 ]
%15 = phi i32 [ %17, %13 ], [ 0, %9 ]
%16 = shl nsw i64 %14, 1
%17 = add i32 %15, 1
%18 = icmp eq i32 %17, %5
br i1 %18, label %19, label %13
19: ; preds = %9, %13, %1
%20 = phi i64 [ 1, %1 ], [ %10, %9 ], [ %16, %13 ]
ret i64 %20
21: ; preds = %21, %7
%22 = phi i64 [ 1, %7 ], [ %24, %21 ]
%23 = phi i32 [ 0, %7 ], [ %25, %21 ]
%24 = shl i64 %22, 8
%25 = add i32 %23, 8
%26 = icmp eq i32 %25, %8
br i1 %26, label %9, label %21
}
int f(int c, int s) {
  int x1, x2, y1, y2;
  y1 = c + 2;
  x1 = y1 * s;
  y2 = y1 + 2;
  x2 = s * y2;
  return x1 + x2;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,1),%eax
add    $0x6,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 2
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 2
store i32 %15, i32* %8
%16 = load i32, i32* %4
%17 = load i32, i32* %8
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %6
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = add i32 %3, 6
%5 = mul i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ parImpar(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, flag = 1;
  printf("0 para sair do programa\n\n");
  while (flag != 0) {
    printf("Digite o numero: \n");
    scanf("%d", &n);
    if (n == 0)
      flag = 0;
    break;
    parImpar(n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     117e <main+0x5e>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1179 <main+0x59>
movl   $0x0,-0xc(%rbp)
jmp    117e <main+0x5e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"0 para sair do programa\0A\0A\00"
@.str.1 = [19 x i8] c"Digite o numero: \0A\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 0, i32* %3
br label %14
14: ; preds = %13, %8
br label %15
15: ; preds = %14, %5
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@str = [25 x i8] c"0 para sair do programa\0A\00"
@str.3 = [18 x i8] c"Digite o numero: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
ret i32 0
}
int do_474() { return 474; }


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

x86 assembly (clang, -O2):
<do_474>:
mov    $0x1da,%eax
ret

LLVM IR (-O0):
define i32 @do_474() {
ret i32 474
}

LLVM IR (-O2):
define i32 @do_474() {
ret i32 474
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 5, 6);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x6,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x6,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 6)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 6)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ vecjac_(int *, double *, double *, int *, int *);
void mgh_vecjac(int n, const double *x, double *fjac, int ldfjac, int nprob) {
  int _n = n, _ldfjac = ldfjac, _nprob = nprob;
  assert(sizeof(double) == sizeof(*x));
  vecjac_(&_n, (double *)x, (double *)fjac, &_ldfjac, &_nprob);
}


x86 assembly (clang, -O0):
<mgh_vecjac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r8
call   1040 <vecjac_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgh_vecjac>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,0x14(%rsp)
mov    %ecx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vecjac_@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mgh_vecjac(i32 %0, double* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = load i32, i32* %6
store i32 %14, i32* %11
%15 = load i32, i32* %9
store i32 %15, i32* %12
%16 = load i32, i32* %10
store i32 %16, i32* %13
%17 = call i32 @assert(i32 1)
%18 = load double*, double** %7
%19 = load double*, double** %8
%20 = call i32 @vecjac_(i32* %11, double* %18, double* %19, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @mgh_vecjac(i32 %0, double* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %6 to i8*
store i32 %0, i32* %6
%10 = bitcast i32* %7 to i8*
store i32 %3, i32* %7
%11 = bitcast i32* %8 to i8*
store i32 %4, i32* %8
%12 = tail call i32 @assert(i32 1)
%13 = call i32 @vecjac_(i32* %6, double* %1, double* %2, i32* %7, i32* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_faddd(int s1, int s2, int d) {
  assem_debug("faddd d%d,d%d,d%d", d, s1, s2);
  output_w32(0xee300b00 | ((d & 7) << 12) | ((s1 & 7) << 16) | (s2 & 7));
}


x86 assembly (clang, -O0):
<emit_faddd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebf(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0xc(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xee300b00,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
shl    $0x10,%eax
or     %eax,%edi
mov    -0x8(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_faddd>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xece(%rip),%rdi
mov    %edx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <assem_debug@plt>
and    $0x7,%r14d
shl    $0xc,%r14d
and    $0x7,%ebp
shl    $0x10,%ebp
and    $0x7,%ebx
or     %ebp,%ebx
lea    (%r14,%rbx,1),%edi
add    $0xee300b00,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"faddd d%d,d%d,d%d\00"
define void @emit_faddd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @assem_debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = and i32 %11, 7
%13 = shl i32 %12, 12
%14 = or i32 -298841344, %13
%15 = load i32, i32* %4
%16 = and i32 %15, 7
%17 = shl i32 %16, 16
%18 = or i32 %14, %17
%19 = load i32, i32* %5
%20 = and i32 %19, 7
%21 = or i32 %18, %20
%22 = call i32 @output_w32(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"faddd d%d,d%d,d%d\00"
define void @emit_faddd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @assem_debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1)
%5 = shl i32 %2, 12
%6 = and i32 %5, 28672
%7 = shl i32 %0, 16
%8 = and i32 %7, 458752
%9 = and i32 %1, 7
%10 = or i32 %8, %9
%11 = or i32 %10, %6
%12 = or i32 %11, -298841344
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
void dmss_ipi_handler(void) {}


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

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

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

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