xunge/DecIR huggingface dataset:
char get_opposite_letter(char c) {
  char middle = 'a' + (('z' - 'a') / 2);
  char letter_distance_from_middle = middle - c;
  middle++;
  return letter_distance_from_middle + middle;
}


x86 assembly (clang, -O0):
<get_opposite_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x6d,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
movsbl -0x3(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_opposite_letter>:
mov    $0xdb,%al
sub    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @get_opposite_letter(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
store i8 109, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %3
%12 = add i8 %11, 1
store i8 %12, i8* %3
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = add nsw i32 %14, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @get_opposite_letter(i8 signext %0) {
%2 = sub i8 -37, %0
ret i8 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getargs(int, char *const *);
int /*<<< orphan*/ sync();
int main(int argc, char *const argv[]) {
  getargs(argc, argv);
  sync();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <getargs@plt>
mov    $0x0,%al
call   1030 <sync@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <getargs@plt>
xor    %eax,%eax
call   1030 <sync@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @getargs(i32 %6, i8** %7)
%9 = call i32 (...) @sync()
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getargs(i32 %0, i8** %1)
%4 = tail call i32 (...) @sync()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int clear_msb(int number, int i) { return number & ((1 << i) - 1); }


x86 assembly (clang, -O0):
<clear_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_msb>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clear_msb(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int ssds_get_gen_name(int, char *, char *, char *, char *, int);
int ssds_get_field_type(int pcfd, char *full_def, char *res, int len) {
  return ssds_get_gen_name(pcfd, full_def, "gf", "f_type", res, len);
}


x86 assembly (clang, -O0):
<ssds_get_field_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xec4(%rip),%rdx
lea    0xec0(%rip),%rcx
call   1030 <ssds_get_gen_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_field_type>:
mov    %ecx,%r9d
mov    %rdx,%r8
lea    0xee3(%rip),%rdx
lea    0xedf(%rip),%rcx
jmp    1030 <ssds_get_gen_name@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gf\00"
@.str.1 = [7 x i8] c"f_type\00"
define i32 @ssds_get_field_type(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ssds_get_gen_name(i32 %9, i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"gf\00"
@.str.1 = [7 x i8] c"f_type\00"
define i32 @ssds_get_field_type(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @ssds_get_gen_name(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %3)
ret i32 %5
}
void avcodec_get_hw_frames_parameters() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_get_hw_frames_parameters() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x13_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x13_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x13_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x13_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x13_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
int f(int *i) {
  if (i)
    return *i;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1121 <f+0x21>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <f+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %rdi,%rdi
je     1108 <f+0x8>
mov    (%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* %0
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int wait(int *status) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
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 @wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
int do_775() { return 775; }


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

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

LLVM IR (-O0):
define i32 @do_775() {
ret i32 775
}

LLVM IR (-O2):
define i32 @do_775() {
ret i32 775
}
/* Variables and functions */
scalar_t__ malloc(int);
char *int_to_chars(int n) {
  char *bytes;
  bytes = (char *)malloc(4 * sizeof(char));
  bytes[0] = (n >> 24) & 0xFF;
  bytes[1] = (n >> 16) & 0xFF;
  bytes[2] = (n >> 8) & 0xFF;
  bytes[3] = n & 0xFF;
  return bytes;
}


x86 assembly (clang, -O0):
<int_to_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_chars>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
bswap  %ebx
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @int_to_chars(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = ashr i32 %6, 24
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i32, i32* %2
%19 = ashr i32 %18, 8
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = load i32, i32* %2
%25 = and i32 %24, 255
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @int_to_chars(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i8*
%4 = lshr i32 %0, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = lshr i32 %0, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %0, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %0 to i8
%13 = getelementptr inbounds i8, i8* %3, i64 3
store i8 %12, i8* %13
ret i8* %3
}
/* Variables and functions */
int japi_getstate(int);
int j_getstate(int arg0) { return (japi_getstate(arg0)); }


x86 assembly (clang, -O0):
<j_getstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <japi_getstate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_getstate>:
jmp    1030 <japi_getstate@plt>

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

LLVM IR (-O2):
define i32 @j_getstate(i32 %0) {
%2 = tail call i32 @japi_getstate(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *create_list_files_message(void) {
  char *msg = malloc(sizeof(char) * (1 + strlen(((const char *)"listfiles"))));
  strcpy(msg, ((const char *)"listfiles"));
  return msg;
}


x86 assembly (clang, -O0):
<create_list_files_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"listfiles\00"
define i8* @create_list_files_message() {
%1 = alloca i8*
%2 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = add nsw i32 1, %2
%4 = sext i32 %3 to i64
%5 = mul i64 1, %4
%6 = trunc i64 %5 to i32
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"listfiles\00"
define i8* @create_list_files_message() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = add nsw i32 %1, 1
%3 = tail call i8* @malloc(i32 %2)
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
struct hwtest_ctx {
  int dummy;
};

/* Variables and functions */
int nv50_ptherm_prep(struct hwtest_ctx *);
int nv50_sensor_calibration_prep(struct hwtest_ctx *ctx) {
  return nv50_ptherm_prep(ctx);
}


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

x86 assembly (clang, -O2):
<nv50_sensor_calibration_prep>:
jmp    1030 <nv50_ptherm_prep@plt>

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

LLVM IR (-O2):
%struct.hwtest_ctx = type { i32 }
define i32 @nv50_sensor_calibration_prep(%struct.hwtest_ctx* %0) {
%2 = tail call i32 @nv50_ptherm_prep(%struct.hwtest_ctx* %0)
ret i32 %2
}
int assign_arg_ptr(int *p) {
  int *q;
  __builtin_prefetch((q = p), 0, 0);
  return q == p;
}


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

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

LLVM IR (-O0):
define i32 @assign_arg_ptr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
%5 = bitcast i32* %4 to i8*
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = icmp eq i32* %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @assign_arg_ptr(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 0, i32 1)
ret i32 1
}
/* Variables and functions */
scalar_t__ isalpha(char);
char is_ident(char chr) { return (isalpha(chr)) || (chr == '_'); }


x86 assembly (clang, -O0):
<is_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <is_ident+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ident>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %cl
cmp    $0x5f,%bl
sete   %al
or     %cl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @is_ident(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @is_ident(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Type definitions */
struct sysinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_sysinfo;
int syscall(int /*<<< orphan*/, struct sysinfo *);
int sysinfo(struct sysinfo *info) { return syscall(__NR_sysinfo, info); }


x86 assembly (clang, -O0):
<sysinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysinfo>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.sysinfo = type { i32 }
@__NR_sysinfo = global i32 0
define i32 @sysinfo(%struct.sysinfo* %0) {
%2 = alloca %struct.sysinfo*
store %struct.sysinfo* %0, %struct.sysinfo** %2
%3 = load i32, i32* @__NR_sysinfo
%4 = load %struct.sysinfo*, %struct.sysinfo** %2
%5 = call i32 @syscall(i32 %3, %struct.sysinfo* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.sysinfo = type { i32 }
@__NR_sysinfo = global i32 0
define i32 @sysinfo(%struct.sysinfo* %0) {
%2 = load i32, i32* @__NR_sysinfo
%3 = tail call i32 @syscall(i32 %2, %struct.sysinfo* %0)
ret i32 %3
}
main(argc, argv) int argc;
char *argv[];
{
  void initializeStuff();
  initializeStuff(argc, argv);
  yyparse();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
tail call void (i32, i8**, ...) bitcast (void (...)* @initializeStuff to void (i32, i8**, ...)*)(i32 %0, i8** %1)
%3 = tail call i32 (...) @yyparse()
ret i32 0
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ rp_fatal(char *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strDup(char const *str) {
  char *copy = malloc(strlen(str) + 1);
  if (!copy) {
    rp_fatal("strdup failed");
  }
  strcpy(copy, str);
  return copy;
}


x86 assembly (clang, -O0):
<strDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117c <strDup+0x3c>
lea    0xe89(%rip),%rdi
call   1040 <rp_fatal@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strDup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1169 <strDup+0x29>
lea    0xe9c(%rip),%rdi
call   1040 <rp_fatal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"strdup failed\00"
define i8* @strDup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 @rp_fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [14 x i8] c"strdup failed\00"
define i8* @strDup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @rp_fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
double pow(double, double);
double tosReal_pow(double x, double y) { return pow(x, y); }


x86 assembly (clang, -O0):
<tosReal_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosReal_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @tosReal_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @tosReal_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
void cdns3_host_exit(struct cdns3 *cdns) {}


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

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

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

LLVM IR (-O2):
%struct.cdns3 = type opaque
define void @cdns3_host_exit(%struct.cdns3* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t sha512_LOAD64_BE(const uint8_t *p) {
  return ((uint64_t)p[0] << 56) | ((uint64_t)p[1] << 48) |
         ((uint64_t)p[2] << 40) | ((uint64_t)p[3] << 32) |
         ((uint64_t)p[4] << 24) | ((uint64_t)p[5] << 16) |
         ((uint64_t)p[6] << 8) | ((uint64_t)p[7]);
}


x86 assembly (clang, -O0):
<sha512_LOAD64_BE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    %ecx,%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
mov    %ecx,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x20(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x30(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x38(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sha512_LOAD64_BE(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 56
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 48
%13 = or i32 %7, %12
%14 = load i64*, i64** %2
%15 = getelementptr inbounds i64, i64* %14, i64 2
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 40
%19 = or i32 %13, %18
%20 = load i64*, i64** %2
%21 = getelementptr inbounds i64, i64* %20, i64 3
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = shl i32 %23, 32
%25 = or i32 %19, %24
%26 = load i64*, i64** %2
%27 = getelementptr inbounds i64, i64* %26, i64 4
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = shl i32 %29, 24
%31 = or i32 %25, %30
%32 = load i64*, i64** %2
%33 = getelementptr inbounds i64, i64* %32, i64 5
%34 = load i64, i64* %33
%35 = trunc i64 %34 to i32
%36 = shl i32 %35, 16
%37 = or i32 %31, %36
%38 = load i64*, i64** %2
%39 = getelementptr inbounds i64, i64* %38, i64 6
%40 = load i64, i64* %39
%41 = trunc i64 %40 to i32
%42 = shl i32 %41, 8
%43 = or i32 %37, %42
%44 = load i64*, i64** %2
%45 = getelementptr inbounds i64, i64* %44, i64 7
%46 = load i64, i64* %45
%47 = trunc i64 %46 to i32
%48 = or i32 %43, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @sha512_LOAD64_BE(i64* nocapture readnone %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello!\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int fun694() { return 694; }


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

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

LLVM IR (-O0):
define i32 @fun694() {
ret i32 694
}

LLVM IR (-O2):
define i32 @fun694() {
ret i32 694
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t hash(uint64_t father, uint8_t c) {
  int ris = ((father << 8) + c) % 78644;
  return ris;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
add    -0x8(%rbp),%eax
mov    $0x13334,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
shl    $0x8,%edi
add    %esi,%edi
movslq %edi,%rax
imul   $0x6aaa638f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2f,%rcx
add    %edx,%ecx
imul   $0x13334,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = srem i32 %9, 78644
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, 78644
ret i32 %5
}
int y(int a) { return -(-1 * -a); }


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

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

LLVM IR (-O0):
define i32 @y(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = mul nsw i32 -1, %4
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @y(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ accept_image();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ show_html_page(char *);
int main() {
  if (accept_image())
    show_html_page("/index-txt.html");
  else
    show_html_page("/index-img.html");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <accept_image@plt>
cmp    $0x0,%rax
je     1161 <main+0x31>
lea    0xea9(%rip),%rdi
call   1040 <show_html_page@plt>
jmp    116d <main+0x3d>
lea    0xea8(%rip),%rdi
call   1040 <show_html_page@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <accept_image@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xeb7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <show_html_page@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/index-txt.html\00"
@.str.1 = [16 x i8] c"/index-img.html\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @accept_image()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @show_html_page(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @show_html_page(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"/index-txt.html\00"
@.str.1 = [16 x i8] c"/index-img.html\00"
define i32 @main() {
%1 = tail call i64 (...) @accept_image()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @show_html_page(i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ call_drv_clean_test_env();
void cleanup_test_environment() { call_drv_clean_test_env(); }


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

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

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

LLVM IR (-O2):
define void @cleanup_test_environment() {
%1 = tail call i32 (...) @call_drv_clean_test_env()
ret void
}
/* Variables and functions */
int Q_isalpha(int c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<Q_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     111b <Q_isalpha+0x1b>
cmpl   $0x7a,-0x8(%rbp)
jle    112f <Q_isalpha+0x2f>
cmpl   $0x41,-0x8(%rbp)
jl     113b <Q_isalpha+0x3b>
cmpl   $0x5a,-0x8(%rbp)
jg     113b <Q_isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <Q_isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @Q_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %15, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 90
br i1 %14, label %15, label %16
15: ; preds = %12, %6
store i32 1, i32* %2
br label %17
16: ; preds = %12, %9
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @Q_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int isNewLineChars(const char *ccp_input, const size_t i_offset) {
  return (ccp_input[i_offset] == '\n' ? 0 : -1);
}


x86 assembly (clang, -O0):
<isNewLineChars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0xa,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNewLineChars>:
xor    %eax,%eax
cmpb   $0xa,(%rdi,%rsi,1)
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @isNewLineChars(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 10
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 -1
ret i32 %12
}

LLVM IR (-O2):
define i32 @isNewLineChars(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 10
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xae() {
  Assert_real((ispunct(174) == 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_ispunct.c",
              875, ("ispunct should be 0 for 0xae"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xae>:
push   %rax
mov    $0xae,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x36b,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xae\00"
define void @t_ispunct_0xae() {
%1 = call i64 @ispunct(i32 174)
%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 875, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xae\00"
define void @t_ispunct_0xae() {
%1 = tail call i64 @ispunct(i32 174)
%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 875, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long decrease_sleep_time(long wait) {
  wait -= 10000;
  if (wait <= 10000)
    wait = 10000;
  return wait;
}


x86 assembly (clang, -O0):
<decrease_sleep_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x2710,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x2710,-0x8(%rbp)
jg     112c <decrease_sleep_time+0x2c>
movq   $0x2710,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrease_sleep_time>:
lea    -0x2710(%rdi),%rcx
cmp    $0x4e21,%rdi
mov    $0x2710,%eax
cmovge %rcx,%rax
ret

LLVM IR (-O0):
define i64 @decrease_sleep_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 10000
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp sle i64 %5, 10000
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 10000, i64* %2
br label %8
8: ; preds = %7, %1
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @decrease_sleep_time(i64 %0) {
%2 = add nsw i64 %0, -10000
%3 = icmp slt i64 %0, 20001
%4 = select i1 %3, i64 10000, i64 %2
ret i64 %4
}
/* Variables and functions */
char *getopt_str(char const *, char *);
const char *player_devstr(const char **sect_name) {
  const char *s = "";
  const char *dev;
  if (0)
    s = (0 == 1) ? "player1" : "player2";
  dev = getopt_str(s, "input");
  if (sect_name)
    *sect_name = s;
  return dev;
}


x86 assembly (clang, -O0):
<player_devstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xee2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <getopt_str@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <player_devstr+0x41>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_devstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee7(%rip),%r14
lea    0xedb(%rip),%rsi
mov    %r14,%rdi
call   1030 <getopt_str@plt>
test   %rbx,%rbx
je     1135 <player_devstr+0x25>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"input\00"
define i8* @player_devstr(i8** writeonly %0) {
%2 = tail call i8* @getopt_str(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i8** %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %0
br label %5
5: ; preds = %4, %1
ret i8* %2
}
int fun851() { return 851; }


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

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

LLVM IR (-O0):
define i32 @fun851() {
ret i32 851
}

LLVM IR (-O2):
define i32 @fun851() {
ret i32 851
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int stat(char *, struct stat *);
int create_dir(char *name) {
  struct stat st = {0};
  if (stat(name, &st) == -1) {
    mkdir(name, 0700);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<create_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <stat@plt>
cmp    $0xffffffff,%eax
jne    117c <create_dir+0x4c>
mov    -0x10(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
movl   $0x1,-0x4(%rbp)
jmp    1183 <create_dir+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dir>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
jne    1155 <create_dir+0x35>
mov    %rbx,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @create_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = bitcast %struct.stat* %4 to i8*
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @mkdir(i8* %10, i32 448)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @create_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @mkdir(i8* %0, i32 448)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 1, %7 ], [ 0, %1 ]
ret i32 %10
}
int lw_lang_auto() {
  int language;
  language = 0;
  return language;
}


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

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

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

LLVM IR (-O2):
define i32 @lw_lang_auto() {
ret i32 0
}
int test_imm_26uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x26 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_26uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 163208757248
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() { 2 / (5 - 5); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int isOperator(char c) {
  int ret;
  switch (c) {
  case '+':
  case '-':
  case '*':
  case '/':
  case '^':
  case '%':
    ret = 1;
    break;
  default:
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<isOperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x25,%eax
je     1166 <isOperator+0x66>
jmp    111f <isOperator+0x1f>
mov    -0xc(%rbp),%eax
add    $0xffffffd6,%eax
sub    $0x2,%eax
jb     1166 <isOperator+0x66>
jmp    1133 <isOperator+0x33>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1166 <isOperator+0x66>
jmp    1144 <isOperator+0x44>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1166 <isOperator+0x66>
jmp    1155 <isOperator+0x55>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    1172 <isOperator+0x72>
jmp    1166 <isOperator+0x66>
movl   $0x1,-0x8(%rbp)
jmp    1179 <isOperator+0x79>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperator>:
add    $0xffffffdb,%edi
cmp    $0x39,%edi
ja     111e <isOperator+0x1e>
mov    $0x1,%eax
movabs $0x200000000000561,%rcx
bt     %rdi,%rcx
jae    111e <isOperator+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isOperator(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 43, label %6
i32 45, label %6
i32 42, label %6
i32 47, label %6
i32 94, label %6
i32 37, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %8
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @isOperator(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 43, label %4
i32 45, label %4
i32 42, label %4
i32 47, label %4
i32 94, label %4
i32 37, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ PrintOut(int);
int /*<<< orphan*/ putchar(char);
main() {
  PrintOut(1369);
  putchar('\n');
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @PrintOut(i32 1369)
%3 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @PrintOut(i32 1369)
%2 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int *, int);
void main() {
  int x;
  int y;
  printf("address difference:  %p, %p, %d\n", &x, &y, sizeof(int));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"address difference: %p, %p, %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"address difference: %p, %p, %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32 4)
ret void
}