xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
char const *const strdup(char *);
const char *const BrokenFunction(void) {
  char buf[128];
  gets(buf);
  return strdup(buf);
}


x86 assembly (clang, -O0):
<BrokenFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
call   1030 <gets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrokenFunction>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <gets@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @BrokenFunction() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = call i8* @strdup(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @BrokenFunction() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i8* @strdup(i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_boolean_node_get_string(void *p, const char **string, char **error) {
  mdea_error(error, "Expected string, got boolean");
  return -1;
}


x86 assembly (clang, -O0):
<mdea_boolean_node_get_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_boolean_node_get_string>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Expected string, got boolean\00"
define i32 @mdea_boolean_node_get_string(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [29 x i8] c"Expected string, got boolean\00"
define i32 @mdea_boolean_node_get_string(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_dirty_work() { printf("doing dirty works!\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"doing dirty works!\00"
define void @do_dirty_work() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
void stac(void) { asm volatile(".byte 0x0f, 0x01, 0xcb" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @stac() {
tail call void asm sideeffect ".byte 0x0f, 0x01, 0xcb", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ clock();
long long int sim_time() { return (long long int)clock(); }


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

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

LLVM IR (-O0):
define i64 @sim_time() {
%1 = call i64 (...) @clock()
ret i64 %1
}

LLVM IR (-O2):
define i64 @sim_time() {
%1 = tail call i64 (...) @clock()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void footer() {
  fprintf(stdout, "\n\n------------------------------ END "
                  "------------------------------\n\n");
}


x86 assembly (clang, -O0):
<footer>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<footer>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [70 x i8] c"\0A\0A------------------------------ END ------------------------------\0A\0A\00"
define void @footer() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [70 x i8] c"\0A\0A------------------------------ END ------------------------------\0A\0A\00"
define void @footer() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int t2() {
  int x, y;
  int *a;
  a = &y;
  x = y;
  assert(x == y);
  *a = 3;
  assert(x == y);
  assert(a == &y);
  return 0;
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x8(%rbp),%rax
cmp    %rax,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @t2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32* %2, i32** %3
%4 = load i32, i32* %2
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32*, i32** %3
store i32 3, i32* %10
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32*, i32** %3
%17 = icmp eq i32* %16, %2
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @t2() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atapio_wait_for_rdy(unsigned short);
int /*<<< orphan*/ in_byte(unsigned short);
int /*<<< orphan*/ out_byte(unsigned short, int);
void atapio_software_reset(unsigned short DCR) {
  int i;
  out_byte(DCR, 0x04);
  out_byte(DCR, 0x00);
  for (i = 0; i > 0; i++) {
    in_byte(DCR);
  }
  atapio_wait_for_rdy(DCR);
}


x86 assembly (clang, -O0):
<atapio_software_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x4,%esi
movzwl -0x2(%rbp),%edi
call   1050 <out_byte@plt>
xor    %esi,%esi
movzwl -0x2(%rbp),%edi
call   1050 <out_byte@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1180 <atapio_software_reset+0x50>
movzwl -0x2(%rbp),%edi
call   1030 <in_byte@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <atapio_software_reset+0x2f>
movzwl -0x2(%rbp),%edi
call   1040 <atapio_wait_for_rdy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atapio_software_reset>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%esi
call   1040 <out_byte@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <out_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <atapio_wait_for_rdy@plt>

LLVM IR (-O0):
define void @atapio_software_reset(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 @out_byte(i16 zeroext %4, i32 4)
%6 = load i16, i16* %2
%7 = call i32 @out_byte(i16 zeroext %6, i32 0)
store i32 0, i32* %3
br label %8
8: ; preds = %14, %1
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i16, i16* %2
%13 = call i32 @in_byte(i16 zeroext %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %8
17: ; preds = %8
%18 = load i16, i16* %2
%19 = call i32 @atapio_wait_for_rdy(i16 zeroext %18)
ret void
}

LLVM IR (-O2):
define void @atapio_software_reset(i16 zeroext %0) {
%2 = tail call i32 @out_byte(i16 zeroext %0, i32 4)
%3 = tail call i32 @out_byte(i16 zeroext %0, i32 0)
%4 = tail call i32 @atapio_wait_for_rdy(i16 zeroext %0)
ret void
}
void _cc3_delay_i2c() {
  volatile int x;
  for (x = 0; x < 25; x++)
    ;
}


x86 assembly (clang, -O0):
<_cc3_delay_i2c>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x19,%eax
jge    112a <_cc3_delay_i2c+0x2a>
jmp    111c <_cc3_delay_i2c+0x1c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <_cc3_delay_i2c+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_delay_i2c>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x18,%eax
jg     112e <_cc3_delay_i2c+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x19,%eax
jl     1120 <_cc3_delay_i2c+0x20>
ret

LLVM IR (-O0):
define void @_cc3_delay_i2c() {
%1 = alloca i32
store volatile i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 25
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load volatile i32, i32* %1
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @_cc3_delay_i2c() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 25
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp slt i32 %8, 25
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
bool uc_is_leading_surrogate(int c) { return c >= 0xd800 && c <= 0xdbff; }


x86 assembly (clang, -O0):
<uc_is_leading_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xd800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <uc_is_leading_surrogate+0x26>
cmpl   $0xdbff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc_is_leading_surrogate>:
and    $0xfffffc00,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @uc_is_leading_surrogate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 55296
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 56319
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @uc_is_leading_surrogate(i32 %0) {
%2 = and i32 %0, -1024
%3 = icmp eq i32 %2, 55296
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo_2_2_2_2_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_1_2_2_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int m, n;
  while (scanf("%d %d", &m, &n) == 2) {
    printf("%d\n", (m * n) - 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1167 <main+0x47>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
sub    $0x1,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1186 <main+0x66>
lea    0xebe(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
add    $0xffffffff,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %8
%11 = add nsw i32 %10, -1
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = icmp eq i32 %13, 2
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int ec_gethostname(char *buf, int size) {
  int i;
  struct hostent *hp;
  strcpy(buf, "barrelfish");
  return (strlen(buf));
}


x86 assembly (clang, -O0):
<ec_gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_gethostname>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
@.str = [11 x i8] c"barrelfish\00"
define i32 @ec_gethostname(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.hostent*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [11 x i8] c"barrelfish\00"
define i32 @ec_gethostname(i8* %0, i32 %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* %0)
ret i32 %4
}
/* Type definitions */
typedef int u_int8_t;

/* Variables and functions */
u_int8_t eblend(u_int8_t a, u_int8_t s, u_int8_t d) {
  return (a * (s - d) + (d << 8)) >> 8;
}


x86 assembly (clang, -O0):
<eblend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eblend>:
sub    %edx,%esi
imul   %edi,%esi
shl    $0x8,%edx
lea    (%rdx,%rsi,1),%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @eblend(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %8, %9
%11 = mul nsw i32 %7, %10
%12 = load i32, i32* %6
%13 = shl i32 %12, 8
%14 = add nsw i32 %11, %13
%15 = ashr i32 %14, 8
ret i32 %15
}

LLVM IR (-O2):
define i32 @eblend(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
%5 = mul nsw i32 %4, %0
%6 = shl i32 %2, 8
%7 = add nsw i32 %5, %6
%8 = ashr i32 %7, 8
ret i32 %8
}
int foo(int n) {
  int i = 0;
  if (i != 0)
    return n;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1123 <foo+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <foo+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
char number_of_bits_in_uint(unsigned int);
char number_of_bits_in_int(int value) {
  unsigned int uvalue = *(unsigned int *)&value;
  if (value < 0) {
    return 32 - number_of_bits_in_uint(uvalue);
  } else {
    return number_of_bits_in_uint(uvalue);
  }
}


x86 assembly (clang, -O0):
<number_of_bits_in_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1145 <number_of_bits_in_int+0x35>
mov    -0xc(%rbp),%edi
call   1030 <number_of_bits_in_uint@plt>
movsbl %al,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    1150 <number_of_bits_in_int+0x40>
mov    -0xc(%rbp),%edi
call   1030 <number_of_bits_in_uint@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_bits_in_int>:
push   %rbx
mov    %edi,%ebx
call   1030 <number_of_bits_in_uint@plt>
mov    $0x20,%cl
sub    %al,%cl
test   %ebx,%ebx
movzbl %cl,%ecx
movzbl %al,%eax
cmovs  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @number_of_bits_in_int(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %4
%10 = call signext i8 @number_of_bits_in_uint(i32 %9)
%11 = sext i8 %10 to i32
%12 = sub nsw i32 32, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %17
14: ; preds = %1
%15 = load i32, i32* %4
%16 = call signext i8 @number_of_bits_in_uint(i32 %15)
store i8 %16, i8* %2
br label %17
17: ; preds = %14, %8
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @number_of_bits_in_int(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = tail call signext i8 @number_of_bits_in_uint(i32 %0)
%4 = sub i8 32, %3
%5 = select i1 %2, i8 %4, i8 %3
ret i8 %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
int main(void) {
  struct stat buf;
  int fd = 42;
  fstat(fd, &buf);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @fstat(i32 %4, %struct.stat* %2)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @fstat(i32 42, %struct.stat* %1)
ret i32 0
}
/* Type definitions */
struct sudirrnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sudirrnode *);
void sudirr_destroy(struct sudirrnode *sudirrn) {
  if (!sudirrn)
    return;
  {}
  free(sudirrn);
}


x86 assembly (clang, -O0):
<sudirr_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <sudirr_destroy+0x1c>
jmp    1135 <sudirr_destroy+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudirr_destroy>:
test   %rdi,%rdi
je     111a <sudirr_destroy+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.sudirrnode = type { i32 }
define void @sudirr_destroy(%struct.sudirrnode* %0) {
%2 = alloca %struct.sudirrnode*
store %struct.sudirrnode* %0, %struct.sudirrnode** %2
%3 = load %struct.sudirrnode*, %struct.sudirrnode** %2
%4 = icmp ne %struct.sudirrnode* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.sudirrnode*, %struct.sudirrnode** %2
%8 = call i32 @free(%struct.sudirrnode* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.sudirrnode = type { i32 }
define void @sudirr_destroy(%struct.sudirrnode* %0) {
%2 = icmp eq %struct.sudirrnode* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.sudirrnode* %0)
br label %5
5: ; preds = %1, %3
ret void
}
int time_s() {
  int int_num = 2;
  int tmp;
  __asm__("int $0x80" : "=a"(tmp) : "a"(int_num));
  return (tmp / 100);
}


x86 assembly (clang, -O0):
<time_s>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int    $0x80
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_s>:
mov    $0x2,%eax
int    $0x80
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @time_s() {
%1 = alloca i32
%2 = alloca i32
store i32 2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 asm "int $$0x80", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 100
ret i32 %6
}

LLVM IR (-O2):
define i32 @time_s() {
%1 = tail call i32 asm "int $$0x80", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 2)
%2 = sdiv i32 %1, 100
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hookup_free_userdata(void *ud) { free(ud); }


x86 assembly (clang, -O0):
<hookup_free_userdata>:
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):
<hookup_free_userdata>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @hookup_free_userdata(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void mibConstrInfoLLDPDU_test_out_of_order() {}


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

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

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

LLVM IR (-O2):
define void @mibConstrInfoLLDPDU_test_out_of_order() {
ret void
}
vswrite(dev) {
  register int count, c;
  count = 0;
  while ((c = cpass()) >= 0) {
    if (--count <= 0) {
      count = 60;
      vschar(0);
    }
    vschar(c);
  }
  vschar(0);
}


x86 assembly (clang, -O0):
<vswrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <cpass@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jl     1176 <vswrite+0x56>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jg     1167 <vswrite+0x47>
movl   $0x3c,-0xc(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <vschar@plt>
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1030 <vschar@plt>
jmp    1132 <vswrite+0x12>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <vschar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vswrite>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <cpass@plt>
test   %eax,%eax
js     116e <vswrite+0x4e>
mov    %eax,%ebx
xor    %ebp,%ebp
jmp    1164 <vswrite+0x44>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <vschar@plt>
mov    $0x3c,%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <vschar@plt>
xor    %eax,%eax
call   1040 <cpass@plt>
mov    %eax,%ebx
test   %eax,%eax
js     116e <vswrite+0x4e>
cmp    $0x1,%ebp
jle    1140 <vswrite+0x20>
add    $0xffffffff,%ebp
jmp    114e <vswrite+0x2e>
xor    %edi,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <vschar@plt>

LLVM IR (-O0):
define i32 @vswrite(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %15, %1
%7 = call i32 (...) @cpass()
store i32 %7, i32* %5
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
store i32 60, i32* %4
%14 = call i32 (i32, ...) bitcast (i32 (...)* @vschar to i32 (i32, ...)*)(i32 0)
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %5
%17 = call i32 (i32, ...) bitcast (i32 (...)* @vschar to i32 (i32, ...)*)(i32 %16)
br label %6
18: ; preds = %6
%19 = call i32 (i32, ...) bitcast (i32 (...)* @vschar to i32 (i32, ...)*)(i32 0)
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @vswrite(i32 %0) {
%2 = tail call i32 (...) @cpass()
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %16
4: ; preds = %1, %11
%5 = phi i32 [ %14, %11 ], [ %2, %1 ]
%6 = phi i32 [ %12, %11 ], [ 0, %1 ]
%7 = add nsw i32 %6, -1
%8 = icmp slt i32 %6, 2
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @vschar to i32 (i32, ...)*)(i32 0)
br label %11
11: ; preds = %9, %4
%12 = phi i32 [ 60, %9 ], [ %7, %4 ]
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @vschar to i32 (i32, ...)*)(i32 %5)
%14 = tail call i32 (...) @cpass()
%15 = icmp sgt i32 %14, -1
br i1 %15, label %4, label %16
16: ; preds = %11, %1
%17 = tail call i32 (i32, ...) bitcast (i32 (...)* @vschar to i32 (i32, ...)*)(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr, "Usage: %s <input file> [result file]\n\n", s);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s <input file> [result file]\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s <input file> [result file]\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void rop3_39_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk3 = ~stk3;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_39_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_39_1_1>:
mov    %esi,%eax
xor    %dl,%al
not    %al
mov    (%rdi),%cl
or     %cl,%al
or     %sil,%dl
not    %dl
and    %al,%dl
or     %cl,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_39_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %9
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = load i8*, i8** %4
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = load i8, i8* %6
%54 = zext i8 %53 to i32
%55 = and i32 %52, %54
%56 = or i32 %49, %55
%57 = trunc i32 %56 to i8
%58 = load i8*, i8** %4
store i8 %57, i8* %58
ret void
}

LLVM IR (-O2):
define void @rop3_39_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, %2
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = or i8 %2, %1
%9 = xor i8 %8, -1
%10 = and i8 %7, %9
%11 = or i8 %6, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parallel_restore_clr_atn(int);
int /*<<< orphan*/ parallel_restore_set_atn(int);
void parallel_cpu_restore_atn(unsigned char val) {
  if (val) {
    parallel_restore_set_atn(0x02);
  } else {
    parallel_restore_clr_atn(~0x02);
  }
}


x86 assembly (clang, -O0):
<parallel_cpu_restore_atn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_cpu_restore_atn+0x27>
mov    $0x2,%edi
call   1040 <parallel_restore_set_atn@plt>
jmp    1151 <parallel_cpu_restore_atn+0x31>
mov    $0xfffffffd,%edi
call   1030 <parallel_restore_clr_atn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_cpu_restore_atn>:
test   %edi,%edi
je     112e <parallel_cpu_restore_atn+0xe>
mov    $0x2,%edi
jmp    1040 <parallel_restore_set_atn@plt>
mov    $0xfffffffd,%edi
jmp    1030 <parallel_restore_clr_atn@plt>

LLVM IR (-O0):
define void @parallel_cpu_restore_atn(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @parallel_restore_set_atn(i32 2)
br label %9
7: ; preds = %1
%8 = call i32 @parallel_restore_clr_atn(i32 -3)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @parallel_cpu_restore_atn(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_restore_set_atn(i32 2)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_restore_clr_atn(i32 -3)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 2.9;
  printf("%d", n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xf5() {
  Assert_real((isdigit(245) == 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_isdigit.c",
              1230, ("isdigit should be 0 for 0xf5"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ce,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf5\00"
define void @t_isdigit_0xf5() {
%1 = call i64 @isdigit(i32 245)
%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 1230, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf5\00"
define void @t_isdigit_0xf5() {
%1 = tail call i64 @isdigit(i32 245)
%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 1230, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void print_hex(unsigned char *ptr, int length) {
  while (length > 0) {
    ;
    length--;
  };
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1123 <print_hex+0x23>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <print_hex+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_hex(i8* nocapture %0, i32 %1) {
ret void
}
void freemat(double **mat, int size) {
  int i;
  for (i = 0; i < size; i++) {
    free(mat[i]);
  }
  free(mat);
}


x86 assembly (clang, -O0):
<freemat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freemat+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freemat+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freemat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freemat+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freemat+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freemat(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void f(int n) {
  int a[n];
  sizeof(a);
  int b[sizeof(a)];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
shl    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i32, i64 %7
store i64 %7, i64* %4
%10 = mul nuw i64 4, %7
%11 = mul nuw i64 4, %7
%12 = alloca i32, i64 %11
store i64 %11, i64* %5
%13 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
void PlatformInit() {}


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

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

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

LLVM IR (-O2):
define void @PlatformInit() {
ret void
}
/* Type definitions */
struct binary_reader_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ binary_reader_close(struct binary_reader_context *);
int __binary_reader_destructor(struct binary_reader_context *talloc_context) {
  binary_reader_close((struct binary_reader_context *)talloc_context);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.binary_reader_context = type { i32 }
define i32 @__binary_reader_destructor(%struct.binary_reader_context* %0) {
%2 = tail call i32 @binary_reader_close(%struct.binary_reader_context* %0)
ret i32 0
}
void option_set_unit2MODIF_DUPNAMES() {}


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

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

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

LLVM IR (-O2):
define void @option_set_unit2MODIF_DUPNAMES() {
ret void
}
int gtfract(anum, adenom, bnum, bdenom)
int anum, adenom, bnum, bdenom;
{
  if ((anum * bdenom) > (bnum * adenom)) {
    return (1);
  } else {
    return (0);
  };
}


x86 assembly (clang, -O0):
<gtfract>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jle    1132 <gtfract+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <gtfract+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtfract>:
imul   %ecx,%edi
imul   %edx,%esi
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @gtfract(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = mul nsw i32 %2, %1
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
main() {
  int i, j;
  j = 2;
  for (i = 0; i < 5; i++) {
    printf(i);
    printf(j);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    115b <main+0x4b>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xc(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
%2 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 1 to i8*))
%4 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 2 to i8*))
%6 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 3 to i8*))
%8 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 4 to i8*))
%10 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*))
ret i32 0
}
/* Variables and functions */
int execlp(char *, char *, char *, int /*<<< orphan*/ *);
int main() { return execlp("ksysguard", "ksysguard", "--showprocesses", NULL); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
jmp    1030 <execlp@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"ksysguard\00"
@.str.1 = [16 x i8] c"--showprocesses\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execlp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 %2
}

LLVM IR (-O2):
@.str = [10 x i8] c"ksysguard\00"
@.str.1 = [16 x i8] c"--showprocesses\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 %1
}