void C67_Adjust_ADDK(int *inst, int n) {
  do {
    if (!(abs(n) < 32767))
      error("internal compiler error file at %s:%d",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/LuaDist/tcc/refs/heads/master/c67-gen.c",
            1423);
  } while (0);
  *inst = (*inst & (~(0xffff << 7))) | ((n & 0xffff) << 7);
}


x86 assembly (clang, -O0):
<C67_Adjust_ADDK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x7fff,%eax
jl     115c <C67_Adjust_ADDK+0x3c>
lea    0xeb7(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x58f,%edx
mov    $0x0,%al
call   1040 <error@plt>
jmp    1161 <C67_Adjust_ADDK+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xff80007f,%ecx
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
shl    $0x7,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_Adjust_ADDK>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
cmp    $0x7fff,%eax
jb     1140 <C67_Adjust_ADDK+0x30>
lea    0xed3(%rip),%rdi
lea    0xef2(%rip),%rsi
mov    $0x58f,%edx
xor    %eax,%eax
call   1030 <error@plt>
mov    $0xff80007f,%eax
and    (%rbx),%eax
movzwl %bp,%ecx
shl    $0x7,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"internal compiler error file at %s:%d\00"
@.str.1 = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LuaDist/tcc/refs/heads/master/c67-gen.c\00"
define void @C67_Adjust_ADDK(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %4
%7 = call i32 @abs(i32 %6)
%8 = icmp slt i32 %7, 32767
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.1, i64 0, i64 0), i32 1423)
br label %11
11: ; preds = %9, %5
br label %12
12: ; preds = %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = and i32 %14, -8388481
%16 = load i32, i32* %4
%17 = and i32 %16, 65535
%18 = shl i32 %17, 7
%19 = or i32 %15, %18
%20 = load i32*, i32** %3
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"internal compiler error file at %s:%d\00"
@.str.1 = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LuaDist/tcc/refs/heads/master/c67-gen.c\00"
define void @C67_Adjust_ADDK(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = icmp ult i32 %3, 32767
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.1, i64 0, i64 0), i32 1423)
br label %7
7: ; preds = %2, %5
%8 = load i32, i32* %0
%9 = and i32 %8, -8388481
%10 = shl i32 %1, 7
%11 = and i32 %10, 8388480
%12 = or i32 %9, %11
store i32 %12, i32* %0
ret void
}