xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ util_shift_right_saturate_n(int, short, int);
int _sshvl(int src2, int src1) {
  short s1;
  if (src1 > 31)
    s1 = 31;
  else if (src1 < -31)
    s1 = -31;
  else
    s1 = src1;
  return (int)util_shift_right_saturate_n(src2, -s1, 32);
}


x86 assembly (clang, -O0):
<_sshvl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jle    1133 <_sshvl+0x23>
movw   $0x1f,-0xa(%rbp)
jmp    1154 <_sshvl+0x44>
cmpl   $0xffffffe1,-0x8(%rbp)
jge    1148 <_sshvl+0x38>
movw   $0xffe1,-0xa(%rbp)
jmp    114f <_sshvl+0x3f>
mov    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
jmp    1154 <_sshvl+0x44>
mov    -0x4(%rbp),%edi
movswl -0xa(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    $0x20,%edx
movswl %ax,%esi
call   1030 <util_shift_right_saturate_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sshvl>:
cmp    $0xffffffe2,%esi
mov    $0xffffffe1,%eax
cmovge %esi,%eax
cmp    $0x1f,%eax
mov    $0x1f,%ecx
cmovl  %eax,%ecx
neg    %ecx
movswl %cx,%esi
mov    $0x20,%edx
jmp    1030 <util_shift_right_saturate_n@plt>

LLVM IR (-O0):
define i32 @_sshvl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 31
br i1 %7, label %8, label %9
8: ; preds = %2
store i16 31, i16* %5
br label %17
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, -31
br i1 %11, label %12, label %13
12: ; preds = %9
store i16 -31, i16* %5
br label %16
13: ; preds = %9
%14 = load i32, i32* %4
%15 = trunc i32 %14 to i16
store i16 %15, i16* %5
br label %16
16: ; preds = %13, %12
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %3
%19 = load i16, i16* %5
%20 = sext i16 %19 to i32
%21 = sub nsw i32 0, %20
%22 = trunc i32 %21 to i16
%23 = call i64 @util_shift_right_saturate_n(i32 %18, i16 signext %22, i32 32)
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @_sshvl(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -31
%4 = select i1 %3, i32 %1, i32 -31
%5 = icmp slt i32 %4, 31
%6 = select i1 %5, i32 %4, i32 31
%7 = trunc i32 %6 to i16
%8 = sub nsw i16 0, %7
%9 = tail call i64 @util_shift_right_saturate_n(i32 %0, i16 signext %8, i32 32)
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char const *, int);
int /*<<< orphan*/ tzset();
int set_unix_time_zone(const char *time_zone) {
  int rv = 0;
  setenv("TZ", time_zone, 1);
  tzset();
  return rv;
}


x86 assembly (clang, -O0):
<set_unix_time_zone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    $0x0,%al
call   1040 <tzset@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_unix_time_zone>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %eax,%eax
call   1040 <tzset@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"TZ\00"
define i32 @set_unix_time_zone(i8* %0) {
%2 = tail call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%3 = tail call i32 (...) @tzset()
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll42(struct __test_metadata *);
void wrapper_epoll42(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll42(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll42>:
jmp    1030 <epoll42@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll42(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll42(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll42(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll42(%struct.__test_metadata* %0)
ret void
}
int test_imm_D8uint32_reg(unsigned int val) {
  return ((val) & (0xD8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D8uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D8uint32_reg(i32 %0) {
%2 = and i32 %0, 216
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char **);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buffer[50];
  printf("buffer is at %p\n", &buffer);
  if (argc > 1)
    strcpy(buffer, argv[1]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1161 <main+0x41>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
cmp    $0x2,%ebp
jl     114b <main+0x2b>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"buffer is at %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [50 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [50 x i8]* %6 to i8**
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %7)
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strcpy(i8* %12, i8* %15)
br label %17
17: ; preds = %11, %2
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"buffer is at %p\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = bitcast [50 x i8]* %3 to i8**
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %5)
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %4, i8* %10)
br label %12
12: ; preds = %8, %2
ret i32 1
}
/* Variables and functions */
int atoi(char *);
char *get_cmdline_prop(char *);
int get_elk_mode() {
  char *elk_mode_prop = get_cmdline_prop("elk_mode");
  int elk_mode = 0;
  if (elk_mode_prop) {
    elk_mode = atoi(elk_mode_prop);
  }
  return elk_mode;
}


x86 assembly (clang, -O0):
<get_elk_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <get_cmdline_prop@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <get_elk_mode+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_elk_mode>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <get_cmdline_prop@plt>
test   %rax,%rax
je     113b <get_elk_mode+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"elk_mode\00"
define i32 @get_elk_mode() {
%1 = tail call i8* @get_cmdline_prop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i8* %1)
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
scalar_t__ h_leapyear(int);
int h_numdays(int month, int year) {
  if (((month % 2) == 1) || ((month == 12) && h_leapyear(year)))
    return (30);
  else
    return (29);
}


x86 assembly (clang, -O0):
<h_numdays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     114e <h_numdays+0x3e>
cmpl   $0xc,-0x8(%rbp)
jne    115a <h_numdays+0x4a>
mov    -0xc(%rbp),%edi
call   1030 <h_leapyear@plt>
cmp    $0x0,%rax
je     115a <h_numdays+0x4a>
movl   $0x1e,-0x4(%rbp)
jmp    1161 <h_numdays+0x51>
movl   $0x1d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_numdays>:
push   %rbx
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
sub    %eax,%ecx
mov    $0x1e,%ebx
cmp    $0x1,%ecx
je     113f <h_numdays+0x2f>
cmp    $0xc,%edi
jne    113a <h_numdays+0x2a>
mov    %esi,%edi
call   1030 <h_leapyear@plt>
test   %rax,%rax
jne    113f <h_numdays+0x2f>
mov    $0x1d,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @h_numdays(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 1
br i1 %8, label %16, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 12
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %5
%14 = call i64 @h_leapyear(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12, %2
store i32 30, i32* %3
br label %18
17: ; preds = %12, %9
store i32 29, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @h_numdays(i32 %0, i32 %1) {
%3 = srem i32 %0, 2
%4 = icmp eq i32 %3, 1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = icmp eq i32 %0, 12
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = tail call i64 @h_leapyear(i32 %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %5
br label %11
11: ; preds = %2, %7, %10
%12 = phi i32 [ 29, %10 ], [ 30, %7 ], [ 30, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void cmdline_parser_print_version(void) {
  printf("%s %s\n", (strlen("imagetag") ? "imagetag" : "imagetag"), "2.0.0");
}


x86 assembly (clang, -O0):
<cmdline_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xec3(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser_print_version>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xeeb(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [9 x i8] c"imagetag\00"
@.str.2 = [6 x i8] c"2.0.0\00"
define void @cmdline_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [9 x i8] c"imagetag\00"
@.str.2 = [6 x i8] c"2.0.0\00"
define void @cmdline_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cndc(char *, unsigned int, char const *, char const *);
void add_route(const char *iface, unsigned int netid, const char *route) {
  cndc("network route add %u %s %s", netid, iface, route);
}


x86 assembly (clang, -O0):
<add_route>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <cndc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_route>:
mov    %rdx,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
jmp    1030 <cndc@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"network route add %u %s %s\00"
define void @add_route(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = call i32 @cndc(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"network route add %u %s %s\00"
define void @add_route(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @cndc(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0, i8* %2)
ret void
}
void progabort_hdlr(void) { asm volatile("nop \n"); }


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

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

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

LLVM IR (-O2):
define void @progabort_hdlr() {
tail call void asm sideeffect "nop \0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct itimerval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct itimerval *);
void _kill_itimerval(struct itimerval *timer) { free(timer); }


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

x86 assembly (clang, -O2):
<_kill_itimerval>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.itimerval = type { i32 }
define void @_kill_itimerval(%struct.itimerval* nocapture %0) {
%2 = tail call i32 @free(%struct.itimerval* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void Header(FILE *out, const char *name) {
  fprintf(out,
          "// Created from bdf2c Version %s, (c) 2009, 2010 by Lutz Sammer\n"
          "//\tLicense AGPLv3: GNU Affero General Public License version 3\n"
          "\n#include \"font.h\"\n\n",
          "3");
  fprintf(out,
          "\t/// character bitmap for each encoding\n"
          "static const unsigned char __%s_bitmap__[] = {\n",
          name);
}


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

x86 assembly (clang, -O2):
<Header>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
lea    0xf6c(%rip),%rdx
call   1030 <fprintf@plt>
lea    0xf62(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [148 x i8] c"// Created from bdf2c Version %s, (c) 2009, 2010 by Lutz Sammer\0A//\09License AGPLv3: GNU Affero General Public License version 3\0A\0A#include \22font.h\22\0A\0A\00"
@.str.1 = [2 x i8] c"3\00"
@.str.2 = [88 x i8] c"\09/// character bitmap for each encoding\0Astatic const unsigned char __%s_bitmap__[] = {\0A\00"
define void @Header(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"// Created from bdf2c Version %s, (c) 2009, 2010 by Lutz Sammer\0A//\09License AGPLv3: GNU Affero General Public License version 3\0A\0A#include \22font.h\22\0A\0A\00"
@.str.1 = [2 x i8] c"3\00"
@.str.2 = [88 x i8] c"\09/// character bitmap for each encoding\0Astatic const unsigned char __%s_bitmap__[] = {\0A\00"
define void @Header(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret void
}
const char *TA_GetVersionDate(void) { return "Mar 18 2022"; }


x86 assembly (clang, -O0):
<TA_GetVersionDate>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TA_GetVersionDate>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Mar 18 2022\00"
define i8* @TA_GetVersionDate() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Mar 18 2022\00"
define i8* @TA_GetVersionDate() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ function_that_overflows();
int main(void) {
  function_that_overflows();
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <function_that_overflows@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <function_that_overflows@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @function_that_overflows()
br label %2
2: ; preds = %0, %2
br label %2
}
void foo427(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo427(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AltitudeHoldSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void AltitudeHoldSettingsUpdated() {
  UAVObjUpdated(AltitudeHoldSettingsHandle());
}


x86 assembly (clang, -O0):
<AltitudeHoldSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AltitudeHoldSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AltitudeHoldSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <AltitudeHoldSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @AltitudeHoldSettingsUpdated() {
%1 = call i32 (...) @AltitudeHoldSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AltitudeHoldSettingsUpdated() {
%1 = tail call i32 (...) @AltitudeHoldSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
double fclean(x)
double x;
{
  static float y;
  y = x;
  return y;
}


x86 assembly (clang, -O0):
<fclean>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2f0a(%rip)
movss  0x2f02(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclean>:
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
@fclean.y = internal global float 0.000000e+00
define double @fclean(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
store float %4, float* @fclean.y
%5 = load float, float* @fclean.y
%6 = fpext float %5 to double
ret double %6
}

LLVM IR (-O2):
define double @fclean(double %0) {
%2 = fptrunc double %0 to float
%3 = fpext float %2 to double
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
struct xaddr {
  int dummy;
};

/* Variables and functions */
int addr_invert(struct xaddr *);
int addr_netmask(int, int /*<<< orphan*/, struct xaddr *);
int addr_hostmask(int af, u_int l, struct xaddr *n) {
  if (addr_netmask(af, l, n) == -1 || addr_invert(n) == -1)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<addr_hostmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <addr_netmask@plt>
cmp    $0xffffffff,%eax
je     115c <addr_hostmask+0x3c>
mov    -0x18(%rbp),%rdi
call   1030 <addr_invert@plt>
cmp    $0xffffffff,%eax
jne    1168 <addr_hostmask+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <addr_hostmask+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_hostmask>:
push   %rbx
mov    %rdx,%rbx
call   1040 <addr_netmask@plt>
cmp    $0xffffffff,%eax
je     1144 <addr_hostmask+0x24>
mov    %rbx,%rdi
call   1030 <addr_invert@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.xaddr = type { i32 }
define i32 @addr_hostmask(i32 %0, i32 %1, %struct.xaddr* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.xaddr*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.xaddr* %2, %struct.xaddr** %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load %struct.xaddr*, %struct.xaddr** %7
%11 = call i32 @addr_netmask(i32 %8, i32 %9, %struct.xaddr* %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %17, label %13
13: ; preds = %3
%14 = load %struct.xaddr*, %struct.xaddr** %7
%15 = call i32 @addr_invert(%struct.xaddr* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %18
17: ; preds = %13, %3
store i32 -1, i32* %4
br label %19
18: ; preds = %13
store i32 0, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.xaddr = type { i32 }
define i32 @addr_hostmask(i32 %0, i32 %1, %struct.xaddr* %2) {
%4 = tail call i32 @addr_netmask(i32 %0, i32 %1, %struct.xaddr* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @addr_invert(%struct.xaddr* %2)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int open(char const *, int);
void test_open(const char *path) {
  int fd;
  fd = open(path, 0x0000);
  if (!fd)
    close(fd);
  fd = open(path, 0x0200);
  if (!fd)
    close(fd);
}


x86 assembly (clang, -O0):
<test_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114c <test_open+0x2c>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rdi
mov    $0x200,%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    116f <test_open+0x4f>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_open>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <open@plt>
test   %eax,%eax
jne    1136 <test_open+0x16>
xor    %edi,%edi
call   1030 <close@plt>
mov    %rbx,%rdi
mov    $0x200,%esi
call   1040 <open@plt>
test   %eax,%eax
je     1149 <test_open+0x29>
pop    %rbx
ret
xor    %edi,%edi
pop    %rbx
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @test_open(i8* nocapture %0) {
%2 = tail call i32 @open(i8* %0, i32 0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @open(i8* %0, i32 512)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @close(i32 0)
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, ...);
int /*<<< orphan*/ stderr;
void error(const char *s1, char *s2) {
  fprintf(stderr, "cvtmail: ");
  fprintf(stderr, s1, s2);
  fprintf(stderr, "\n");
}


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

x86 assembly (clang, -O2):
<error>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ebe(%rip),%r15
mov    (%r15),%edi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xebd(%rip),%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"cvtmail: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"cvtmail: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %0, i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *QRcode_APIVersionString(void) { return 402; }


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

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

LLVM IR (-O0):
define i8* @QRcode_APIVersionString() {
ret i8* inttoptr (i64 402 to i8*)
}

LLVM IR (-O2):
define i8* @QRcode_APIVersionString() {
ret i8* inttoptr (i64 402 to i8*)
}
/* Variables and functions */
size_t next_frame() {
  int idx;
  size_t ret = (size_t)&idx;
  return ret;
}


x86 assembly (clang, -O0):
<next_frame>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_frame>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @next_frame() {
%1 = alloca i32
%2 = alloca i64
%3 = ptrtoint i32* %1 to i64
store i64 %3, i64* %2
%4 = load i64, i64* %2
ret i64 %4
}

LLVM IR (-O2):
define i64 @next_frame() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = ptrtoint i32* %1 to i64
ret i64 %3
}
/* Variables and functions */
int RE_Manipulate(char);
int RE_Copy() { return (RE_Manipulate('c')); }


x86 assembly (clang, -O0):
<RE_Copy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x63,%edi
call   1030 <RE_Manipulate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RE_Copy>:
mov    $0x63,%edi
jmp    1030 <RE_Manipulate@plt>

LLVM IR (-O0):
define i32 @RE_Copy() {
%1 = call i32 @RE_Manipulate(i8 signext 99)
ret i32 %1
}

LLVM IR (-O2):
define i32 @RE_Copy() {
%1 = tail call i32 @RE_Manipulate(i8 signext 99)
ret i32 %1
}
void ReverseGPIOP$0$In$toggle(void) { HplMcs51GeneralIOC$P20$toggle(); }


x86 assembly (clang, -O0):
<ReverseGPIOP$0$In$toggle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HplMcs51GeneralIOC$P20$toggle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseGPIOP$0$In$toggle>:
xor    %eax,%eax
jmp    1030 <HplMcs51GeneralIOC$P20$toggle@plt>

LLVM IR (-O0):
define void @"ReverseGPIOP$0$In$toggle"() {
%1 = call i32 (...) @"HplMcs51GeneralIOC$P20$toggle"()
ret void
}

LLVM IR (-O2):
define void @"ReverseGPIOP$0$In$toggle"() {
%1 = tail call i32 (...) @"HplMcs51GeneralIOC$P20$toggle"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char const *, int);
int /*<<< orphan*/ perror(char const *);
int checked_open(const char *pathname, int flags) {
  int fd = open(pathname, flags);
  if (fd < 0) {
    perror(pathname);
    exit(EXIT_FAILURE);
  }
  return fd;
}


x86 assembly (clang, -O0):
<checked_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    116f <checked_open+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_open>:
push   %rbx
mov    %rdi,%rbx
call   1030 <open@plt>
test   %eax,%eax
js     113f <checked_open+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @checked_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @perror(i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @checked_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n");
  printf("this is the second version. \n");
  printf("i change this file on web to test fetch");
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [30 x i8] c"this is the second version. \0A\00"
@.str.2 = [40 x i8] c"i change this file on web to test fetch\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [40 x i8] c"i change this file on web to test fetch\00"
@str = [12 x i8] c"Hello World\00"
@str.3 = [29 x i8] c"this is the second version. \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int, int, int, int, int);
int main(int argc, char **argv) {
  int exc_rad = 2;
  int N = 8;
  int i;
  for (i = 1; i < 4; i++)
    f(i, 1, exc_rad, 2 * exc_rad + 1, N);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1180 <main+0x60>
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%r8d
mov    $0x1,%esi
call   1030 <f@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <main+0x2b>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
call   1030 <f@plt>
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
call   1030 <f@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 8, i32* %7
store i32 1, i32* %8
br label %9
9: ; preds = %20, %2
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32, i32* %8
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = mul nsw i32 2, %15
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %7
%19 = call i32 @f(i32 %13, i32 1, i32 %14, i32 %17, i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
br label %9
23: ; preds = %9
%24 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f(i32 1, i32 1, i32 2, i32 5, i32 8)
%4 = tail call i32 @f(i32 2, i32 1, i32 2, i32 5, i32 8)
%5 = tail call i32 @f(i32 3, i32 1, i32 2, i32 5, i32 8)
%6 = tail call i32 @exit(i32 0)
unreachable
}
int valueToBinary(int value) { return value % 256; }


x86 assembly (clang, -O0):
<valueToBinary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueToBinary>:
mov    %edi,%eax
lea    0xff(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @valueToBinary(i32 %0) {
%2 = srem i32 %0, 256
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ComparatorIntClear(uint32_t ui32Base, uint32_t ui32Comp) {
  ASSERT(ui32Base == 0x4003C000);
  ASSERT(ui32Comp < 3);
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = 1 << ui32Comp;
}


x86 assembly (clang, -O0):
<ComparatorIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x4003c000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x3,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntClear>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x4003c000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x3,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
movslq %ebp,%rcx
mov    %eax,(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ComparatorIntClear(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 = icmp eq i32 %5, 1073987584
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %4
%14 = shl i32 1, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 0
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @ComparatorIntClear(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1073987584
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp slt i32 %1, 3
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = shl nuw i32 1, %1
%10 = sext i32 %0 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %9, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lirerr(int);
int strlen(char *);
void blankfill_ugmsg(char *msg) {
  int i;
  i = strlen(msg);
  if (i >= 30)
    lirerr(3413400);
  while (i < 30 - 1) {
    msg[i] = ' ';
    i++;
  }
  msg[30 - 1] = 0;
}


x86 assembly (clang, -O0):
<blankfill_ugmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jl     114c <blankfill_ugmsg+0x2c>
mov    $0x341598,%edi
call   1040 <lirerr@plt>
jmp    1151 <blankfill_ugmsg+0x31>
cmpl   $0x1d,-0xc(%rbp)
jge    1175 <blankfill_ugmsg+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <blankfill_ugmsg+0x31>
mov    -0x8(%rbp),%rax
movb   $0x0,0x1d(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankfill_ugmsg>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x1e,%eax
jl     114a <blankfill_ugmsg+0x1a>
mov    $0x341598,%edi
call   1050 <lirerr@plt>
jmp    116a <blankfill_ugmsg+0x3a>
cmp    $0x1d,%eax
je     116a <blankfill_ugmsg+0x3a>
movslq %eax,%rdi
add    %rbx,%rdi
mov    $0x1c,%edx
sub    %eax,%edx
add    $0x1,%rdx
mov    $0x20,%esi
call   1040 <memset@plt>
movb   $0x0,0x1d(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @blankfill_ugmsg(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 30
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @lirerr(i32 3413400)
br label %10
10: ; preds = %8, %1
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 29
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 32, i8* %18
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %11
21: ; preds = %11
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 29
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @blankfill_ugmsg(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 29
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lirerr(i32 3413400)
br label %14
6: ; preds = %1
%7 = icmp eq i32 %2, 29
br i1 %7, label %14, label %8
8: ; preds = %6
%9 = sext i32 %2 to i64
%10 = getelementptr i8, i8* %0, i64 %9
%11 = sub i32 28, %2
%12 = zext i32 %11 to i64
%13 = add nuw nsw i64 %12, 1
br label %14
14: ; preds = %4, %8, %6
%15 = getelementptr inbounds i8, i8* %0, i64 29
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int nwd(int, int);
int nww(int a, int b) { return a / nwd(a, b) * b; }


x86 assembly (clang, -O0):
<nww>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <nwd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
imul   -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nww>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <nwd@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
imul   %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nww(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* %3
%7 = load i32, i32* %4
%8 = call i32 @nwd(i32 %6, i32 %7)
%9 = sdiv i32 %5, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @nww(i32 %0, i32 %1) {
%3 = tail call i32 @nwd(i32 %0, i32 %1)
%4 = sdiv i32 %0, %3
%5 = mul nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
char *grecs_malloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *grecs_strdup(const char *str) {
  char *newstr = grecs_malloc(strlen(str) + 1);
  return strcpy(newstr, str);
}


x86 assembly (clang, -O0):
<grecs_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 <grecs_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grecs_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <grecs_malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @grecs_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* @grecs_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @grecs_strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @grecs_malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t max_u64(uint64_t a, uint64_t b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max_u64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_u64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_u64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max_u64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max_u64(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}