xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void main(void) {
  unsigned int i = 1;
  while (1) {
    i = i * 2;
    printf("%u", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
add    %ebx,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = mul i32 %3, 2
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %3, %1 ]
%3 = shl i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %1
}
_sspr(c, strptr) char **strptr;
{ *(*strptr)++ = c; }


x86 assembly (clang, -O0):
<_sspr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sspr>:
mov    (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
mov    %dil,(%rax)
ret

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

LLVM IR (-O2):
define i32 @_sspr(i32 %0, i8** nocapture %1) {
%3 = trunc i32 %0 to i8
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %1
store i8 %3, i8* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void iremove(char *name) { remove(name); }


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

x86 assembly (clang, -O2):
<iremove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @iremove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
/* Variables and functions */
unsigned int _tzcnt_u32(unsigned int);
unsigned int test_tzcnt_u32(unsigned int __X) { return _tzcnt_u32(__X); }


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

x86 assembly (clang, -O2):
<test_tzcnt_u32>:
jmp    1030 <_tzcnt_u32@plt>

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

LLVM IR (-O2):
define i32 @test_tzcnt_u32(i32 %0) {
%2 = tail call i32 @_tzcnt_u32(i32 %0)
ret i32 %2
}
int get_length(int n) {
  if (1)
    ;
}


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

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

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

LLVM IR (-O2):
define i32 @get_length(i32 %0) {
ret i32 undef
}
void foo_1_2_1_2_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_1_2_1_1() {
ret void
}
const char *protobuf_c_version(void) { return "1.3.3"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.3.3\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.3.3\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Locate_My_IP();
int /*<<< orphan*/ Locate_This_IP(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    Locate_My_IP();
  } else {
    printf("Locating %s...\n", argv[1]);
    Locate_This_IP(argv[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    115c <main+0x2c>
mov    $0x0,%al
call   1030 <Locate_My_IP@plt>
jmp    117d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <Locate_This_IP@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    113f <main+0xf>
xor    %eax,%eax
call   1030 <Locate_My_IP@plt>
jmp    115b <main+0x2b>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
call   1050 <Locate_This_IP@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Locating %s...\0A\00"
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 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @Locate_My_IP()
br label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @Locate_This_IP(i8* %17)
br label %19
19: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Locating %s...\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @Locate_My_IP()
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %7
%11 = tail call i32 @Locate_This_IP(i8* %10)
br label %12
12: ; preds = %6, %4
ret i32 0
}
int solve(int n) {}


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

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

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

LLVM IR (-O2):
define i32 @solve(i32 %0) {
ret i32 undef
}
double deg2ang(angle)
char *angle;
{
  double deg;
  deg = str2dec(angle);
  return (deg);
}


x86 assembly (clang, -O0):
<deg2ang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <str2dec@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2ang>:
push   %rax
xor    %eax,%eax
call   1030 <str2dec@plt>
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @deg2ang(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @str2dec to i32 (i8*, ...)*)(i8* %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @deg2ang(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @str2dec to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ execle(char *, char *, int /*<<< orphan*/ *, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char *env[] = {"USER=linux", NULL};
  execle("./test", "test", NULL, env);
  printf("failed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rcx
lea    0xeb4(%rip),%rdi
lea    0xeaf(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <execle@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed5(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    %rsp,%rcx
xor    %edx,%edx
call   1040 <execle@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"USER=linux\00"
@__const.main.env = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [7 x i8] c"./test\00"
@.str.2 = [5 x i8] c"test\00"
@.str.3 = [8 x i8] c"failed\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%9 = call i32 @execle(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* null, i8** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"USER=linux\00"
@__const.main.env = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [7 x i8] c"./test\00"
@.str.2 = [5 x i8] c"test\00"
@str = [7 x i8] c"failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i32 @execle(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* null, i8** %5)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ strerr;

/* Variables and functions */
int /*<<< orphan*/ obderrconvert_r(char *, int, unsigned int, unsigned int);
const char *obderrconvert(unsigned int A, unsigned int B) {
  static char strerr[6];
  strerr[0] = '\0';
  obderrconvert_r(strerr, sizeof(strerr), A, B);
  return strerr;
}


x86 assembly (clang, -O0):
<obderrconvert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x0,0x2f04(%rip)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0x2ef7(%rip),%rdi
mov    $0x6,%esi
call   1030 <obderrconvert_r@plt>
lea    0x2ee6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obderrconvert>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%edx
movb   $0x0,0x2f0d(%rip)
lea    0x2f06(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <obderrconvert_r@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@obderrconvert.strerr = internal global [6 x i8] zeroinitializer
define i8* @obderrconvert(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @obderrconvert.strerr, i64 0, i64 0)
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @obderrconvert_r(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @obderrconvert.strerr, i64 0, i64 0), i32 6, i32 %5, i32 %6)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @obderrconvert.strerr, i64 0, i64 0)
}

LLVM IR (-O2):
@obderrconvert.strerr = internal global [6 x i8] zeroinitializer
define i8* @obderrconvert(i32 %0, i32 %1) {
store i8 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @obderrconvert.strerr, i64 0, i64 0)
%3 = tail call i32 @obderrconvert_r(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @obderrconvert.strerr, i64 0, i64 0), i32 6, i32 %0, i32 %1)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @obderrconvert.strerr, i64 0, i64 0)
}
void _shoot_free_suite(struct memSuite *suite) {}


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

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

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

LLVM IR (-O2):
%struct.memSuite = type opaque
define void @_shoot_free_suite(%struct.memSuite* nocapture %0) {
ret void
}
void asd_dump_ddb_0(struct asd_ha_struct *asd_ha) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ MFRC522_CalculateCRC(int *, int, int *);
int /*<<< orphan*/ MFRC522_ToCard(int, int *, int, int *, int /*<<< orphan*/ *);
void MFRC522_Halt(void) {
  uint16_t unLen;
  uint8_t buff[4];
  buff[0] = 0x50;
  buff[1] = 0;
  MFRC522_CalculateCRC(buff, 2, &buff[2]);
  MFRC522_ToCard(0x0C, buff, 4, buff, &unLen);
}


x86 assembly (clang, -O0):
<MFRC522_Halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x50,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x20(%rbp),%rdx
add    $0x8,%rdx
mov    $0x2,%esi
call   1040 <MFRC522_CalculateCRC@plt>
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rcx
mov    $0xc,%edi
mov    $0x4,%edx
lea    -0x4(%rbp),%r8
call   1030 <MFRC522_ToCard@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_Halt>:
push   %rbx
sub    $0x20,%rsp
movq   $0x50,0x10(%rsp)
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <MFRC522_CalculateCRC@plt>
lea    0xc(%rsp),%r8
mov    $0xc,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1030 <MFRC522_ToCard@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @MFRC522_Halt() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 80, i32* %3
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
store i32 0, i32* %4
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%7 = call i32 @MFRC522_CalculateCRC(i32* %5, i32 2, i32* %6)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%10 = call i32 @MFRC522_ToCard(i32 12, i32* %8, i32 4, i32* %9, i32* %1)
ret void
}

LLVM IR (-O2):
define void @MFRC522_Halt() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 80, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
store i32 0, i32* %6
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%8 = call i32 @MFRC522_CalculateCRC(i32* %5, i32 2, i32* %7)
%9 = call i32 @MFRC522_ToCard(i32 12, i32* %5, i32 4, i32* %5, i32* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void h264avcc_ppsh_set_length(uint8_t *p, uint16_t val) {
  p[0] = val >> 8;
  p[1] = val & 0xff;
}


x86 assembly (clang, -O0):
<h264avcc_ppsh_set_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264avcc_ppsh_set_length>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,(%rdi)
mov    %eax,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @h264avcc_ppsh_set_length(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = and i32 %1, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ run();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ view();
int main() {
  initscr();
  noecho();
  cbreak();
  srand((unsigned int)time(NULL));
  while (1) {
    run();
    view();
  }
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x0,%al
call   1040 <run@plt>
mov    $0x0,%al
call   1090 <view@plt>
jmp    11a4 <main+0x34>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <run@plt>
xor    %eax,%eax
call   1090 <view@plt>
jmp    11a0 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 (...) @noecho()
%4 = call i32 (...) @cbreak()
%5 = call i64 @time(i32* null)
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
br label %8
8: ; preds = %0, %8
%9 = call i32 (...) @run()
%10 = call i32 (...) @view()
br label %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @cbreak()
%4 = tail call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @srand(i32 %5)
br label %7
7: ; preds = %0, %7
%8 = tail call i32 (...) @run()
%9 = tail call i32 (...) @view()
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) usage(char *argv0, int ret) {
  fprintf(stderr,
          "usage: %s -b -f <file> <iface>\n"
          "usage: %s -c <iface>\n"
          "\noptional parameters:\n"
          "-i interval	send `interval' packets per second\n"
          "-p packets	send `packet' packets, then exit\n",
          argv0, argv0);
  exit(ret);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    %rcx,%rdx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [166 x i8] c"usage: %s -b -f <file> <iface>\0Ausage: %s -c <iface>\0A\0Aoptional parameters:\0A-i interval\09send `interval' packets per second\0A-p packets\09send `packet' packets, then exit\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i32, i32* %4
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [166 x i8] c"usage: %s -b -f <file> <iface>\0Ausage: %s -c <iface>\0A\0Aoptional parameters:\0A-i interval\09send `interval' packets per second\0A-p packets\09send `packet' packets, then exit\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ ip;

/* Variables and functions */
int main(void) {
  intptr_t ip;
  return sizeof(ip);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
signed int Get_Word(void) {
  signed int Val;
  Val = Get_Byte();
  signed int return_value_Get_Byte$1;
  return_value_Get_Byte$1 = Get_Byte();
  return Val << 8 | return_value_Get_Byte$1;
}


x86 assembly (clang, -O0):
<Get_Word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Word>:
push   %rbx
xor    %eax,%eax
call   1030 <Get_Byte@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Get_Byte@plt>
shl    $0x8,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Get_Word() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @Get_Byte()
store i32 %3, i32* %1
%4 = call i32 (...) @Get_Byte()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = shl i32 %5, 8
%7 = load i32, i32* %2
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @Get_Word() {
%1 = tail call i32 (...) @Get_Byte()
%2 = tail call i32 (...) @Get_Byte()
%3 = shl i32 %1, 8
%4 = or i32 %3, %2
ret i32 %4
}
void RTTcpClientCloseEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpClientCloseEx() {
ret void
}
int baz(int x __attribute__((unused)), int y) {
  int i;
  for (i = 0; i < 1; i = 1)
    for (y = 0; y < 1; y = 1)
      ;
  return y;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    114e <baz+0x4e>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    113d <baz+0x3d>
jmp    1131 <baz+0x31>
movl   $0x1,-0x8(%rbp)
jmp    1122 <baz+0x22>
jmp    1142 <baz+0x42>
movl   $0x1,-0xc(%rbp)
jmp    1111 <baz+0x11>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @baz(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void child_signal_handler(int a) {
  while (waitpid(-1, NULL, WNOHANG) >= 0)
    ;
  signal(SIGCHLD, child_signal_handler);
}


x86 assembly (clang, -O0):
<child_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0x0,%rax
jl     1151 <child_signal_handler+0x31>
jmp    112b <child_signal_handler+0xb>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_signal_handler>:
push   %rbx
mov    0x2eb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %rax,%rax
jns    1130 <child_signal_handler+0x10>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rsi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @child_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sge i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* @SIGCHLD
%10 = call i32 @signal(i32 %9, void (i32)* @child_signal_handler)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @child_signal_handler(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, -1
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = load i32, i32* @SIGCHLD
%8 = tail call i32 @signal(i32 %7, void (i32)* @child_signal_handler)
ret void
}
/* Variables and functions */
char toupper(char);
void maiuscola(char *s) {
  for (; *s; ++s)
    *s = toupper(*s);
}


x86 assembly (clang, -O0):
<maiuscola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <maiuscola+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <maiuscola+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @maiuscola(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %12, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call signext i8 @toupper(i8 signext %9)
%11 = load i8*, i8** %2
store i8 %10, i8* %11
br label %12
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @maiuscola(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
float M_PI;
float calcc1Spiral(float fieldOfView, float interleaves) {
  return 4.0f * M_PI * M_PI * fieldOfView * fieldOfView /
         (interleaves * interleaves);
}


x86 assembly (clang, -O0):
<calcc1Spiral>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
mov    0x2ecb(%rip),%rax
mulss  (%rax),%xmm0
mov    0x2ec0(%rip),%rax
mulss  (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcc1Spiral>:
mov    0x2ee1(%rip),%rax
movss  (%rax),%xmm2
movss  0xeed(%rip),%xmm3
mulss  %xmm2,%xmm3
mulss  %xmm2,%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm3,%xmm0
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @calcc1Spiral(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* @M_PI
%6 = fmul float 4.000000e+00, %5
%7 = load float, float* @M_PI
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = fmul float %8, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %4
%14 = load float, float* %4
%15 = fmul float %13, %14
%16 = fdiv float %12, %15
ret float %16
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @calcc1Spiral(float %0, float %1) {
%3 = load float, float* @M_PI
%4 = fmul float %3, 4.000000e+00
%5 = fmul float %3, %4
%6 = fmul float %5, %0
%7 = fmul float %6, %0
%8 = fmul float %1, %1
%9 = fdiv float %7, %8
ret float %9
}
void f8(int i) {
  switch (i)
    break;
  switch ((int)i)
    break;
  switch ((unsigned int)i)
    break;
  switch ((_Bool)i)
    break;
}


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

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

LLVM IR (-O0):
define void @f8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
%5 = load i32, i32* %2
switch i32 %5, label %6 [
]
6: ; preds = %4
%7 = load i32, i32* %2
switch i32 %7, label %8 [
]
8: ; preds = %6
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
switch i32 %11, label %12 [
]
12: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @f8(i32 %0) {
ret void
}
/* Type definitions */
struct event_callback_entry {
  int dummy;
};
struct callback_schedule_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ schedule_callback3(struct event_callback_entry *,
                                      struct callback_schedule_entry **,
                                      char const *, double, double, double);
void schedule_callback(struct event_callback_entry *e,
                       struct callback_schedule_entry **s, const char *event,
                       double param1) {
  schedule_callback3(e, s, event, param1, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<schedule_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1030 <schedule_callback3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<schedule_callback>:
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
jmp    1030 <schedule_callback3@plt>

LLVM IR (-O0):
%struct.event_callback_entry = type { i32 }
%struct.callback_schedule_entry = type { i32 }
define void @schedule_callback(%struct.event_callback_entry* %0, %struct.callback_schedule_entry** %1, i8* %2, double %3) {
%5 = alloca %struct.event_callback_entry*
%6 = alloca %struct.callback_schedule_entry**
%7 = alloca i8*
%8 = alloca double
store %struct.event_callback_entry* %0, %struct.event_callback_entry** %5
store %struct.callback_schedule_entry** %1, %struct.callback_schedule_entry*** %6
store i8* %2, i8** %7
store double %3, double* %8
%9 = load %struct.event_callback_entry*, %struct.event_callback_entry** %5
%10 = load %struct.callback_schedule_entry**, %struct.callback_schedule_entry*** %6
%11 = load i8*, i8** %7
%12 = load double, double* %8
%13 = call i32 @schedule_callback3(%struct.event_callback_entry* %9, %struct.callback_schedule_entry** %10, i8* %11, double %12, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
%struct.event_callback_entry = type { i32 }
%struct.callback_schedule_entry = type { i32 }
define void @schedule_callback(%struct.event_callback_entry* %0, %struct.callback_schedule_entry** %1, i8* %2, double %3) {
%5 = tail call i32 @schedule_callback3(%struct.event_callback_entry* %0, %struct.callback_schedule_entry** %1, i8* %2, double %3, double 0.000000e+00, double 0.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pendfunc1(int);
void pendfunc(int x) { pendfunc1(x); }


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

x86 assembly (clang, -O2):
<pendfunc>:
jmp    1030 <pendfunc1@plt>

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

LLVM IR (-O2):
define void @pendfunc(i32 %0) {
%2 = tail call i32 @pendfunc1(i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ type;
};
typedef TYPE_1__ PKCS7;

/* Variables and functions */
#define NID_pkcs7_data 133
#define NID_pkcs7_digest 132
#define NID_pkcs7_encrypted 131
#define NID_pkcs7_enveloped 130
#define NID_pkcs7_signed 129
#define NID_pkcs7_signedAndEnveloped 128
int OBJ_obj2nid(int /*<<< orphan*/);
int PKCS7_type_is_other(PKCS7 *p7) {
  int isOther = 1;
  int nid = OBJ_obj2nid(p7->type);
  switch (nid) {
  case NID_pkcs7_data:
  case NID_pkcs7_signed:
  case NID_pkcs7_enveloped:
  case NID_pkcs7_signedAndEnveloped:
  case NID_pkcs7_digest:
  case NID_pkcs7_encrypted:
    isOther = 0;
    break;
  default:
    isOther = 1;
  }
  return isOther;
}


x86 assembly (clang, -O0):
<PKCS7_type_is_other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <OBJ_obj2nid@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x5,%eax
ja     1151 <PKCS7_type_is_other+0x41>
jmp    1145 <PKCS7_type_is_other+0x35>
movl   $0x0,-0xc(%rbp)
jmp    1158 <PKCS7_type_is_other+0x48>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS7_type_is_other>:
push   %rax
mov    (%rdi),%edi
call   1030 <OBJ_obj2nid@plt>
add    $0xffffff7a,%eax
xor    %ecx,%ecx
cmp    $0xfffffffa,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @PKCS7_type_is_other(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
%3 = alloca i32
%4 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
store i32 1, i32* %3
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @OBJ_obj2nid(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
switch i32 %9, label %11 [
i32 133, label %10
i32 129, label %10
i32 130, label %10
i32 128, label %10
i32 132, label %10
i32 131, label %10
]
10: ; preds = %1, %1, %1, %1, %1, %1
store i32 0, i32* %3
br label %12
11: ; preds = %1
store i32 1, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @PKCS7_type_is_other(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @OBJ_obj2nid(i32 %3)
%5 = add i32 %4, -134
%6 = icmp ult i32 %5, -6
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xd5() {
  Assert_real((isprint(213) == 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_isprint.c",
              1070, ("isprint should be 0 for 0xd5"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xd5>:
push   %rax
mov    $0xd5,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x42e,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd5\00"
define void @t_isprint_0xd5() {
%1 = call i64 @isprint(i32 213)
%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 1070, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd5\00"
define void @t_isprint_0xd5() {
%1 = tail call i64 @isprint(i32 213)
%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 1070, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t comprimento = 0U;
  while (*(str++)) {
    ++comprimento;
  }
  return comprimento;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
long msb(long);
long nearpow2(long x) {
  long m = msb(x);
  long h = 1 << m;
  long l = h >> 1;
  if ((x - l) < (h - x))
    return l;
  else
    return h;
}


x86 assembly (clang, -O0):
<nearpow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <msb@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
jge    116e <nearpow2+0x5e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <nearpow2+0x66>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearpow2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <msb@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
movslq %edx,%rcx
mov    %rcx,%rax
sar    %rax
mov    %rcx,%rdx
sub    %rbx,%rdx
sub    %rax,%rbx
cmp    %rdx,%rbx
cmovge %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @nearpow2(i64 %0) {
%2 = tail call i64 @msb(i64 %0)
%3 = trunc i64 %2 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = ashr i64 %5, 1
%7 = sub nsw i64 %0, %6
%8 = sub nsw i64 %5, %0
%9 = icmp slt i64 %7, %8
%10 = select i1 %9, i64 %6, i64 %5
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test3() {
  printf("1"
         " + "
         "2"
         " = %d\n",
         (1 + 2));
  printf("3"
         " + "
         "4"
         " = %d\n",
         (3 + 4));
}


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

x86 assembly (clang, -O2):
<test3>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x7,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"1 + 2 = %d\0A\00"
@.str.1 = [12 x i8] c"3 + 4 = %d\0A\00"
define void @test3() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}
unsigned int b2lendian(unsigned int x) {
  unsigned int y = 0;
  y = x << 24;
  y |= (x << 8) & 0x00ff0000;
  y |= (x >> 8) & 0x0000ff00;
  y |= x >> 24;
  return y;
}


x86 assembly (clang, -O0):
<b2lendian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff00,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @b2lendian(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = shl i32 %4, 24
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 16711680
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = lshr i32 %11, 8
%13 = and i32 %12, 65280
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = lshr i32 %16, 24
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @b2lendian(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}