xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ left_rotate(int *, int, int);
void key_rotate(bool v[], int n) {
  left_rotate(v, 28, n);
  left_rotate(&v[28], 28, n);
}


x86 assembly (clang, -O0):
<key_rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1c,%esi
call   1030 <left_rotate@plt>
mov    -0x8(%rbp),%rdi
add    $0x70,%rdi
mov    -0xc(%rbp),%edx
mov    $0x1c,%esi
call   1030 <left_rotate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_rotate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1c,%esi
mov    %ebp,%edx
call   1030 <left_rotate@plt>
add    $0x70,%rbx
mov    %rbx,%rdi
mov    $0x1c,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <left_rotate@plt>

LLVM IR (-O0):
define void @key_rotate(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 = call i32 @left_rotate(i32* %5, i32 28, i32 %6)
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 28
%10 = load i32, i32* %4
%11 = call i32 @left_rotate(i32* %9, i32 28, i32 %10)
ret void
}

LLVM IR (-O2):
define void @key_rotate(i32* %0, i32 %1) {
%3 = tail call i32 @left_rotate(i32* %0, i32 28, i32 %1)
%4 = getelementptr inbounds i32, i32* %0, i64 28
%5 = tail call i32 @left_rotate(i32* %4, i32 28, i32 %1)
ret void
}
void g_key_file_set_boolean_list() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_set_boolean_list() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIRCalcBlackmanHarrisWindow(int, double *);
int /*<<< orphan*/ FIRCalcWindow(int, double, double *, double *);
int /*<<< orphan*/ free(double *);
double *malloc(int);
void FIRCalcBlackmanHarris(int length, double cutoff, double *coeffs) {
  double *window;
  window = malloc(length * sizeof(double));
  FIRCalcBlackmanHarrisWindow(length, window);
  FIRCalcWindow(length, cutoff, coeffs, window);
  free(window);
}


x86 assembly (clang, -O0):
<FIRCalcBlackmanHarris>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <FIRCalcBlackmanHarrisWindow@plt>
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <FIRCalcWindow@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIRCalcBlackmanHarris>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r15d
lea    0x0(,%r15,8),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r15d,%edi
mov    %rax,%rsi
call   1050 <FIRCalcBlackmanHarrisWindow@plt>
mov    %r15d,%edi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <FIRCalcWindow@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FIRCalcBlackmanHarris(i32 %0, double %1, double* %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
store i32 %0, i32* %4
store double %1, double* %5
store double* %2, double** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call double* @malloc(i32 %11)
store double* %12, double** %7
%13 = load i32, i32* %4
%14 = load double*, double** %7
%15 = call i32 @FIRCalcBlackmanHarrisWindow(i32 %13, double* %14)
%16 = load i32, i32* %4
%17 = load double, double* %5
%18 = load double*, double** %6
%19 = load double*, double** %7
%20 = call i32 @FIRCalcWindow(i32 %16, double %17, double* %18, double* %19)
%21 = load double*, double** %7
%22 = call i32 @free(double* %21)
ret void
}

LLVM IR (-O2):
define void @FIRCalcBlackmanHarris(i32 %0, double %1, double* %2) {
%4 = shl i32 %0, 3
%5 = tail call double* @malloc(i32 %4)
%6 = tail call i32 @FIRCalcBlackmanHarrisWindow(i32 %0, double* %5)
%7 = tail call i32 @FIRCalcWindow(i32 %0, double %1, double* %2, double* %5)
%8 = tail call i32 @free(double* %5)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *dupstr(char *s) {
  char *p = NULL;
  if (s) {
    p = malloc(strlen(s) + 1);
    if (p) {
      strcpy(p, s);
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1185 <dupstr+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1180 <dupstr+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1185 <dupstr+0x55>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <dupstr+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <dupstr+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <dupstr+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %6
br label %18
18: ; preds = %17, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %8, %1
%11 = phi i8* [ %6, %8 ], [ null, %3 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ arch_jmp(char *);
void emit_jmp(char *lbl) { arch_jmp(lbl); }


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

x86 assembly (clang, -O2):
<emit_jmp>:
jmp    1030 <arch_jmp@plt>

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

LLVM IR (-O2):
define void @emit_jmp(i8* %0) {
%2 = tail call i32 @arch_jmp(i8* %0)
ret void
}
double Sleef_exp2_u10(double x) { return __builtin_exp2(x); }


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

x86 assembly (clang, -O2):
<Sleef_exp2_u10>:
jmp    1030 <exp2@plt>

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

LLVM IR (-O2):
define double @Sleef_exp2_u10(double %0) {
%2 = tail call double @exp2(double %0)
ret double %2
}
void f1(void) { extern int x7; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ addBackList(struct linkedList *, int);
int /*<<< orphan*/ assert(int);
void addList(struct linkedList *lst, int v) {
  assert(lst != 0);
  addBackList(lst, v);
}


x86 assembly (clang, -O0):
<addList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <addBackList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addList>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <addBackList@plt>

LLVM IR (-O0):
%struct.linkedList = type { i32 }
define void @addList(%struct.linkedList* %0, i32 %1) {
%3 = alloca %struct.linkedList*
%4 = alloca i32
store %struct.linkedList* %0, %struct.linkedList** %3
store i32 %1, i32* %4
%5 = load %struct.linkedList*, %struct.linkedList** %3
%6 = icmp ne %struct.linkedList* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.linkedList*, %struct.linkedList** %3
%10 = load i32, i32* %4
%11 = call i32 @addBackList(%struct.linkedList* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
define void @addList(%struct.linkedList* %0, i32 %1) {
%3 = icmp ne %struct.linkedList* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @addBackList(%struct.linkedList* %0, i32 %1)
ret void
}
/* Variables and functions */
unsigned long string_new(char *);
unsigned long int nil_to_s() { return string_new("nil"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"nil\00"
define i64 @nil_to_s() {
%1 = call i64 @string_new(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"nil\00"
define i64 @nil_to_s() {
%1 = tail call i64 @string_new(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}
int ckpswinp(int spec) {
  switch (spec) {
  case 12:
    return 512;
  case 15:
    return 512;
  default:;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ckpswinp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xc,%eax
je     112c <ckpswinp+0x2c>
jmp    111b <ckpswinp+0x1b>
mov    -0xc(%rbp),%eax
sub    $0xf,%eax
je     1138 <ckpswinp+0x38>
jmp    1144 <ckpswinp+0x44>
movl   $0x200,-0x4(%rbp)
jmp    1150 <ckpswinp+0x50>
movl   $0x200,-0x4(%rbp)
jmp    1150 <ckpswinp+0x50>
jmp    1149 <ckpswinp+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckpswinp>:
cmp    $0xc,%edi
sete   %al
cmp    $0xf,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
shl    $0x9,%eax
ret

LLVM IR (-O0):
define i32 @ckpswinp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 12, label %5
i32 15, label %6
]
5: ; preds = %1
store i32 512, i32* %2
br label %9
6: ; preds = %1
store i32 512, i32* %2
br label %9
7: ; preds = %1
br label %8
8: ; preds = %7
store i32 0, i32* %2
br label %9
9: ; preds = %8, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @ckpswinp(i32 %0) {
%2 = icmp eq i32 %0, 12
%3 = icmp eq i32 %0, 15
%4 = or i1 %2, %3
%5 = select i1 %4, i32 512, i32 0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int kern(float *p, int32_t *k) {
  p[9] = 10;
  return 0;
}


x86 assembly (clang, -O0):
<kern>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0xee8(%rip),%xmm0
movss  %xmm0,0x24(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kern>:
movl   $0x41200000,0x24(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @kern(float* %0, i32* %1) {
%3 = alloca float*
%4 = alloca i32*
store float* %0, float** %3
store i32* %1, i32** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 9
store float 1.000000e+01, float* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @kern(float* nocapture writeonly %0, i32* nocapture readnone %1) {
%3 = getelementptr inbounds float, float* %0, i64 9
store float 1.000000e+01, float* %3
ret i32 0
}
int test_imm_E9int8_mem(signed char *val) {
  return ((*val) & (0xE9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E9int8_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, 233
%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_E9int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -23
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cyg_test_exit();
int /*<<< orphan*/ perror(char *);
void pexit(char *s) {
  perror(s);
  cyg_test_exit();
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <cyg_test_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pexit>:
push   %rax
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cyg_test_exit@plt>

LLVM IR (-O0):
define void @pexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 (...) @cyg_test_exit()
ret void
}

LLVM IR (-O2):
define void @pexit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 (...) @cyg_test_exit()
ret void
}
int reverseBits_fun_int(int x) {
  int r = x;
  int i = 31;
  for (x = x >> 1 & 0x7fffffff; x; x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x7fffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <reverseBits_fun_int+0x54>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <reverseBits_fun_int+0x22>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_int>:
mov    $0x1f,%ecx
cmp    $0x2,%edi
jae    110e <reverseBits_fun_int+0xe>
mov    %edi,%eax
jmp    1134 <reverseBits_fun_int+0x34>
mov    $0x1f,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
shr    %edx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <reverseBits_fun_int+0x20>
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @reverseBits_fun_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 31, i32* %4
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = and i32 %7, 2147483647
store i32 %8, i32* %2
br label %9
9: ; preds = %20, %1
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
%15 = load i32, i32* %2
%16 = and i32 %15, 1
%17 = or i32 %14, %16
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %20
20: ; preds = %12
%21 = load i32, i32* %2
%22 = ashr i32 %21, 1
store i32 %22, i32* %2
br label %9
23: ; preds = %9
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = shl i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @reverseBits_fun_int(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 31, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = lshr i32 %4, 1
%8 = shl i32 %6, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i32 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 31, %1 ], [ %11, %3 ]
%16 = shl i32 %14, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ GetMemory(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void Test(void) {
  char *str = NULL;
  GetMemory(&str, 100);
  strcpy(str, "hello world");
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x64,%esi
call   1050 <GetMemory@plt>
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x64,%esi
call   1050 <GetMemory@plt>
mov    (%rsp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
mov    (%rsp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Test() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i32 @GetMemory(i8** %1, i32 100)
%3 = load i8*, i8** %1
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Test() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @GetMemory(i8** %1, i32 100)
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_SetCLKREG(int, int, unsigned char, unsigned char);
void i2c1_SetCLKREG(int mode, unsigned char prescale1,
                    unsigned char prescale2) {
  i2c_SetCLKREG(1, mode, prescale1, prescale2);
}


x86 assembly (clang, -O0):
<i2c1_SetCLKREG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x5(%rbp),%al
mov    $0x1,%edi
movzbl %al,%edx
movzbl -0x6(%rbp),%ecx
call   1030 <i2c_SetCLKREG@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_SetCLKREG>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <i2c_SetCLKREG@plt>

LLVM IR (-O0):
define void @i2c1_SetCLKREG(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i32 @i2c_SetCLKREG(i32 1, i32 %7, i8 zeroext %8, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @i2c1_SetCLKREG(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @i2c_SetCLKREG(i32 1, i32 %0, i8 zeroext %1, i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("Create : %s -f datafile -s size_of_blockdevice[MG] -m "
         "commit_interval [-z sectorsize(512..4096) -b(barrier) -c(create) "
         "-h(help) -p(cachesize)]\n",
         name);
  printf("Detach : %s -d /dev/eprd_device_name\n", name);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf49(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf56(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"Create : %s -f datafile -s size_of_blockdevice[MG] -m commit_interval [-z sectorsize(512..4096) -b(barrier) -c(create) -h(help) -p(cachesize)]\0A\00"
@.str.1 = [38 x i8] c"Detach : %s -d /dev/eprd_device_name\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [144 x i8] c"Create : %s -f datafile -s size_of_blockdevice[MG] -m commit_interval [-z sectorsize(512..4096) -b(barrier) -c(create) -h(help) -p(cachesize)]\0A\00"
@.str.1 = [38 x i8] c"Detach : %s -d /dev/eprd_device_name\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int fatal_signal_pending(struct task_struct *task) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @fatal_signal_pending(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fibonacci(int number) {
  int curr = 0;
  int next = 1;
  int i;
  int swap;
  for (i = 0; i < number; i++) {
    printf("%d\n", curr);
    swap = curr;
    curr = next;
    next = swap + next;
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116e <fibonacci+0x5e>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <fibonacci+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    114a <fibonacci+0x3a>
mov    %edi,%ebx
mov    $0x1,%r15d
xor    %ebp,%ebp
lea    0xed4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
add    %r15d,%eax
mov    %r15d,%ebp
mov    %eax,%r15d
add    $0xffffffff,%ebx
jne    1130 <fibonacci+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @fibonacci(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = phi i32 [ %8, %3 ], [ 1, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = add nsw i32 %4, %6
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_fatal(char *, char *, int);
int piece_pawn_opp(int piece) {
  {
    if (!(piece == (((1 << 2)) | (1 << 0)) || piece == (((1 << 3)) | (1 << 1))))
      my_fatal("file \"%s\", line %d, assertion \""
               "piece==BlackPawn256||piece==WhitePawn256"
               "\" failed\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/"
               "master/piece.c",
               70);
  };
  return piece ^ 15;
}


x86 assembly (clang, -O0):
<piece_pawn_opp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     1147 <piece_pawn_opp+0x37>
cmpl   $0xa,-0x4(%rbp)
je     1147 <piece_pawn_opp+0x37>
lea    0xeca(%rip),%rdi
lea    0xf14(%rip),%rsi
mov    $0x46,%edx
call   1030 <my_fatal@plt>
mov    -0x4(%rbp),%eax
xor    $0xf,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_pawn_opp>:
push   %rbx
mov    %edi,%ebx
cmp    $0x5,%edi
je     1135 <piece_pawn_opp+0x25>
cmp    $0xa,%ebx
je     1135 <piece_pawn_opp+0x25>
lea    0xedc(%rip),%rdi
lea    0xf26(%rip),%rsi
mov    $0x46,%edx
call   1030 <my_fatal@plt>
xor    $0xf,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [81 x i8] c"file \22%s\22, line %d, assertion \22piece==BlackPawn256||piece==WhitePawn256\22 failed\0A\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/piece.c\00"
define i32 @piece_pawn_opp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 5
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 10
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @my_fatal(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 70)
br label %10
10: ; preds = %8, %5, %1
%11 = load i32, i32* %2
%12 = xor i32 %11, 15
ret i32 %12
}

LLVM IR (-O2):
@.str = [81 x i8] c"file \22%s\22, line %d, assertion \22piece==BlackPawn256||piece==WhitePawn256\22 failed\0A\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/piece.c\00"
define i32 @piece_pawn_opp(i32 %0) {
switch i32 %0, label %2 [
i32 10, label %4
i32 5, label %4
]
2: ; preds = %1
%3 = tail call i32 @my_fatal(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 70)
br label %4
4: ; preds = %1, %1, %2
%5 = xor i32 %0, 15
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
erase() { printf("erase()\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"erase()\00"
define i32 @erase() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ display_labels(char *, char *, int, unsigned int const);
void display_properties(const unsigned set, char *buffer) {
  display_labels(buffer, "abcdefghijklmno", (9), set);
}


x86 assembly (clang, -O0):
<display_properties>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
lea    0xed3(%rip),%rsi
mov    $0x9,%edx
call   1030 <display_labels@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_properties>:
mov    %rsi,%rax
mov    %edi,%ecx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
mov    $0x9,%edx
jmp    1030 <display_labels@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"abcdefghijklmno\00"
define void @display_properties(i32 %0, i8* %1) {
%3 = tail call i32 @display_labels(i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 9, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ OLED_SendByte(int /*<<< orphan*/);
int /*<<< orphan*/ OLED_SetCommand();
void SendCMD(uint8_t cmd) {
  OLED_SetCommand();
  OLED_SendByte(cmd);
}


x86 assembly (clang, -O0):
<SendCMD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <OLED_SetCommand@plt>
mov    -0x4(%rbp),%edi
call   1030 <OLED_SendByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendCMD>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <OLED_SetCommand@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <OLED_SendByte@plt>

LLVM IR (-O0):
define void @SendCMD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @OLED_SetCommand()
%4 = load i32, i32* %2
%5 = call i32 @OLED_SendByte(i32 %4)
ret void
}

LLVM IR (-O2):
define void @SendCMD(i32 %0) {
%2 = tail call i32 (...) @OLED_SetCommand()
%3 = tail call i32 @OLED_SendByte(i32 %0)
ret void
}
/* Variables and functions */
char *insert_commas(unsigned long);
char *insert_commas2(unsigned long number) {
  char *p;
  p = insert_commas(number);
  while (*p && *p == ' ')
    p++;
  return p;
}


x86 assembly (clang, -O0):
<insert_commas2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <insert_commas@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114e <insert_commas2+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115e <insert_commas2+0x4e>
jmp    116f <insert_commas2+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1129 <insert_commas2+0x19>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_commas2>:
push   %rax
call   1030 <insert_commas@plt>
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1120 <insert_commas2+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @insert_commas2(i64 %0) {
%2 = tail call i8* @insert_commas(i64 %0)
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ _src_iter_process_tab(unsigned int *, char const *,
                                         unsigned int);
void _src_iter_check_tab(unsigned *back_column, const char *current,
                         unsigned tab_size) {
  if ('\t' == *current)
    _src_iter_process_tab(back_column, current, tab_size);
}


x86 assembly (clang, -O0):
<_src_iter_check_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
jne    1147 <_src_iter_check_tab+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_src_iter_process_tab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_src_iter_check_tab>:
cmpb   $0x9,(%rsi)
jne    111a <_src_iter_check_tab+0xa>
jmp    1030 <_src_iter_process_tab@plt>
ret

LLVM IR (-O0):
define void @_src_iter_check_tab(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 9, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @_src_iter_process_tab(i32* %12, i8* %13, i32 %14)
br label %16
16: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @_src_iter_check_tab(i32* %0, i8* %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 9
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @_src_iter_process_tab(i32* %0, i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *mm_alloc(size_t);
void *mm_dup(void *d, size_t z) {
  if (!d)
    return NULL;
  void *new = mm_alloc(z);
  memcpy(new, d, z);
  return new;
}


x86 assembly (clang, -O0):
<mm_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <mm_dup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    116e <mm_dup+0x4e>
mov    -0x18(%rbp),%rdi
call   1040 <mm_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_dup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     114b <mm_dup+0x2b>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <mm_alloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
jmp    114e <mm_dup+0x2e>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @mm_dup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @mm_alloc(i64 %1)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int isnormal(float);
int __pruabi_isnormalf(float a) { return isnormal(a); }


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

x86 assembly (clang, -O2):
<__pruabi_isnormalf>:
jmp    1030 <isnormal@plt>

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

LLVM IR (-O2):
define i32 @__pruabi_isnormalf(float %0) {
%2 = tail call i32 @isnormal(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print() { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ _strptime(unsigned char const *, char const *, struct tm *, int);
char *strptime(const char *buf, const char *fmt, struct tm *tm) {
  return (char *)(_strptime((const unsigned char *)buf, fmt, tm, 1));
}


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

x86 assembly (clang, -O2):
<strptime>:
mov    $0x1,%ecx
jmp    1030 <_strptime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @strptime(i8* %0, i8* %1, %struct.tm* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.tm*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.tm* %2, %struct.tm** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.tm*, %struct.tm** %6
%10 = call i64 @_strptime(i8* %7, i8* %8, %struct.tm* %9, i32 1)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @strptime(i8* %0, i8* %1, %struct.tm* %2) {
%4 = tail call i64 @_strptime(i8* %0, i8* %1, %struct.tm* %2, i32 1)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vwscanf(int /*<<< orphan*/ *, int /*<<< orphan*/);
void uninitvar_vwscanf(void) {
  wchar_t *format;
  va_list arg;
  (void)vwscanf(format, arg);
}


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

x86 assembly (clang, -O2):
<uninitvar_vwscanf>:
jmp    1030 <vwscanf@plt>

LLVM IR (-O0):
define void @uninitvar_vwscanf() {
%1 = alloca i32*
%2 = alloca i32
%3 = load i32*, i32** %1
%4 = load i32, i32* %2
%5 = call i32 @vwscanf(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_vwscanf() {
%1 = tail call i32 @vwscanf(i32* undef, i32 undef)
ret void
}
int test_imm_40uint8_mem(unsigned char *val) {
  return ((*val) & (0x40 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_40uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 64
%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_40uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 64
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void shoot() {}


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

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

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

LLVM IR (-O2):
define void @shoot() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
struct TYPE_3__ {
  int /*<<< orphan*/ __ss;
};
typedef TYPE_1__ posix_spawnattr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int posix_spawnattr_setsigmask(posix_spawnattr_t *attr,
                               const sigset_t *sigmask) {
  memcpy(&attr->__ss, sigmask, sizeof(sigset_t));
  return 0;
}


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

x86 assembly (clang, -O2):
<posix_spawnattr_setsigmask>:
push   %rax
mov    $0x4,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setsigmask(%struct.TYPE_3__* %0, i32* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i32*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i32* %1, i32** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32*, i32** %4
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 4)
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setsigmask(%struct.TYPE_3__* %0, i32* %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = tail call i32 @memcpy(i32* %3, i32* %1, i32 4)
ret i32 0
}
/* Variables and functions */
scalar_t__ isascii(int);
int toupper(int);
int utf32_toupper(int c) { return isascii(c) ? toupper(c) : c; }


x86 assembly (clang, -O0):
<utf32_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
cmp    $0x0,%rax
je     114d <utf32_toupper+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
jmp    1153 <utf32_toupper+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_toupper>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1135 <utf32_toupper+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <toupper@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @utf32_toupper(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @toupper(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fputc(int, int /*<<< orphan*/ *);
int fput2l(int value, FILE *stream) {
  int result;
  result = fputc(value & 0xff, stream);
  if (result != EOF) {
    result = fputc((value >> 8) & 0xff, stream);
  }
  return result;
}


x86 assembly (clang, -O0):
<fput2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%eax
je     115e <fput2l+0x4e>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput2l>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <fputc@plt>
mov    0x2ec0(%rip),%rcx
cmp    (%rcx),%eax
jne    1134 <fput2l+0x24>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movzbl %bh,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fput2l(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = call i32 @fputc(i32 %7, i32* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = call i32 @fputc(i32 %16, i32* %17)
store i32 %18, i32* %5
br label %19
19: ; preds = %13, %2
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fput2l(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @fputc(i32 %3, i32* %1)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = lshr i32 %0, 8
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %1)
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ %10, %7 ], [ %4, %2 ]
ret i32 %12
}