xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long long msecs(void) {
  struct timespec ts;
  unsigned long long msecs;
  clock_gettime(CLOCK_REALTIME, &ts);
  msecs = ts.tv_sec * 1000ull;
  msecs += ts.tv_nsec / 1000000ull;
  return msecs;
}


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

x86 assembly (clang, -O2):
<msecs>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
movabs $0x431bde82d7b634db,%rax
de 1b 43
mulq   0x10(%rsp)
imul   $0x3e8,0x8(%rsp),%rax
shr    $0x12,%rdx
add    %rdx,%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @msecs() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = udiv i64 %9, 1000000
%11 = add i64 %10, %7
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("hello...");
  puts("\n\x01\r\\ ");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"hello...\00"
@.str.1 = [6 x i8] c"\0A\01\0D\\ \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"hello...\00"
@.str.1 = [6 x i8] c"\0A\01\0D\\ \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void increment_ptr(char *ptr) {
  char val = *ptr;
  *ptr = val + 1;
}


x86 assembly (clang, -O0):
<increment_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_ptr>:
addb   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @increment_ptr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 1
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %2
store i8 %9, i8* %10
ret void
}

LLVM IR (-O2):
define void @increment_ptr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, 1
store i8 %3, i8* %0
ret void
}
/* Type definitions */
struct YsGLSL3DRenderer {
  int dummy;
};

/* Variables and functions */
struct YsGLSL3DRenderer *YsGLSLCreateVariColorMarkerByPointSprite3DRenderer();
struct YsGLSL3DRenderer *
YsGLSLCreateMonoColorMarkerByPointSprite3DRenderer(void) {
  return YsGLSLCreateVariColorMarkerByPointSprite3DRenderer();
}


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

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

LLVM IR (-O0):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorMarkerByPointSprite3DRenderer() {
%1 = call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorMarkerByPointSprite3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}

LLVM IR (-O2):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorMarkerByPointSprite3DRenderer() {
%1 = tail call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorMarkerByPointSprite3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}
/* Variables and functions */
int /*<<< orphan*/ irq_init();
int /*<<< orphan*/ key_init();
int /*<<< orphan*/ led_test();
int /*<<< orphan*/ myputs(char *);
int /*<<< orphan*/ uart_init();
int main() {
  irq_init();
  uart_init();
  key_init();
  myputs("hello world!\n");
  led_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <irq_init@plt>
mov    $0x0,%al
call   1050 <uart_init@plt>
mov    $0x0,%al
call   1030 <key_init@plt>
lea    0xe85(%rip),%rdi
call   1040 <myputs@plt>
mov    $0x0,%al
call   1070 <led_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <irq_init@plt>
xor    %eax,%eax
call   1050 <uart_init@plt>
xor    %eax,%eax
call   1030 <key_init@plt>
lea    0xe93(%rip),%rdi
call   1040 <myputs@plt>
xor    %eax,%eax
call   1070 <led_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @irq_init()
%3 = call i32 (...) @uart_init()
%4 = call i32 (...) @key_init()
%5 = call i32 @myputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @led_test()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @irq_init()
%2 = tail call i32 (...) @uart_init()
%3 = tail call i32 (...) @key_init()
%4 = tail call i32 @myputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @led_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_arch_prctl;
int __syscall2(int /*<<< orphan*/, int, unsigned long);
int arch_prctl(int code, unsigned long addr) {
  return __syscall2(SYS_arch_prctl, code, addr);
}


x86 assembly (clang, -O0):
<arch_prctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <__syscall2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_prctl>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__syscall2@plt>

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

LLVM IR (-O2):
@SYS_arch_prctl = global i32 0
define i32 @arch_prctl(i32 %0, i64 %1) {
%3 = load i32, i32* @SYS_arch_prctl
%4 = tail call i32 @__syscall2(i32 %3, i32 %0, i64 %1)
ret i32 %4
}
void prints(char *s) {
  char c;
  while (c = *s++)
    __asm__ __volatile__("int $0x10" : : "b"(0), "a"(0xE00 | c));
}


x86 assembly (clang, -O0):
<prints>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1137 <prints+0x37>
movsbl -0x11(%rbp),%eax
or     $0xe00,%eax
xor    %ebx,%ebx
int    $0x10
jmp    1109 <prints+0x9>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<prints>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1125 <prints+0x25>
add    $0x1,%rdi
xor    %ebx,%ebx
nopl   (%rax)
movsbl %al,%eax
or     $0xe00,%eax
int    $0x10
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <prints+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @prints(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = or i32 3584, %11
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @prints(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = or i32 %8, 3584
tail call void asm sideeffect "int $$0x10", "{bx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %9)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t(int);
main() {
  t(5);
  t(20);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x14,%edi
call   1030 <t@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @t(i32 5)
%2 = call i32 @t(i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @t(i32 5)
%2 = tail call i32 @t(i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Fail(char *, int, int);
int printf(char const *, char);
int strlen(char const *);
void DoCharTest(const char *formatstr, char param, const char *checkstr) {
  int ret;
  ret = printf(formatstr, param);
  if (ret != strlen(checkstr)) {
    Fail("Expected printf to return %d, got %d.\n", strlen(checkstr), ret);
  }
}


x86 assembly (clang, -O0):
<DoCharTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <printf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     118c <DoCharTest+0x5c>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xe79(%rip),%rdi
call   1050 <Fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCharTest>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <printf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jne    1150 <DoCharTest+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Fail@plt>

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

LLVM IR (-O2):
@.str = [39 x i8] c"Expected printf to return %d, got %d.\0A\00"
define void @DoCharTest(i8* %0, i8 signext %1, i8* %2) {
%4 = tail call i32 @printf(i8* %0, i8 signext %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @strlen(i8* %2)
%9 = tail call i32 @Fail(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %4)
br label %10
10: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_dont_continue_past_space() {
  char *str = "1262325600 1262325660";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1262325600 && (dest % 1000000000) == 0);
}


x86 assembly (clang, -O0):
<test_dont_continue_past_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4b3d8f60,%ecx
mov    %al,-0xd(%rbp)
jne    1172 <test_dont_continue_past_space+0x52>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dont_continue_past_space>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"1262325600 1262325660\00"
define void @test_dont_continue_past_space() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1262325600
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"1262325600 1262325660\00"
define void @test_dont_continue_past_space() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ftrylockfile(FILE *filehandle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ftrylockfile(i32* nocapture readnone %0) {
ret i32 0
}
char *copy(str1, str2)
char *str1, *str2;
{
  register char *s1, *s2;
  s1 = str1;
  s2 = str2;
  while (*s1)
    *s2++ = *s1++;
  *s2 = 0;
  return (s2);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <copy+0x50>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    111c <copy+0x1c>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    %rsi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <copy+0x21>
add    $0x1,%rdi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <copy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @copy(i8* nocapture %0, i8* writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
int test_imm_EFint64_lowword_reg(long long val) {
  return ((val) & (0xEF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EFint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xef,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EFint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 239
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int sum(int numbers[], int length, int start_index) {}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sum(i32* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 undef
}
void dead_test11(int *data) {
  int i = data[0];
  int j = data[1];
  int k = i * j;
  if (i & j)
    data[0] = k;
  j = data[2];
  data[j] = 2;
}


x86 assembly (clang, -O0):
<dead_test11>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     113d <dead_test11+0x3d>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_test11>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
test   %eax,%ecx
je     110e <dead_test11+0xe>
imul   %eax,%ecx
mov    %ecx,(%rdi)
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @dead_test11(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = and i32 %4, %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = mul nsw i32 %4, %2
store i32 %8, i32* %0
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 2, i32* %13
ret void
}
void gtk_window_set_position() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_position() {
ret void
}
void swap_long_4(long *tni4) {
  *tni4 = (((*tni4 >> 24) & 0xff) | ((*tni4 & 0xff) << 24) |
           ((*tni4 >> 8) & 0xff00) | ((*tni4 & 0xff00) << 8));
}


x86 assembly (clang, -O0):
<swap_long_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
sar    $0x18,%rcx
and    $0xff,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xff,%rax
shl    $0x18,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
sar    $0x8,%rax
and    $0xff00,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xff00,%rax
shl    $0x8,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap_long_4(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 24
%6 = and i64 %5, 255
%7 = load i64*, i64** %2
%8 = load i64, i64* %7
%9 = and i64 %8, 255
%10 = shl i64 %9, 24
%11 = or i64 %6, %10
%12 = load i64*, i64** %2
%13 = load i64, i64* %12
%14 = ashr i64 %13, 8
%15 = and i64 %14, 65280
%16 = or i64 %11, %15
%17 = load i64*, i64** %2
%18 = load i64, i64* %17
%19 = and i64 %18, 65280
%20 = shl i64 %19, 8
%21 = or i64 %16, %20
%22 = load i64*, i64** %2
store i64 %21, i64* %22
ret void
}

LLVM IR (-O2):
define void @swap_long_4(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
%5 = zext i32 %4 to i64
store i64 %5, i64* %0
ret void
}
void __attribute__((noreturn)) exit(int code) {
  (*((volatile unsigned char *)(0x2F + 0x20))) = code;
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x4f,%eax
mov    %cl,(%rax)
jmp    1113 <exit+0x13>

x86 assembly (clang, -O2):
<exit>:
mov    %dil,0x4f
nopl   0x0(%rax,%rax,1)
jmp    1110 <exit+0x10>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 79 to i8*)
br label %5
5: ; preds = %5, %1
br label %5
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = trunc i32 %0 to i8
store volatile i8 %2, i8* inttoptr (i64 79 to i8*)
br label %3
3: ; preds = %3, %1
br label %3
}
double fgen_bitstring_uint32_to_double(const unsigned char *bitstring,
                                       double domain_min, double domain_max) {
  unsigned int x_int;
  double x;
  x_int = *(unsigned int *)&bitstring[0];
  x = domain_min + (domain_max - domain_min) * x_int / ((double)65536 * 65536);
  return x;
}


x86 assembly (clang, -O0):
<fgen_bitstring_uint32_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  %xmm0,%xmm1
mov    -0x1c(%rbp),%eax
cvtsi2sd %rax,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgen_bitstring_uint32_to_double>:
mov    (%rdi),%eax
subsd  %xmm0,%xmm1
cvtsi2sd %rax,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xee9(%rip),%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fgen_bitstring_uint32_to_double(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %6
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load double, double* %5
%14 = load double, double* %6
%15 = load double, double* %5
%16 = fsub double %14, %15
%17 = load i32, i32* %7
%18 = uitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = fdiv double %19, 0x41F0000000000000
%21 = fadd double %13, %20
store double %21, double* %8
%22 = load double, double* %8
ret double %22
}

LLVM IR (-O2):
define double @fgen_bitstring_uint32_to_double(i8* nocapture %0, double %1, double %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = fsub double %2, %1
%7 = uitofp i32 %5 to double
%8 = fmul double %6, %7
%9 = fmul double %8, 0x3DF0000000000000
%10 = fadd double %9, %1
ret double %10
}
int cut_public() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cut_public() {
ret i32 0
}
int setitimer(int which, const struct itimerval *value,
              struct itimerval *oldvalue) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.itimerval = type opaque
define i32 @setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2) {
%4 = alloca i32
%5 = alloca %struct.itimerval*
%6 = alloca %struct.itimerval*
store i32 %0, i32* %4
store %struct.itimerval* %1, %struct.itimerval** %5
store %struct.itimerval* %2, %struct.itimerval** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.itimerval = type opaque
define i32 @setitimer(i32 %0, %struct.itimerval* nocapture readnone %1, %struct.itimerval* nocapture readnone %2) {
ret i32 -1
}
int main() {
  int x, y, z;
#pragma acc parallel loop seq auto
  for (x = 0; x < 10; x++)
#pragma acc loop
    for (y = 0; y < 10; y++)
      ;
#pragma acc parallel loop gang auto
  for (x = 0; x < 10; x++)
#pragma acc loop worker auto
    for (y = 0; y < 10; y++)
#pragma acc loop vector
      for (z = 0; z < 10; z++)
        ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1153 <main+0x53>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1140 <main+0x40>
jmp    1132 <main+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1145 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11bf <main+0xbf>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11ac <main+0xac>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1199 <main+0x99>
jmp    118b <main+0x8b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117c <main+0x7c>
jmp    119e <main+0x9e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <main+0x6b>
jmp    11b1 <main+0xb1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x5a>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %20
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %16
12: ; preds = %9
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %9
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %5
20: ; preds = %5
store i32 0, i32* %2
br label %21
21: ; preds = %41, %20
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %44
24: ; preds = %21
store i32 0, i32* %3
br label %25
25: ; preds = %37, %24
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 10
br i1 %27, label %28, label %40
28: ; preds = %25
store i32 0, i32* %4
br label %29
29: ; preds = %33, %28
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 10
br i1 %31, label %32, label %36
32: ; preds = %29
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %29
36: ; preds = %29
br label %37
37: ; preds = %36
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %25
40: ; preds = %25
br label %41
41: ; preds = %40
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %21
44: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void gpio_nand_inactive(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_nand_inactive() {
ret void
}
int fun233() { return 233; }


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

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

LLVM IR (-O0):
define i32 @fun233() {
ret i32 233
}

LLVM IR (-O2):
define i32 @fun233() {
ret i32 233
}
/* Variables and functions */
int /*<<< orphan*/ draw();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int main(void) {
  initscr();
  draw();
  endwin();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1030 <draw@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @draw()
%3 = tail call i32 (...) @endwin()
ret i32 0
}
int test_imm_20uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x20,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_20uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 32
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int);
void congratulatesStudent(char *student, char *course, int numDays) {
  printf("%s has done as much %s Programming as I could fit into %d days.\n",
         student, course, numDays);
}


x86 assembly (clang, -O0):
<congratulatesStudent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<congratulatesStudent>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"%s has done as much %s Programming as I could fit into %d days.\0A\00"
define void @congratulatesStudent(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"%s has done as much %s Programming as I could fit into %d days.\0A\00"
define void @congratulatesStudent(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int main(int argc, char *argv[]) {
  malloc(4);
  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    $0x4,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @malloc(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xad() {
  Assert_real((iscntrl(173) == 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_iscntrl.c",
              870, ("iscntrl should be 0 for 0xad"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xad>:
push   %rax
mov    $0xad,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x366,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xad\00"
define void @t_iscntrl_0xad() {
%1 = call i64 @iscntrl(i32 173)
%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 870, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xad\00"
define void @t_iscntrl_0xad() {
%1 = tail call i64 @iscntrl(i32 173)
%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 870, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OTHERNAME;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ OTHERNAME_it;
OTHERNAME *OTHERNAME_new(void) {
  return (OTHERNAME *)ASN1_item_new(&OTHERNAME_it);
}


x86 assembly (clang, -O0):
<OTHERNAME_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OTHERNAME_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@OTHERNAME_it = global i32 0
define i32* @OTHERNAME_new() {
%1 = call i64 @ASN1_item_new(i32* @OTHERNAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@OTHERNAME_it = global i32 0
define i32* @OTHERNAME_new() {
%1 = tail call i64 @ASN1_item_new(i32* @OTHERNAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int int_sub(int line, int a, int b) { return a - b; }


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

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

LLVM IR (-O0):
define i32 @int_sub(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* %5
%8 = load i32, i32* %6
%9 = sub nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @int_sub(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
ret i32 %4
}
/* Variables and functions */
int sprintf(char *, char *, float const, float const, float const);
int swrite_v(const float v[3], char *buf) {
  enum { X, Y, Z };
  return sprintf(buf, "%+.6e %+.6e %+.6e ", v[X], v[Y], v[Z]);
}


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

x86 assembly (clang, -O2):
<swrite_v>:
mov    %rsi,%rax
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
lea    0xed8(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%+.6e %+.6e %+.6e \00"
define i32 @swrite_v(float* %0, i8* %1) {
%3 = alloca float*
%4 = alloca i8*
store float* %0, float** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %8, float %11, float %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [19 x i8] c"%+.6e %+.6e %+.6e \00"
define i32 @swrite_v(float* nocapture %0, i8* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 2
%7 = load float, float* %6
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %3, float %5, float %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ celt_free(int *);
void quant_prob_free(int *freq) { celt_free(freq); }


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

x86 assembly (clang, -O2):
<quant_prob_free>:
jmp    1030 <celt_free@plt>

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

LLVM IR (-O2):
define void @quant_prob_free(i32* %0) {
%2 = tail call i32 @celt_free(i32* %0)
ret void
}
void sendpacket(int other, unsigned char *bufptr, int messleng) {
  other = other;
  bufptr = bufptr;
  messleng = messleng;
}


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

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

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

LLVM IR (-O2):
define void @sendpacket(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _scanf_getll(char *, long long *, int, int,
                                int /*<<< orphan*/);
int /*<<< orphan*/ safe_gets(char *, int);
unsigned long long getludec() {
  char buf[80];
  safe_gets(buf, 80);
  unsigned long long x = 0;
  _scanf_getll(buf, (long long *)&x, 10, 80, 0);
  return x;
}


x86 assembly (clang, -O0):
<getludec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
movq   $0x0,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
mov    $0x50,%ecx
xor    %r8d,%r8d
call   1040 <_scanf_getll@plt>
mov    -0x58(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getludec>:
push   %rbx
sub    $0x60,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
mov    $0x50,%ecx
xor    %r8d,%r8d
call   1040 <_scanf_getll@plt>
mov    0x8(%rsp),%rax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getludec() {
%1 = alloca [80 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @safe_gets(i8* %3, i32 80)
store i64 0, i64* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 @_scanf_getll(i8* %5, i64* %2, i32 10, i32 80, i32 0)
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
define i64 @getludec() {
%1 = alloca [80 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @safe_gets(i8* %3, i32 80)
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @_scanf_getll(i8* %3, i64* %2, i32 10, i32 80, i32 0)
%7 = load i64, i64* %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ crash();
int main(int argc, char *argv[]) { crash(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @crash()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SEQ_CONTROL(int /*<<< orphan*/, int, int, int);
void seq_control(int chn, int control, int value) {
  SEQ_CONTROL(0, chn, control, value);
}


x86 assembly (clang, -O0):
<seq_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
call   1030 <SEQ_CONTROL@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_control>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <SEQ_CONTROL@plt>

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

LLVM IR (-O2):
define void @seq_control(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @SEQ_CONTROL(i32 0, i32 %0, i32 %1, i32 %2)
ret void
}