xunge/DecIR huggingface dataset:
/* Variables and functions */
double pow(double, int);
double strength_edge(double ew1, double ew2, double nw) {
  return 1.0 * pow(nw, 2) / (ew1 * ew2);
}


x86 assembly (clang, -O0):
<strength_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_edge>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @strength_edge(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* %6
%8 = call double @pow(double %7, i32 2)
%9 = fmul double 1.000000e+00, %8
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @strength_edge(double %0, double %1, double %2) {
%4 = tail call double @pow(double %2, i32 2)
%5 = fmul double %0, %1
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int irc_printf(int, char *, char const *);
int irc_quit(int fd, const char *quitmsg) {
  return irc_printf(fd, "QUIT :%s\r\n", quitmsg);
}


x86 assembly (clang, -O0):
<irc_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <irc_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_quit>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <irc_printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"QUIT :%s\0D\0A\00"
define i32 @irc_quit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @irc_printf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"QUIT :%s\0D\0A\00"
define i32 @irc_quit(i32 %0, i8* %1) {
%3 = tail call i32 @irc_printf(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/, int);
int main() {
  f(0, 42);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0, i32 42)
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR7B_get(void) { return U_WMRCORENONE_get("U_WMR7B"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR7B\00"
define i32 @U_WMR7B_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR7B\00"
define i32 @U_WMR7B_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
void init_pit(void) {
  io_out8(0x0043, 0x34);
  io_out8(0x0040, 0x9c);
  io_out8(0x0040, 0x2e);
  return;
}


x86 assembly (clang, -O0):
<init_pit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <io_out8@plt>
mov    $0x40,%edi
mov    $0x9c,%esi
call   1030 <io_out8@plt>
mov    $0x40,%edi
mov    $0x2e,%esi
call   1030 <io_out8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_pit>:
push   %rax
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <io_out8@plt>
mov    $0x40,%edi
mov    $0x9c,%esi
call   1030 <io_out8@plt>
mov    $0x40,%edi
mov    $0x2e,%esi
pop    %rax
jmp    1030 <io_out8@plt>

LLVM IR (-O0):
define void @init_pit() {
%1 = call i32 @io_out8(i32 67, i32 52)
%2 = call i32 @io_out8(i32 64, i32 156)
%3 = call i32 @io_out8(i32 64, i32 46)
ret void
}

LLVM IR (-O2):
define void @init_pit() {
%1 = tail call i32 @io_out8(i32 67, i32 52)
%2 = tail call i32 @io_out8(i32 64, i32 156)
%3 = tail call i32 @io_out8(i32 64, i32 46)
ret void
}
void delay(x) int x;
{
  int y = 17;
  while (x-- != 0)
    y = y ^ 2;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1130 <delay+0x30>
mov    -0x8(%rbp),%eax
xor    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 17, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = xor i32 %9, 2
store i32 %10, i32* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
double f4_cb_send_pre_int_int_long(double (*cb)(int, int, long)) {
  long r = 33;
  return cb(8, 9, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    $0x8,%edi
mov    $0x9,%esi
call   *%rax
movsd  0xed0(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_long>:
push   %rax
mov    %rdi,%rax
mov    $0x21,%edx
mov    $0x8,%edi
mov    $0x9,%esi
call   *%rax
addsd  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_long(double (i32, i32, i64)* %0) {
%2 = alloca double (i32, i32, i64)*
%3 = alloca i64
store double (i32, i32, i64)* %0, double (i32, i32, i64)** %2
store i64 33, i64* %3
%4 = load double (i32, i32, i64)*, double (i32, i32, i64)** %2
%5 = load i64, i64* %3
%6 = call double %4(i32 8, i32 9, i64 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_long(double (i32, i32, i64)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i64 33)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int isExactSquare(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", isExactSquare(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @isExactSquare(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct FormatType {
  int dummy;
};

/* Variables and functions */
scalar_t__ dirfile_read_channel(unsigned char, struct FormatType const *,
                                char const *, int *);
uint32_t *dirfile_read_uint32_channel(const struct FormatType *F,
                                      const char *channelname, int *nsamples) {
  return (uint32_t *)dirfile_read_channel('U', F, channelname, nsamples);
}


x86 assembly (clang, -O0):
<dirfile_read_uint32_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x55,%edi
call   1030 <dirfile_read_channel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirfile_read_uint32_channel>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x55,%edi
jmp    1030 <dirfile_read_channel@plt>

LLVM IR (-O0):
%struct.FormatType = type { i32 }
define i32* @dirfile_read_uint32_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = alloca %struct.FormatType*
%5 = alloca i8*
%6 = alloca i32*
store %struct.FormatType* %0, %struct.FormatType** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load %struct.FormatType*, %struct.FormatType** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i64 @dirfile_read_channel(i8 zeroext 85, %struct.FormatType* %7, i8* %8, i32* %9)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
%struct.FormatType = type { i32 }
define i32* @dirfile_read_uint32_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = tail call i64 @dirfile_read_channel(i8 zeroext 85, %struct.FormatType* %0, i8* %1, i32* %2)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void f_empty_goto_loop_multiple_semicolon_both() {
f_empty_goto_loop_multiple_semicolon_both_label_1:;
  goto f_empty_goto_loop_multiple_semicolon_both_label_2;
f_empty_goto_loop_multiple_semicolon_both_label_2:;
  goto f_empty_goto_loop_multiple_semicolon_both_label_1;
}


x86 assembly (clang, -O0):
<f_empty_goto_loop_multiple_semicolon_both>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f_empty_goto_loop_multiple_semicolon_both+0x9>
jmp    110e <f_empty_goto_loop_multiple_semicolon_both+0xe>
jmp    1109 <f_empty_goto_loop_multiple_semicolon_both+0x9>

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

LLVM IR (-O0):
define void @f_empty_goto_loop_multiple_semicolon_both() {
br label %1
1: ; preds = %2, %0
br label %2
2: ; preds = %1
br label %1
}

LLVM IR (-O2):
define void @f_empty_goto_loop_multiple_semicolon_both() {
br label %1
1: ; preds = %1, %0
br label %1
}
int baz() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @baz() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_racket_empty_string() {
  test_parser_verify_parse(test_parser_sourcefile("racket", "\"\""), "racket",
                           "\"\"", "", 0);
}


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

x86 assembly (clang, -O2):
<test_racket_empty_string>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed5(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"racket\00"
@.str.1 = [3 x i8] c"\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_racket_empty_string() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"racket\00"
@.str.1 = [3 x i8] c"\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_racket_empty_string() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
void MSP430TimerM$CompareB4$fired(void) {
  MSP430TimerM$CompareB4$default$fired();
}


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

x86 assembly (clang, -O2):
<MSP430TimerM$CompareB4$fired>:
xor    %eax,%eax
jmp    1030 <MSP430TimerM$CompareB4$default$fired@plt>

LLVM IR (-O0):
define void @"MSP430TimerM$CompareB4$fired"() {
%1 = call i32 (...) @"MSP430TimerM$CompareB4$default$fired"()
ret void
}

LLVM IR (-O2):
define void @"MSP430TimerM$CompareB4$fired"() {
%1 = tail call i32 (...) @"MSP430TimerM$CompareB4$default$fired"()
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int64_t cfs_stub_lremovexattr(const char *path, const char *name) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<cfs_stub_lremovexattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_stub_lremovexattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_lremovexattr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_lremovexattr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int mod(int n, int m) { return (n % m); }


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

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

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int emac2_arxpausemacctrlframes_set(
    unsigned int dev_id, union emac2_arxpausemacctrlframes_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_arxpausemacctrlframes_u = type opaque
define i32 @emac2_arxpausemacctrlframes_set(i32 %0, %union.emac2_arxpausemacctrlframes_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_arxpausemacctrlframes_u*
store i32 %0, i32* %3
store %union.emac2_arxpausemacctrlframes_u* %1, %union.emac2_arxpausemacctrlframes_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_arxpausemacctrlframes_u = type opaque
define i32 @emac2_arxpausemacctrlframes_set(i32 %0, %union.emac2_arxpausemacctrlframes_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_exit(char *msg) {
  fprintf(stderr, "Error: %s\n", msg);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x0a() {
  Assert_real((isupper(10) == 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_isupper.c",
              55, ("isupper should be 0 for 0x0a"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x0a>:
push   %rax
mov    $0xa,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x0a\00"
define void @t_isupper_0x0a() {
%1 = call i64 @isupper(i32 10)
%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 55, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x0a\00"
define void @t_isupper_0x0a() {
%1 = tail call i64 @isupper(i32 10)
%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 55, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void print_buffer(const char *buffer, int size) {}


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

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

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

LLVM IR (-O2):
define void @print_buffer(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double M_PI;
double cos(double);
double Q_v_gradp(double L, double a_py, double p_y, double y) {
  return M_PI * a_py * p_y * cos(M_PI * a_py * y / L) / L;
}


x86 assembly (clang, -O0):
<Q_v_gradp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e9b(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_v_gradp>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mulsd  (%rax),%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <cos@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @Q_v_gradp(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = load double, double* @M_PI
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = load double, double* %8
%18 = fmul double %16, %17
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = call double @cos(double %20)
%22 = fmul double %13, %21
%23 = load double, double* %5
%24 = fdiv double %22, %23
ret double %24
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @Q_v_gradp(double %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fmul double %5, %1
%7 = fmul double %6, %2
%8 = fmul double %6, %3
%9 = fdiv double %8, %0
%10 = tail call double @cos(double %9)
%11 = fmul double %10, %7
%12 = fdiv double %11, %0
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ _message(char const *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void warning(const char *msg) { _message(msg, 0, stderr); }


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <_message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <_message@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @_message(i8* %3, i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @_message(i8* %0, i32 0, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ lseek(int, int /*<<< orphan*/, int);
int tor_fd_seekend(int fd) { return lseek(fd, 0, 2) < 0 ? -1 : 0; }


x86 assembly (clang, -O0):
<tor_fd_seekend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <lseek@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_fd_seekend>:
push   %rax
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <lseek@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tor_fd_seekend(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @lseek(i32 %3, i32 0, i32 2)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @tor_fd_seekend(i32 %0) {
%2 = tail call i64 @lseek(i32 %0, i32 0, i32 2)
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char);
void uart_puts(char *s) {
  int index = 0;
  while (s[index] != '\0') {
    uart_putc(s[index]);
    index++;
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <uart_puts+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uart_puts+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_puts(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 i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @uart_putc(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
void pauseme(void) {
  while (!getchar())
    ;
}


x86 assembly (clang, -O0):
<pauseme>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <pauseme+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <pauseme+0x25>
jmp    113a <pauseme+0x2a>
jmp    1119 <pauseme+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pauseme>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
test   %eax,%eax
je     1120 <pauseme+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @pauseme() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @getchar()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @pauseme() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ xkey;
};
typedef TYPE_1__ XEvent;
typedef scalar_t__ KeySym;

/* Variables and functions */
scalar_t__ XK_Escape;
int /*<<< orphan*/ XLookupString(int /*<<< orphan*/ *, char *, int,
                                 scalar_t__ *, int /*<<< orphan*/ *);
bool onKeyPress(XEvent *e) {
  static char buf[128] = {0};
  KeySym keysym;
  XLookupString(&e->xkey, buf, sizeof buf, &keysym, NULL);
  return (keysym == XK_Escape);
}


x86 assembly (clang, -O0):
<onKeyPress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f19(%rip),%rsi
mov    $0x80,%edx
lea    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <XLookupString@plt>
mov    -0x10(%rbp),%rax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onKeyPress>:
push   %rax
lea    0x2f28(%rip),%rsi
mov    %rsp,%rcx
mov    $0x80,%edx
xor    %r8d,%r8d
call   1030 <XLookupString@plt>
mov    (%rsp),%rcx
mov    0x2ead(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@onKeyPress.buf = internal global [128 x i8] zeroinitializer
@XK_Escape = global i64 0
define i32 @onKeyPress(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
%3 = alloca i64
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%4 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%6 = call i32 @XLookupString(i32* %5, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @onKeyPress.buf, i64 0, i64 0), i32 128, i64* %3, i32* null)
%7 = load i64, i64* %3
%8 = load i64, i64* @XK_Escape
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@onKeyPress.buf = internal global [128 x i8] zeroinitializer
@XK_Escape = global i64 0
define i32 @onKeyPress(%struct.TYPE_3__* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = call i32 @XLookupString(i32* %4, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @onKeyPress.buf, i64 0, i64 0), i32 128, i64* %2, i32* null)
%6 = load i64, i64* %2
%7 = load i64, i64* @XK_Escape
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
void foo182() {}


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

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

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

LLVM IR (-O2):
define void @foo182() {
ret void
}
/* Variables and functions */
int INT_MAX;
int INT_MIN;
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n = INT_MIN;
  char s[256];
  printf("%d,%d\n", n, INT_MAX);
  itoa(n, s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x110(%rbp),%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    0x2e9f(%rip),%rax
mov    (%rax),%ebx
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
lea    0xead(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r14
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <itoa@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [7 x i8] c"%d,%d\0A\00"
@INT_MAX = global i32 0
define i32 @main() {
%1 = alloca [256 x i8]
%2 = load i32, i32* @INT_MIN
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @INT_MAX
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%6 = call i32 @itoa(i32 %2, i8* %3)
%7 = call i32 @puts(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *progname) {
  printf("Usage:\n"
         "%s [-d] [-v 1|0] [-w offset=value] [-r offset] [-x start end]\n"
         "\t-v  Start (or stop) regutil from using virtual memory\n"
         "\t-d  Dump all known registers\n"
         "\t-w  Set the register at offset [offset] to [value]\n"
         "\t-s  Set the bits in the register at offset [offset] to [value]\n"
         "\t-c  Clear the bits in the register at offset [offset] to [value]\n"
         "\t-r  Return the register at offset [offset]\n"
         "\t-x  Dump data from offset [start] to [end] inclusive\n"
         "\t-h  This help message\n"
         "",
         progname);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [458 x i8] c"Usage:\0A%s [-d] [-v 1|0] [-w offset=value] [-r offset] [-x start end]\0A\09-v Start (or stop) regutil from using virtual memory\0A\09-d Dump all known registers\0A\09-w Set the register at offset [offset] to [value]\0A\09-s Set the bits in the register at offset [offset] to [value]\0A\09-c Clear the bits in the register at offset [offset] to [value]\0A\09-r Return the register at offset [offset]\0A\09-x Dump data from offset [start] to [end] inclusive\0A\09-h This help message\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([458 x i8], [458 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [458 x i8] c"Usage:\0A%s [-d] [-v 1|0] [-w offset=value] [-r offset] [-x start end]\0A\09-v Start (or stop) regutil from using virtual memory\0A\09-d Dump all known registers\0A\09-w Set the register at offset [offset] to [value]\0A\09-s Set the bits in the register at offset [offset] to [value]\0A\09-c Clear the bits in the register at offset [offset] to [value]\0A\09-r Return the register at offset [offset]\0A\09-x Dump data from offset [start] to [end] inclusive\0A\09-h This help message\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([458 x i8], [458 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
unsigned int __VERIFIER_nondet_uint();
int main() {
  int sn = 0;
  unsigned int loop1 = __VERIFIER_nondet_uint(), n1 = __VERIFIER_nondet_uint();
  unsigned int x = 0;
  while (1) {
    sn = sn + 1;
    x++;
    __VERIFIER_assert(sn == x * 1 || sn == 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x14(%rbp),%edx
shl    $0x0,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
je     1183 <main+0x63>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
jmp    1151 <main+0x31>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_uint@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_uint@plt>
nop
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_uint()
%2 = tail call i32 (...) @__VERIFIER_nondet_uint()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 @__VERIFIER_assert(i32 1)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printPowerSet(char *, int);
int main() {
  char set[] = {'a', 'b', 'c'};
  printPowerSet(set, 3);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x7(%rbp),%rdi
mov    $0x3,%esi
call   1040 <printPowerSet@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x63,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1040 <printPowerSet@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.set = [3 x i8] c"abc"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
store i32 0, i32* %1
%3 = bitcast [3 x i8]* %2 to i8*
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @printPowerSet(i8* %4, i32 3)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.set = [3 x i8] c"abc"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @printPowerSet(i8* %2, i32 3)
%4 = call i32 (...) @getchar()
ret i32 0
}
void swapLongs(long *a, long *b) {
  long temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<swapLongs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swapLongs(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
store i64 %3, i64* %1
ret void
}
int foo(int a[10]) {}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t _get16be(void *p) {
  uint8_t *b = p;
  return (b[0] << 8) | b[1];
}


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

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

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

LLVM IR (-O2):
define i32 @_get16be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
double Function_constant(double value, void *doubleConstantP) {
  assert(doubleConstantP);
  double *constantP = doubleConstantP;
  return *constantP;
}


x86 assembly (clang, -O0):
<Function_constant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function_constant>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
movsd  (%rbx),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @Function_constant(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca double*
store double %0, double* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %5
%10 = load double*, double** %5
%11 = load double, double* %10
ret double %11
}

LLVM IR (-O2):
define double @Function_constant(double %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = bitcast i8* %1 to double*
%5 = load double, double* %4
ret double %5
}
void _func(int x) {}


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

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

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

LLVM IR (-O2):
define void @_func(i32 %0) {
ret void
}
/* Variables and functions */
char toupper(char);
int base2num(char c) {
  char cc;
  cc = toupper(c);
  switch (cc) {
  case 'A':
    return 0;
    break;
  case 'C':
    return 1;
    break;
  case 'G':
    return 2;
    break;
  case 'T':
    return 3;
    break;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<base2num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1184 <base2num+0x74>
mov    -0x10(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    118b <base2num+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    118b <base2num+0x7b>
movl   $0x2,-0x4(%rbp)
jmp    118b <base2num+0x7b>
movl   $0x3,-0x4(%rbp)
jmp    118b <base2num+0x7b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base2num>:
push   %rax
call   1030 <toupper@plt>
movsbl %al,%ecx
add    $0xffffffbf,%ecx
cmp    $0x13,%ecx
ja     113a <base2num+0x2a>
xor    %eax,%eax
lea    0xed6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    $0x2,%eax
pop    %rcx
ret
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @base2num(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = call signext i8 @toupper(i8 signext %5)
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
switch i32 %8, label %13 [
i32 65, label %9
i32 67, label %10
i32 71, label %11
i32 84, label %12
]
9: ; preds = %1
store i32 0, i32* %2
br label %14
10: ; preds = %1
store i32 1, i32* %2
br label %14
11: ; preds = %1
store i32 2, i32* %2
br label %14
12: ; preds = %1
store i32 3, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @base2num(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 signext %0)
%3 = sext i8 %2 to i32
switch i32 %3, label %7 [
i32 65, label %8
i32 67, label %4
i32 71, label %5
i32 84, label %6
]
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4
%9 = phi i32 [ -1, %7 ], [ 3, %6 ], [ 2, %5 ], [ 1, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ die_errno(char *);
int listen(int, int);
void xlisten(int fd, int backlog) {
  if (listen(fd, backlog) == -1)
    die_errno("listen");
}


x86 assembly (clang, -O0):
<xlisten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
jne    114e <xlisten+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <die_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlisten>:
push   %rax
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
je     112d <xlisten+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <die_errno@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"listen\00"
define void @xlisten(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 @listen(i32 %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @die_errno(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

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