xunge/DecIR huggingface dataset:
char pfCharToLower(char c) {
  return (char)(((c >= 'A') && (c <= 'Z')) ? (c + ('a' - 'A')) : c);
}


x86 assembly (clang, -O0):
<pfCharToLower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <pfCharToLower+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <pfCharToLower+0x33>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <pfCharToLower+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfCharToLower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @pfCharToLower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @pfCharToLower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ cortexa9_init();
void _profile_init(void) { cortexa9_init(); }


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

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

LLVM IR (-O0):
define void @_profile_init() {
%1 = call i32 (...) @cortexa9_init()
ret void
}

LLVM IR (-O2):
define void @_profile_init() {
%1 = tail call i32 (...) @cortexa9_init()
ret void
}
void SystemPreInit(void) {
  __asm__ __volatile__("jmp .+2\ninvd\njmp .+2\n");
  StartTimer1();
}


x86 assembly (clang, -O0):
<SystemPreInit>:
push   %rbp
mov    %rsp,%rbp
jmp    1116 <SystemPreInit+0x6>
invd
jmp    111d <SystemPreInit+0xd>
mov    $0x0,%al
call   1030 <StartTimer1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemPreInit>:
jmp    1112 <SystemPreInit+0x2>
invd
jmp    1116 <SystemPreInit+0x6>
xor    %eax,%eax
jmp    1030 <StartTimer1@plt>

LLVM IR (-O0):
define void @SystemPreInit() {
%1 = call i32 (...) @StartTimer1()
ret void
}

LLVM IR (-O2):
define void @SystemPreInit() {
tail call void asm sideeffect "jmp .+2\0Ainvd\0Ajmp .+2\0A", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @StartTimer1()
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *dup;
  dup = malloc(strlen(s) + 1);
  strcpy(dup, s);
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_u8(scalar_t__);
scalar_t__ plcvm_lpm_u8();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_u1_cs8(void) {
  plcvm_push(plcvm_get_u8(plcvm_pop() * 4 + plcvm_lpm_u8()));
}


x86 assembly (clang, -O0):
<cb_ldm_u1_cs8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <plcvm_lpm_u8@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1040 <plcvm_get_u8@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_u1_cs8>:
push   %rbx
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
shl    $0x2,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1060 <plcvm_lpm_u8@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <plcvm_get_u8@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_u1_cs8() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 4
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_u8(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_u1_cs8() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 2
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_u8(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
reset(int *p) { *p = -5; }


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xfffffffb,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
movl   $0xfffffffb,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @reset(i32* nocapture writeonly %0) {
store i32 -5, i32* %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ morph_dilate_uint8(unsigned char *, int *, int, int);
int /*<<< orphan*/ morph_erode_uint8(unsigned char *, int *, int,
                                     int /*<<< orphan*/);
void morph_close_uint8(unsigned char *vol, int dims[3], int niter, int th) {
  morph_dilate_uint8(vol, dims, niter, th);
  morph_erode_uint8(vol, dims, niter, 0);
}


x86 assembly (clang, -O0):
<morph_close_uint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <morph_dilate_uint8@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1040 <morph_erode_uint8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morph_close_uint8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <morph_dilate_uint8@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <morph_erode_uint8@plt>

LLVM IR (-O0):
define void @morph_close_uint8(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @morph_dilate_uint8(i8* %9, i32* %10, i32 %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i32*, i32** %6
%16 = load i32, i32* %7
%17 = call i32 @morph_erode_uint8(i8* %14, i32* %15, i32 %16, i32 0)
ret void
}

LLVM IR (-O2):
define void @morph_close_uint8(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @morph_dilate_uint8(i8* %0, i32* %1, i32 %2, i32 %3)
%6 = tail call i32 @morph_erode_uint8(i8* %0, i32* %1, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int parsecmd(char *);
int /*<<< orphan*/ scanf(char *, char *, char *);
int readline() {
  char line[255], c;
  scanf("%[^\r\n]%c", line, &c);
  return parsecmd(line);
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rsi
lea    0xec7(%rip),%rdi
lea    -0x101(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <parsecmd@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
push   %rbx
sub    $0x110,%rsp
lea    0xed1(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0xf(%rsp),%rdx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <parsecmd@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%[^\0D\0A]%c\00"
define i32 @readline() {
%1 = alloca [255 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %2)
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%6 = call i32 @parsecmd(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"%[^\0D\0A]%c\00"
define i32 @readline() {
%1 = alloca [255 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %2)
%5 = call i32 @parsecmd(i8* %3)
ret i32 %5
}
int test_imm_B8uint16_reg(unsigned short val) {
  return ((val) & (-0xB8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B8uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff48,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B8uint16_reg>:
test   $0xff48,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B8uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -184
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int __ompc_task_cutoff_always() { return 1; }


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

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

LLVM IR (-O0):
define i32 @__ompc_task_cutoff_always() {
ret i32 1
}

LLVM IR (-O2):
define i32 @__ompc_task_cutoff_always() {
ret i32 1
}
int rst_undump_ubc(struct cpt_context *ctx) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cpt_context = type opaque
define i32 @rst_undump_ubc(%struct.cpt_context* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteWord(int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
void wiznetSetSocketRXReadPointer(uint8_t socket, uint16_t addr) {
  wiznetRegWriteWord(socket, (0x0000 + 0x0028), addr);
}


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

x86 assembly (clang, -O2):
<wiznetSetSocketRXReadPointer>:
mov    %esi,%edx
mov    $0x28,%esi
jmp    1030 <wiznetRegWriteWord@plt>

LLVM IR (-O0):
define void @wiznetSetSocketRXReadPointer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @wiznetRegWriteWord(i32 %5, i32 40, i32 %6)
ret void
}

LLVM IR (-O2):
define void @wiznetSetSocketRXReadPointer(i32 %0, i32 %1) {
%3 = tail call i32 @wiznetRegWriteWord(i32 %0, i32 40, i32 %1)
ret void
}
void xen_raw_console_write(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @xen_raw_console_write(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xab() {
  Assert_real((isascii(171) == 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_isascii.c",
              860, ("isascii should be 0 for 0xab"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xab>:
push   %rax
mov    $0xab,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x35c,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xab\00"
define void @t_isascii_0xab() {
%1 = call i64 @isascii(i32 171)
%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 860, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xab\00"
define void @t_isascii_0xab() {
%1 = tail call i64 @isascii(i32 171)
%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 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int query_drive(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @query_drive() {
ret i32 2
}

LLVM IR (-O2):
define i32 @query_drive() {
ret i32 2
}
/* Variables and functions */
char *strdup(char *);
void find_system_info(char **system_model, char **cpu_model,
                      int *cpu_frequency) {
  *system_model = strdup("Unknown System Model");
  *cpu_model = strdup("Unknown CPU Model");
  *cpu_frequency = -1;
}


x86 assembly (clang, -O0):
<find_system_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
lea    0xed4(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_system_info>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,(%rbx)
lea    0xee1(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,(%r15)
movl   $0xffffffff,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Unknown System Model\00"
@.str.1 = [18 x i8] c"Unknown CPU Model\00"
define void @find_system_info(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 = call i8* @strdup(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = load i8**, i8*** %4
store i8* %7, i8** %8
%9 = call i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8**, i8*** %5
store i8* %9, i8** %10
%11 = load i32*, i32** %6
store i32 -1, i32* %11
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unknown System Model\00"
@.str.1 = [18 x i8] c"Unknown CPU Model\00"
define void @find_system_info(i8** nocapture writeonly %0, i8** nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call dereferenceable_or_null(21) i8* @strdup(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %0
%5 = tail call dereferenceable_or_null(18) i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %1
store i32 -1, i32* %2
ret void
}
_Bool f3(_Bool *p) { *p ^= 1; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    $0x1,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
mov    %cl,(%rax)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
xorb   $0x1,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i1 @f3(i8* %0) {
%2 = alloca i1
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = trunc i8 %5 to i1
%7 = zext i1 %6 to i32
%8 = xor i32 %7, 1
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i8
store i8 %10, i8* %4
%11 = load i1, i1* %2
ret i1 %11
}

LLVM IR (-O2):
define zeroext i1 @f3(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = xor i8 %2, 1
store i8 %3, i8* %0
ret i1 undef
}
double Exyxy(double l, double m, double n) {
  return 0 * -0.03753 + l * l * 0.02719 + n * n * -0.00488;
}


x86 assembly (clang, -O0):
<Exyxy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xee3(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exyxy>:
mulsd  %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  %xmm2,%xmm2
mulsd  0xef0(%rip),%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Exyxy(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %9, double 2.719000e-02, double -0.000000e+00)
%11 = load double, double* %6
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %13, double -4.880000e-03, double %10)
ret double %14
}

LLVM IR (-O2):
define double @Exyxy(double %0, double %1, double %2) {
%4 = fmul double %0, %0
%5 = fmul double %4, 2.719000e-02
%6 = fmul double %2, %2
%7 = tail call double @llvm.fmuladd.f64(double %6, double -4.880000e-03, double %5)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void SWAP32(uint32_t *const x, uint32_t *const y) {
  uint32_t _x = *x;
  *x = *y;
  *y = _x;
}


x86 assembly (clang, -O0):
<SWAP32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SWAP32(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @SWAP32(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int atoi(char const *txt) {
  int r = txt[0] - '0';
  printf("atoi(%s): %d\n", txt, r);
  return r;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
push   %rbx
mov    %rdi,%rsi
movsbl (%rdi),%ebx
add    $0xffffffd0,%ebx
lea    0xedf(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"atoi(%s): %d\0A\00"
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"atoi(%s): %d\0A\00"
define i32 @atoi(i8* %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -48
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tty_reset();
void tty_atexit(void) {
  printf("Exit. Reset tty to initial settings.\n");
  tty_reset();
}


x86 assembly (clang, -O0):
<tty_atexit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <tty_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_atexit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <tty_reset@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Exit. Reset tty to initial settings.\0A\00"
define void @tty_atexit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @tty_reset()
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Exit. Reset tty to initial settings.\00"
define void @tty_atexit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @tty_reset()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t rtcp_xr_get_length(const uint8_t *p_rtcp_xr_b) {
  return (p_rtcp_xr_b[2] << 8) | p_rtcp_xr_b[3];
}


x86 assembly (clang, -O0):
<rtcp_xr_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcp_xr_get_length>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtcp_xr_get_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rtcp_xr_get_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
unsigned int complement(unsigned int x) { return ~x; }


x86 assembly (clang, -O0):
<complement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement>:
mov    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @complement(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
/* Type definitions */
struct snd_ac97 {
  int dummy;
};

/* Variables and functions */
int is_surround_on(struct snd_ac97 *);
int alc850_is_aux_back_surround(struct snd_ac97 *ac97) {
  return is_surround_on(ac97);
}


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

x86 assembly (clang, -O2):
<alc850_is_aux_back_surround>:
jmp    1030 <is_surround_on@plt>

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

LLVM IR (-O2):
%struct.snd_ac97 = type { i32 }
define i32 @alc850_is_aux_back_surround(%struct.snd_ac97* %0) {
%2 = tail call i32 @is_surround_on(%struct.snd_ac97* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_83() {
  Assert_real((isqrt(83) == 9),
              "/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/stdlib/isqrt.c",
              420, ("Integer square root of 83 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_83>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1a4,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_83>:
push   %rax
mov    $0x53,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1a4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 83 should be 9\00"
define void @t_sqrt_83() {
%1 = call i32 @isqrt(i32 83)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 83 should be 9\00"
define void @t_sqrt_83() {
%1 = tail call i32 @isqrt(i32 83)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ palin(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  char str[100];
  scanf("%s ", str);
  palin(str, 0, strlen(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1050 <palin@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1050 <palin@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @palin(i8* %5, i32 0, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @palin(i8* %2, i32 0, i32 %4)
ret i32 0
}
void ff_hevc_put_hevc_epel_v4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v4_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nic_outb(int, int);
int /*<<< orphan*/ phy_outw(int, int);
int NicPhyInit(void) {
  phy_outw(0x04, 0x01E1);
  phy_outw(0x00, 0x1200);
  nic_outb(0x1E, 1);
  nic_outb(0x1F, 0);
  return 0;
}


x86 assembly (clang, -O0):
<NicPhyInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1e1,%esi
call   1040 <phy_outw@plt>
xor    %edi,%edi
mov    $0x1200,%esi
call   1040 <phy_outw@plt>
mov    $0x1e,%edi
mov    $0x1,%esi
call   1030 <nic_outb@plt>
mov    $0x1f,%edi
xor    %esi,%esi
call   1030 <nic_outb@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NicPhyInit>:
push   %rax
mov    $0x4,%edi
mov    $0x1e1,%esi
call   1040 <phy_outw@plt>
xor    %edi,%edi
mov    $0x1200,%esi
call   1040 <phy_outw@plt>
mov    $0x1e,%edi
mov    $0x1,%esi
call   1030 <nic_outb@plt>
mov    $0x1f,%edi
xor    %esi,%esi
call   1030 <nic_outb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @NicPhyInit() {
%1 = call i32 @phy_outw(i32 4, i32 481)
%2 = call i32 @phy_outw(i32 0, i32 4608)
%3 = call i32 @nic_outb(i32 30, i32 1)
%4 = call i32 @nic_outb(i32 31, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @NicPhyInit() {
%1 = tail call i32 @phy_outw(i32 4, i32 481)
%2 = tail call i32 @phy_outw(i32 0, i32 4608)
%3 = tail call i32 @nic_outb(i32 30, i32 1)
%4 = tail call i32 @nic_outb(i32 31, i32 0)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ getNumberAsBin(int, char **);
int main(int argc, char *args[]) {
  int n;
  if (argc)
    n = atoi(args[1]);
  char *binBuff;
  getNumberAsBin(n, &binBuff);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1150 <main+0x30>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <getNumberAsBin@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <getNumberAsBin@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**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %6
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %6
%17 = call i32 @getNumberAsBin(i32 %16, i8** %7)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = icmp ne i32 %0, 0
tail call void @llvm.assume(i1 %4)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = bitcast i8** %3 to i8*
%9 = call i32 @getNumberAsBin(i32 %7, i8** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abc(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char s[50];
  printf("Enter a string: ");
  gets(s);
  abc(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x40(%rbp),%rdi
call   1040 <abc@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <abc@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a string: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 @abc(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a string: \00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @abc(i8* %2)
ret i32 0
}
void bn_mul_add_words(void) {}


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

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

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

LLVM IR (-O2):
define void @bn_mul_add_words() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: yes\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"usage: yes\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"usage: yes\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int u8islowercyrilici(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8islowercyrilicc(char *c) { return u8islowercyrilici(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8islowercyrilicc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8islowercyrilici@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @u8islowercyrilicc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8islowercyrilici(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ hacky_fini();
__attribute__((__destructor__)) void actual_fini() { hacky_fini(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_fini, i8* null }]
define void @actual_fini() {
%1 = call i32 (...) @hacky_fini()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_fini, i8* null }]
define void @actual_fini() {
%1 = tail call i32 (...) @hacky_fini()
ret void
}
char *depth_type(double d) {
  if (d < 0.3001)
    return "wide";
  if (d > 0.6999)
    return "long";
  return "medium";
}


x86 assembly (clang, -O0):
<depth_type>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112c <depth_type+0x2c>
lea    0xeed(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <depth_type+0x5e>
movsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <depth_type+0x53>
lea    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <depth_type+0x5e>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<depth_type>:
ucomisd 0xef8(%rip),%xmm0
lea    0xf06(%rip),%rax
lea    0xf04(%rip),%rcx
cmova  %rax,%rcx
movsd  0xee6(%rip),%xmm1
ucomisd %xmm0,%xmm1
lea    0xee3(%rip),%rax
cmovbe %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"wide\00"
@.str.1 = [5 x i8] c"long\00"
@.str.2 = [7 x i8] c"medium\00"
define i8* @depth_type(double %0) {
%2 = alloca i8*
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 3.001000e-01
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 6.999000e-01
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"wide\00"
@.str.1 = [5 x i8] c"long\00"
@.str.2 = [7 x i8] c"medium\00"
define i8* @depth_type(double %0) {
%2 = fcmp olt double %0, 3.001000e-01
%3 = fcmp ogt double %0, 6.999000e-01
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ __minsfi_syscall_exit(int);
void _exit(int status) { __minsfi_syscall_exit(status); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__minsfi_syscall_exit@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
call   1030 <__minsfi_syscall_exit@plt>

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

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 @__minsfi_syscall_exit(i32 %0)
unreachable
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("EOF = %d\n", EOF);
  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    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"EOF = %d\0A\00"
@EOF = global i32 0
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* @EOF
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"EOF = %d\0A\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int extractVersion(unsigned char version) { return version >> 4; }


x86 assembly (clang, -O0):
<extractVersion>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractVersion>:
shr    $0x4,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @extractVersion(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
define i32 @extractVersion(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = zext i8 %2 to i32
ret i32 %3
}
int guard(int x, int min, int max) {
  if (x < min)
    return min;
  if (x > max)
    return max;
  return x;
}


x86 assembly (clang, -O0):
<guard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <guard+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <guard+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <guard+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <guard+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<guard>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @guard(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %6
store i32 %12, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %21
19: ; preds = %13
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @guard(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
int getc_asciiz(void *context) {
  unsigned char **c = (unsigned char **)context;
  return *(*c)++;
}


x86 assembly (clang, -O0):
<getc_asciiz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc_asciiz>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movzbl (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @getc_asciiz(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %2
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
ret i32 %6
}
int get_offset(int col, int row) { return 2 * (row * 80 + col); }


x86 assembly (clang, -O0):
<get_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_offset>:
lea    (%rsi,%rsi,4),%eax
shl    $0x4,%eax
add    %edi,%eax
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_offset(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 80
%4 = add nsw i32 %3, %0
%5 = shl nsw i32 %4, 1
ret i32 %5
}
mpn_mul_1() {}


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

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

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

LLVM IR (-O2):
define i32 @mpn_mul_1() {
ret i32 undef
}
int main(void) {
  char huge_block[5000 * 1000];
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5000000 x i8]
store i32 0, i32* %1
ret i32 0
}

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