xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
long atol(char *);
int main() {
  if (atol("3463456234575463723") != 3463456234575463723L) {
    abort();
  }
  if (atol("8903427589123480") != 8903427589123480L) {
    abort();
  }
  if (atol("9012783012740234983") != 9012783012740234983L) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <atol@plt>
movabs $0x3010ab185cfb852b,%rcx
ab 10 30
cmp    %rcx,%rax
je     114a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xec3(%rip),%rdi
call   1040 <atol@plt>
movabs $0x1fa19ec6bbad98,%rcx
cmp    %rcx,%rax
je     1170 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xeae(%rip),%rdi
call   1040 <atol@plt>
movabs $0x7d13d665f80e7ee7,%rcx
d6 13 7d
cmp    %rcx,%rax
je     1196 <main+0x76>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"3463456234575463723\00"
@.str.1 = [17 x i8] c"8903427589123480\00"
@.str.2 = [20 x i8] c"9012783012740234983\00"
define i32 @main() {
%1 = call i64 @atol(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 3463456234575463723
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = call i64 @atol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 8903427589123480
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = call i64 @atol(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp ne i64 %11, 9012783012740234983
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void name(void) { printf("your name\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"your name\00"
define void @name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void avcodec_decode_subtitle2() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_decode_subtitle2() {
ret void
}
unsigned long GCD(unsigned long a, unsigned long b) {
  while (a != b) {
    if (a < b)
      b -= a;
    if (b < a)
      a -= b;
  }
  return a;
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1159 <GCD+0x59>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1137 <GCD+0x37>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1154 <GCD+0x54>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <GCD+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
mov    %rsi,%rax
cmp    %rdi,%rsi
jne    1118 <GCD+0x18>
ret
nopl   0x0(%rax)
sub    %rcx,%rdi
cmp    %rdi,%rax
je     1108 <GCD+0x8>
cmp    %rdi,%rax
mov    $0x0,%ecx
cmova  %rdi,%rcx
sub    %rcx,%rax
mov    %rax,%rcx
cmp    %rax,%rdi
ja     1110 <GCD+0x10>
xor    %ecx,%ecx
jmp    1110 <GCD+0x10>

LLVM IR (-O0):
define i64 @GCD(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %25, %2
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %26
9: ; preds = %5
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = sub i64 %15, %14
store i64 %16, i64* %4
br label %17
17: ; preds = %13, %9
%18 = load i64, i64* %4
%19 = load i64, i64* %3
%20 = icmp ult i64 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i64, i64* %4
%23 = load i64, i64* %3
%24 = sub i64 %23, %22
store i64 %24, i64* %3
br label %25
25: ; preds = %21, %17
br label %5
26: ; preds = %5
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @GCD(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, %0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ %1, %2 ]
%6 = phi i64 [ %12, %4 ], [ %0, %2 ]
%7 = icmp ugt i64 %5, %6
%8 = select i1 %7, i64 %6, i64 0
%9 = sub i64 %5, %8
%10 = icmp ugt i64 %6, %9
%11 = select i1 %10, i64 %9, i64 0
%12 = sub i64 %6, %11
%13 = icmp eq i64 %9, %12
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i64 [ %1, %2 ], [ %9, %4 ]
ret i64 %15
}
/* Variables and functions */
int inverseper(int);
int inversesBoxLookup(int);
int revroundfunc(int stateVal, int key_round) {
  stateVal = stateVal ^ key_round;
  stateVal = inverseper(stateVal);
  stateVal = inversesBoxLookup(stateVal);
  return stateVal;
}


x86 assembly (clang, -O0):
<revroundfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <inverseper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inversesBoxLookup@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revroundfunc>:
push   %rax
xor    %esi,%edi
call   1040 <inverseper@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <inversesBoxLookup@plt>

LLVM IR (-O0):
define i32 @revroundfunc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = xor i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @inverseper(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @inversesBoxLookup(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @revroundfunc(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @inverseper(i32 %3)
%5 = tail call i32 @inversesBoxLookup(i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t c_ret_u8() { return 0xff; }


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

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

LLVM IR (-O0):
define i32 @c_ret_u8() {
ret i32 255
}

LLVM IR (-O2):
define i32 @c_ret_u8() {
ret i32 255
}
int st_DestroyTable(struct st_table *table) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.st_table = type opaque
define i32 @st_DestroyTable(%struct.st_table* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_ssumkbn(int /*<<< orphan*/ const, float const *,
                             int /*<<< orphan*/ const);
float stdlib_strided_ssum(const int64_t N, const float *X,
                          const int64_t stride) {
  return stdlib_strided_ssumkbn(N, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_ssum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_ssumkbn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_ssum>:
jmp    1030 <stdlib_strided_ssumkbn@plt>

LLVM IR (-O0):
define float @stdlib_strided_ssum(i32 %0, float* %1, i32 %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = call float @stdlib_strided_ssumkbn(i32 %7, float* %8, i32 %9)
ret float %10
}

LLVM IR (-O2):
define float @stdlib_strided_ssum(i32 %0, float* %1, i32 %2) {
%4 = tail call float @stdlib_strided_ssumkbn(i32 %0, float* %1, i32 %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int rec(int);
int /*<<< orphan*/ stderr;
int main(void) {
  int sum;
  fprintf(stderr, "lsframe2: start\n");
  sum = rec(64);
  fprintf(stderr, "lsframe2: done, result is %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x40,%edi
call   1040 <rec@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x40,%edi
call   1040 <rec@plt>
mov    (%rbx),%edi
lea    0xec6(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"lsframe2: start\0A\00"
@.str.1 = [30 x i8] c"lsframe2: done, result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @rec(i32 64)
store i32 %5, i32* %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"lsframe2: start\0A\00"
@.str.1 = [30 x i8] c"lsframe2: done, result is %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @rec(i32 64)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ childFunc(void *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  long levels;
  levels = (argc > 1) ? atoi(argv[1]) : 5;
  childFunc((void *)levels);
  exit(EXIT_SUCCESS);
}


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)
cmpl   $0x1,-0x8(%rbp)
jle    1165 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    1172 <main+0x42>
mov    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    1172 <main+0x42>
mov    -0x1c(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <childFunc@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x5,%edi
cmp    $0x2,%eax
jl     1149 <main+0x19>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
movslq %eax,%rdi
call   1030 <childFunc@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %9
%16 = phi i32 [ %13, %9 ], [ 5, %14 ]
%17 = sext i32 %16 to i64
store i64 %17, i64* %6
%18 = load i64, i64* %6
%19 = inttoptr i64 %18 to i8*
%20 = call i32 @childFunc(i8* %19)
%21 = load i32, i32* @EXIT_SUCCESS
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
br label %10
10: ; preds = %2, %4
%11 = phi i8* [ %9, %4 ], [ inttoptr (i64 5 to i8*), %2 ]
%12 = tail call i32 @childFunc(i8* %11)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = tail call i32 @exit(i32 %13)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void forth_constant(const char *name, int value) {
  printf("%d constant %s\n", value, name);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"%d constant %s\0A\00"
define void @forth_constant(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d constant %s\0A\00"
define void @forth_constant(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void indent(char *s, int lev) {
  if (s)
    printf("%s", s);
  while (lev-- >= 0)
    printf("  ");
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <indent+0x2c>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1141 <indent+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jl     1168 <indent+0x58>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1141 <indent+0x31>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
test   %rdi,%rdi
je     112c <indent+0x1c>
mov    %rdi,%rsi
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
js     114f <indent+0x3f>
add    $0x1,%ebx
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <indent+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c" \00"
define void @indent(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %2
%7 = icmp sgt i32 %1, -1
br i1 %7, label %8, label %13
8: ; preds = %6, %8
%9 = phi i32 [ %10, %8 ], [ %1, %6 ]
%10 = add nsw i32 %9, -1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %6
ret void
}
int fun262() { return 262; }


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

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

LLVM IR (-O0):
define i32 @fun262() {
ret i32 262
}

LLVM IR (-O2):
define i32 @fun262() {
ret i32 262
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
int /*<<< orphan*/ reset_prog_mode();
void cmd_reset_prog_mode(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(reset_prog_mode());
}


x86 assembly (clang, -O0):
<cmd_reset_prog_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_reset_prog_mode+0x27>
jmp    117f <cmd_reset_prog_mode+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1050 <reset_prog_mode@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_reset_prog_mode>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_reset_prog_mode+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1050 <reset_prog_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_reset_prog_mode(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @reset_prog_mode()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_reset_prog_mode(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @reset_prog_mode()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Type definitions */
struct byz {
  int dummy;
};

/* Variables and functions */
struct byz *byz_new(size_t, size_t);
struct byz *byz_new_fixed(size_t fixed_len) {
  return byz_new(fixed_len, fixed_len);
}


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

x86 assembly (clang, -O2):
<byz_new_fixed>:
mov    %rdi,%rsi
jmp    1030 <byz_new@plt>

LLVM IR (-O0):
%struct.byz = type { i32 }
define %struct.byz* @byz_new_fixed(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = call %struct.byz* @byz_new(i64 %3, i64 %4)
ret %struct.byz* %5
}

LLVM IR (-O2):
%struct.byz = type { i32 }
define %struct.byz* @byz_new_fixed(i64 %0) {
%2 = tail call %struct.byz* @byz_new(i64 %0, i64 %0)
ret %struct.byz* %2
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructModuleName(struct constructHeader *);
const char *EnvDeffactsModule(void *theEnv, void *theDeffacts) {
  return GetConstructModuleName((struct constructHeader *)theDeffacts);
}


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

x86 assembly (clang, -O2):
<EnvDeffactsModule>:
mov    %rsi,%rdi
jmp    1030 <GetConstructModuleName@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvDeffactsModule(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.constructHeader*
%7 = call i8* @GetConstructModuleName(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvDeffactsModule(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructModuleName(%struct.constructHeader* %3)
ret i8* %4
}
float *quat_conjugate(float *result, float *a) {
  result[0] = -a[0];
  result[1] = -a[1];
  result[2] = -a[2];
  result[3] = a[3];
  return result;
}


x86 assembly (clang, -O0):
<quat_conjugate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_conjugate>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movaps 0xef2(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @quat_conjugate(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = fneg float %7
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fneg float %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = fneg float %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 3
%25 = load float, float* %24
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 3
store float %25, float* %27
%28 = load float*, float** %3
ret float* %28
}

LLVM IR (-O2):
define float* @quat_conjugate(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 3
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %0, i64 3
store float %14, float* %15
ret float* %0
}
int bit_index(register unsigned int a) {
  register int i;
  if (a == 0)
    return -1;
  for (i = 0; (a & 1) == 0; a >>= 1, i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<bit_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <bit_index+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <bit_index+0x55>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114f <bit_index+0x4f>
jmp    1138 <bit_index+0x38>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <bit_index+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_index>:
test   %edi,%edi
je     111e <bit_index+0x1e>
xor    %eax,%eax
test   $0x1,%dil
jne    111d <bit_index+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1110 <bit_index+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bit_index(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
float cos(float);
float fl(float x) { return 4 * x + cos(x); }


x86 assembly (clang, -O0):
<fl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
movss  0xebf(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fl>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <cos@plt>
movss  0x4(%rsp),%xmm1
mulss  0xed6(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fl(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @cos(float %4)
%6 = call float @llvm.fmuladd.f32(float 4.000000e+00, float %3, float %5)
ret float %6
}

LLVM IR (-O2):
define float @fl(float %0) {
%2 = tail call float @cos(float %0)
%3 = tail call float @llvm.fmuladd.f32(float %0, float 4.000000e+00, float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void string_set(char *s1, const char *s2) { strcpy(s1, s2); }


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

x86 assembly (clang, -O2):
<string_set>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @string_set(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ innprod(double *, double *, int);
double sqrt(int /*<<< orphan*/);
double frobenius_norm(double *v, int m, int n) {
  return (sqrt(innprod(v, v, m * n)));
}


x86 assembly (clang, -O0):
<frobenius_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
imul   -0x10(%rbp),%edx
call   1030 <innprod@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frobenius_norm>:
push   %rax
imul   %esi,%edx
mov    %rdi,%rsi
call   1030 <innprod@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @frobenius_norm(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = call i32 @innprod(double* %7, double* %8, i32 %11)
%13 = call double @sqrt(i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @frobenius_norm(double* %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = tail call i32 @innprod(double* %0, double* %0, i32 %4)
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
/* Variables and functions */
char const *gettext(char const *);
scalar_t__ use_gettext_poison();
__attribute__((format_arg(1))) const char *_(const char *msgid) {
  if (!*msgid)
    return "";
  return use_gettext_poison() ? "# GETTEXT POISON #" : gettext(msgid);
}


x86 assembly (clang, -O0):
<_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1149 <_+0x29>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <_+0x5f>
mov    $0x0,%al
call   1030 <use_gettext_poison@plt>
cmp    $0x0,%rax
je     116a <_+0x4a>
lea    0xe9f(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1177 <_+0x57>
mov    -0x10(%rbp),%rdi
call   1040 <gettext@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113e <_+0x1e>
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <use_gettext_poison@plt>
test   %rax,%rax
je     1147 <_+0x27>
lea    0xec4(%rip),%rax
pop    %rbx
ret
lea    0xecd(%rip),%rax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <gettext@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [19 x i8] c"# GETTEXT POISON #\00"
define i8* @_(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
8: ; preds = %1
%9 = call i64 (...) @use_gettext_poison()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %15
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = call i8* @gettext(i8* %13)
br label %15
15: ; preds = %12, %11
%16 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %11 ], [ %14, %12 ]
store i8* %16, i8** %2
br label %17
17: ; preds = %15, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [19 x i8] c"# GETTEXT POISON #\00"
define i8* @_(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 (...) @use_gettext_poison()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i8* @gettext(i8* %0)
br label %9
9: ; preds = %7, %4, %1
%10 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ], [ %8, %7 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %4 ]
ret i8* %10
}
int test_imm_C5int8_mem(signed char *val) {
  return ((*val) & (-0xC5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C5int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff3b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C5int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff3b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -197
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ play_sectors_test();
int /*<<< orphan*/ read_sectors_test();
int /*<<< orphan*/ select_track();
void run_cdda_test() {
  if (!select_track())
    return;
  play_sectors_test();
  read_sectors_test();
}


x86 assembly (clang, -O0):
<run_cdda_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <select_track@plt>
cmp    $0x0,%eax
jne    1149 <run_cdda_test+0x19>
jmp    1157 <run_cdda_test+0x27>
mov    $0x0,%al
call   1050 <play_sectors_test@plt>
mov    $0x0,%al
call   1030 <read_sectors_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_cdda_test>:
push   %rax
xor    %eax,%eax
call   1040 <select_track@plt>
test   %eax,%eax
je     114b <run_cdda_test+0x1b>
xor    %eax,%eax
call   1050 <play_sectors_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <read_sectors_test@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @run_cdda_test() {
%1 = call i32 (...) @select_track()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %7
4: ; preds = %0
%5 = call i32 (...) @play_sectors_test()
%6 = call i32 (...) @read_sectors_test()
br label %7
7: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @run_cdda_test() {
%1 = tail call i32 (...) @select_track()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @play_sectors_test()
%5 = tail call i32 (...) @read_sectors_test()
br label %6
6: ; preds = %0, %3
ret void
}
/* Variables and functions */
int i2c_smbus_write_word_data(int, int, int);
int wiringPiI2CWriteReg16(int fd, int reg, int data) {
  return i2c_smbus_write_word_data(fd, reg, data);
}


x86 assembly (clang, -O0):
<wiringPiI2CWriteReg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <i2c_smbus_write_word_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiI2CWriteReg16>:
jmp    1030 <i2c_smbus_write_word_data@plt>

LLVM IR (-O0):
define i32 @wiringPiI2CWriteReg16(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 = call i32 @i2c_smbus_write_word_data(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @wiringPiI2CWriteReg16(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @i2c_smbus_write_word_data(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ state;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
unsigned get_XLeaveWindowEvent_state(void *_p) {
  return (unsigned)((XLeaveWindowEvent *)_p)->state;
}


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

x86 assembly (clang, -O2):
<get_XLeaveWindowEvent_state>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XLeaveWindowEvent_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XLeaveWindowEvent_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int ph_http_put_deinit(void *handler) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ph_http_put_deinit(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int foo(int, int, int, int, int, int, int, int, int, int, int, int, int, int,
        int, int);
int main() {
  return foo(0., 0., 6., 1., 0., 2., 0., 0., 3., 0., 5., 0., 7., 0., 11., 0.);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
xor    %r8d,%r8d
mov    $0x6,%edx
mov    $0x1,%ecx
mov    $0x2,%r9d
mov    %r8d,%edi
mov    %r8d,%esi
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x3,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x5,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x7,0x30(%rsp)
movl   $0x0,0x38(%rsp)
movl   $0xb,0x40(%rsp)
movl   $0x0,0x48(%rsp)
call   1030 <foo@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x6,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x2,%r9d
push   $0x0
push   $0xb
push   $0x0
push   $0x7
push   $0x0
push   $0x5
push   $0x0
push   $0x3
push   $0x0
push   $0x0
call   1030 <foo@plt>
add    $0x50,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0, i32 0, i32 6, i32 1, i32 0, i32 2, i32 0, i32 0, i32 3, i32 0, i32 5, i32 0, i32 7, i32 0, i32 11, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 0, i32 6, i32 1, i32 0, i32 2, i32 0, i32 0, i32 3, i32 0, i32 5, i32 0, i32 7, i32 0, i32 11, i32 0)
ret i32 %1
}
/* Variables and functions */
void *getNAt(void *, int, void *);
void *getNN(void *obj, void *node) { return getNAt(obj, 1, node); }


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

x86 assembly (clang, -O2):
<getNN>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <getNAt@plt>

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

LLVM IR (-O2):
define i8* @getNN(i8* %0, i8* %1) {
%3 = tail call i8* @getNAt(i8* %0, i32 1, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
void f2(int size) {
  char src[12] = "helloworld";
  char dest[12];
  memmove(dest, src, size);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
sub    $0x18,%rsp
mov    %edi,%edx
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <memmove@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f2.src = [12 x i8] c"helloworld\00\00"
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
store i32 %0, i32* %2
%5 = bitcast [12 x i8]* %3 to i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @memmove(i8* %6, i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@__const.f2.src = [12 x i8] c"helloworld\00\00"
define void @f2(i32 %0) {
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = call i32 @memmove(i8* %5, i8* %4, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
void setgrent() {
  StubBug("STUB:"
          "setgrent");
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"STUB:setgrent\00"
define void @setgrent() {
%1 = call i32 @StubBug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"STUB:setgrent\00"
define void @setgrent() {
%1 = tail call i32 @StubBug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void bar(int c) {
  static int x = 1;
  if (c != x)
    __builtin_abort();
  x--;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    0x2f04(%rip),%eax
je     112f <bar+0x1f>
call   1030 <abort@plt>
mov    0x2ef3(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2eea(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
cmp    %edi,0x2f11(%rip)
jne    1124 <bar+0x14>
add    $0xffffffff,%edi
mov    %edi,0x2f06(%rip)
pop    %rax
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@bar.x = internal global i32 1
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @bar.x
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
unreachable
7: ; preds = %1
%8 = load i32, i32* @bar.x
%9 = add nsw i32 %8, -1
store i32 %9, i32* @bar.x
ret void
}

LLVM IR (-O2):
@bar.x = internal unnamed_addr global i32 1
define void @bar(i32 %0) {
%2 = load i32, i32* @bar.x
%3 = icmp eq i32 %2, %0
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @abort()
unreachable
5: ; preds = %1
%6 = add nsw i32 %0, -1
store i32 %6, i32* @bar.x
ret void
}
/* Variables and functions */
size_t argv_len(char *const argv[]) {
  size_t len = 0;
  for (; argv && *argv; argv++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<argv_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     112e <argv_len+0x2e>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113e <argv_len+0x3e>
jmp    115b <argv_len+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <argv_len+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_len>:
test   %rdi,%rdi
je     1120 <argv_len+0x20>
cmpq   $0x0,(%rdi)
je     1120 <argv_len+0x20>
xor    %ecx,%ecx
nopl   (%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <argv_len+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @argv_len(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
store i8** %0, i8*** %2
store i64 0, i64* %3
br label %4
4: ; preds = %16, %1
%5 = load i8**, i8*** %2
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %7, %4
%12 = phi i1 [ false, %4 ], [ %10, %7 ]
br i1 %12, label %13, label %19
13: ; preds = %11
%14 = load i64, i64* %3
%15 = add i64 %14, 1
store i64 %15, i64* %3
br label %16
16: ; preds = %13
%17 = load i8**, i8*** %2
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %2
br label %4
19: ; preds = %11
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @argv_len(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8** [ %10, %6 ], [ %0, %3 ]
%8 = phi i64 [ %9, %6 ], [ 0, %3 ]
%9 = add i64 %8, 1
%10 = getelementptr inbounds i8*, i8** %7, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i64 %14
}
const char *iobroker_strerror(int error) { return ""; }


x86 assembly (clang, -O0):
<iobroker_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @iobroker_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @iobroker_strerror(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
int fun141() { return 141; }


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

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

LLVM IR (-O0):
define i32 @fun141() {
ret i32 141
}

LLVM IR (-O2):
define i32 @fun141() {
ret i32 141
}